diff options
author | Timur Tabi <timur@freescale.com> | 2011-09-28 17:19:53 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-10-04 21:10:12 -0400 |
commit | c4e5a0232763db22d6c60c391ed5816b2b2ac063 (patch) | |
tree | 8a57e8447ca0b025feba742b54296da3e7eafc55 | |
parent | 7e47c211953bd8e396b168eba2c288ea6aec20ef (diff) |
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>
-rw-r--r-- | arch/powerpc/platforms/512x/mpc512x_shared.c | 2 | ||||
-rw-r--r-- | drivers/video/fsl-diu-fb.c | 11 | ||||
-rw-r--r-- | include/linux/fsl-diu-fb.h | 8 |
3 files changed, 8 insertions, 13 deletions
diff --git a/arch/powerpc/platforms/512x/mpc512x_shared.c b/arch/powerpc/platforms/512x/mpc512x_shared.c index 3dc62f907a1e..cfe958e94e1e 100644 --- a/arch/powerpc/platforms/512x/mpc512x_shared.c +++ b/arch/powerpc/platforms/512x/mpc512x_shared.c | |||
@@ -253,7 +253,7 @@ void __init mpc512x_init_diu(void) | |||
253 | } | 253 | } |
254 | 254 | ||
255 | mode = in_be32(&diu_reg->diu_mode); | 255 | mode = in_be32(&diu_reg->diu_mode); |
256 | if (mode != MFB_MODE1) { | 256 | if (mode == MFB_MODE0) { |
257 | pr_info("%s: DIU OFF\n", __func__); | 257 | pr_info("%s: DIU OFF\n", __func__); |
258 | goto out; | 258 | goto out; |
259 | } | 259 | } |
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c index 0fd4c784f8df..6539e70cb59a 100644 --- a/drivers/video/fsl-diu-fb.c +++ b/drivers/video/fsl-diu-fb.c | |||
@@ -52,7 +52,6 @@ | |||
52 | struct diu_hw { | 52 | struct diu_hw { |
53 | struct diu __iomem *diu_reg; | 53 | struct diu __iomem *diu_reg; |
54 | spinlock_t reg_lock; | 54 | spinlock_t reg_lock; |
55 | unsigned int mode; /* DIU operation mode */ | ||
56 | }; | 55 | }; |
57 | 56 | ||
58 | struct diu_addr { | 57 | struct diu_addr { |
@@ -426,7 +425,6 @@ static struct mfb_info mfb_template[] = { | |||
426 | }; | 425 | }; |
427 | 426 | ||
428 | static struct diu_hw dr = { | 427 | static struct diu_hw dr = { |
429 | .mode = MFB_MODE1, | ||
430 | .reg_lock = __SPIN_LOCK_UNLOCKED(diu_hw.reg_lock), | 428 | .reg_lock = __SPIN_LOCK_UNLOCKED(diu_hw.reg_lock), |
431 | }; | 429 | }; |
432 | 430 | ||
@@ -620,7 +618,7 @@ static void enable_lcdc(struct fb_info *info) | |||
620 | struct fsl_diu_data *machine_data = mfbi->parent; | 618 | struct fsl_diu_data *machine_data = mfbi->parent; |
621 | 619 | ||
622 | if (!machine_data->fb_enabled) { | 620 | if (!machine_data->fb_enabled) { |
623 | out_be32(&hw->diu_mode, dr.mode); | 621 | out_be32(&hw->diu_mode, MFB_MODE1); |
624 | machine_data->fb_enabled++; | 622 | machine_data->fb_enabled++; |
625 | } | 623 | } |
626 | } | 624 | } |
@@ -1390,9 +1388,6 @@ static int request_irq_local(int irq) | |||
1390 | ints |= INT_VSYNC; | 1388 | ints |= INT_VSYNC; |
1391 | #endif | 1389 | #endif |
1392 | 1390 | ||
1393 | if (dr.mode == MFB_MODE2 || dr.mode == MFB_MODE3) | ||
1394 | ints |= INT_VSYNC_WB; | ||
1395 | |||
1396 | /* Read to clear the status */ | 1391 | /* Read to clear the status */ |
1397 | in_be32(&hw->int_status); | 1392 | in_be32(&hw->int_status); |
1398 | out_be32(&hw->int_mask, ints); | 1393 | out_be32(&hw->int_mask, ints); |
@@ -1558,7 +1553,7 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev) | |||
1558 | } | 1553 | } |
1559 | 1554 | ||
1560 | diu_mode = in_be32(&dr.diu_reg->diu_mode); | 1555 | diu_mode = in_be32(&dr.diu_reg->diu_mode); |
1561 | if (diu_mode != MFB_MODE1) | 1556 | if (diu_mode == MFB_MODE0) |
1562 | out_be32(&dr.diu_reg->diu_mode, 0); /* disable DIU */ | 1557 | out_be32(&dr.diu_reg->diu_mode, 0); /* disable DIU */ |
1563 | 1558 | ||
1564 | /* Get the IRQ of the DIU */ | 1559 | /* Get the IRQ of the DIU */ |
@@ -1611,7 +1606,7 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev) | |||
1611 | * Let DIU display splash screen if it was pre-initialized | 1606 | * Let DIU display splash screen if it was pre-initialized |
1612 | * by the bootloader, set dummy area descriptor otherwise. | 1607 | * by the bootloader, set dummy area descriptor otherwise. |
1613 | */ | 1608 | */ |
1614 | if (diu_mode != MFB_MODE1) | 1609 | if (diu_mode == MFB_MODE0) |
1615 | out_be32(&dr.diu_reg->desc[0], machine_data->dummy_ad->paddr); | 1610 | out_be32(&dr.diu_reg->desc[0], machine_data->dummy_ad->paddr); |
1616 | 1611 | ||
1617 | out_be32(&dr.diu_reg->desc[1], machine_data->dummy_ad->paddr); | 1612 | out_be32(&dr.diu_reg->desc[1], machine_data->dummy_ad->paddr); |
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h index 363d5e290cad..11c16a1fb9e3 100644 --- a/include/linux/fsl-diu-fb.h +++ b/include/linux/fsl-diu-fb.h | |||
@@ -153,12 +153,12 @@ struct diu { | |||
153 | __be32 plut; | 153 | __be32 plut; |
154 | } __attribute__ ((packed)); | 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 | #define MFB_MODE0 0 /* DIU off */ | 160 | #define MFB_MODE0 0 /* DIU off */ |
158 | #define MFB_MODE1 1 /* All three planes output to display */ | 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 | #endif /* __KERNEL__ */ | 163 | #endif /* __KERNEL__ */ |
164 | #endif /* __FSL_DIU_FB_H__ */ | 164 | #endif /* __FSL_DIU_FB_H__ */ |