Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/video: fsl-diu-fb: only DIU modes 0 and 1 are supported

The Freescale DIU video controller supports five video "modes", but only
the first two are used by the driver. The other three are special modes
that don't make sense for a framebuffer driver. Therefore, there's no
point in keeping a global variable that indicates which mode we're
supposed to use.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>

authored by

Timur Tabi and committed by
Florian Tobias Schandinat
c4e5a023 7e47c211

+8 -13
+1 -1
arch/powerpc/platforms/512x/mpc512x_shared.c
··· 253 253 } 254 254 255 255 mode = in_be32(&diu_reg->diu_mode); 256 - if (mode != MFB_MODE1) { 256 + if (mode == MFB_MODE0) { 257 257 pr_info("%s: DIU OFF\n", __func__); 258 258 goto out; 259 259 }
+3 -8
drivers/video/fsl-diu-fb.c
··· 52 52 struct diu_hw { 53 53 struct diu __iomem *diu_reg; 54 54 spinlock_t reg_lock; 55 - unsigned int mode; /* DIU operation mode */ 56 55 }; 57 56 58 57 struct diu_addr { ··· 425 426 }; 426 427 427 428 static struct diu_hw dr = { 428 - .mode = MFB_MODE1, 429 429 .reg_lock = __SPIN_LOCK_UNLOCKED(diu_hw.reg_lock), 430 430 }; 431 431 ··· 618 620 struct fsl_diu_data *machine_data = mfbi->parent; 619 621 620 622 if (!machine_data->fb_enabled) { 621 - out_be32(&hw->diu_mode, dr.mode); 623 + out_be32(&hw->diu_mode, MFB_MODE1); 622 624 machine_data->fb_enabled++; 623 625 } 624 626 } ··· 1388 1390 ints |= INT_VSYNC; 1389 1391 #endif 1390 1392 1391 - if (dr.mode == MFB_MODE2 || dr.mode == MFB_MODE3) 1392 - ints |= INT_VSYNC_WB; 1393 - 1394 1393 /* Read to clear the status */ 1395 1394 in_be32(&hw->int_status); 1396 1395 out_be32(&hw->int_mask, ints); ··· 1553 1558 } 1554 1559 1555 1560 diu_mode = in_be32(&dr.diu_reg->diu_mode); 1556 - if (diu_mode != MFB_MODE1) 1561 + if (diu_mode == MFB_MODE0) 1557 1562 out_be32(&dr.diu_reg->diu_mode, 0); /* disable DIU */ 1558 1563 1559 1564 /* Get the IRQ of the DIU */ ··· 1606 1611 * Let DIU display splash screen if it was pre-initialized 1607 1612 * by the bootloader, set dummy area descriptor otherwise. 1608 1613 */ 1609 - if (diu_mode != MFB_MODE1) 1614 + if (diu_mode == MFB_MODE0) 1610 1615 out_be32(&dr.diu_reg->desc[0], machine_data->dummy_ad->paddr); 1611 1616 1612 1617 out_be32(&dr.diu_reg->desc[1], machine_data->dummy_ad->paddr);
+4 -4
include/linux/fsl-diu-fb.h
··· 153 153 __be32 plut; 154 154 } __attribute__ ((packed)); 155 155 156 - /* Modes of operation of DIU */ 156 + /* 157 + * Modes of operation of DIU. The DIU supports five different modes, but 158 + * the driver only supports modes 0 and 1. 159 + */ 157 160 #define MFB_MODE0 0 /* DIU off */ 158 161 #define MFB_MODE1 1 /* All three planes output to display */ 159 - #define MFB_MODE2 2 /* Plane 1 to display, planes 2+3 written back*/ 160 - #define MFB_MODE3 3 /* All three planes written back to memory */ 161 - #define MFB_MODE4 4 /* Color bar generation */ 162 162 163 163 #endif /* __KERNEL__ */ 164 164 #endif /* __FSL_DIU_FB_H__ */