[PATCH 1/2] imx-ipu-fb: Add board specific hook to enable display
Eric Bénard
eric at eukrea.com
Thu Jun 24 11:03:04 EDT 2010
Signed-off-by: Eric Bénard <eric at eukrea.com>
---
arch/arm/mach-imx/include/mach/imx-ipu-fb.h | 2 ++
drivers/video/imx-ipu-fb.c | 8 ++++++++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-imx/include/mach/imx-ipu-fb.h b/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
index 53c6d26..dd65b04 100644
--- a/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
+++ b/arch/arm/mach-imx/include/mach/imx-ipu-fb.h
@@ -28,6 +28,8 @@ struct imx_ipu_fb_platform_data {
const struct fb_videomode *mode;
unsigned char bpp;
void __iomem *framebuffer;
+ /** hook to enable backlight and stuff */
+ void (*enable)(int enable);
};
#endif /* __MACH_IMX_IPU_FB_H__ */
diff --git a/drivers/video/imx-ipu-fb.c b/drivers/video/imx-ipu-fb.c
index 6d1eb5e..8994da4 100644
--- a/drivers/video/imx-ipu-fb.c
+++ b/drivers/video/imx-ipu-fb.c
@@ -36,6 +36,8 @@
struct ipu_fb_info {
void __iomem *regs;
+ void (*enable)(int enable);
+
struct fb_info info;
struct device_d *dev;
};
@@ -828,6 +830,8 @@ static void ipu_fb_enable(struct fb_info *info)
* Linux driver calls sdc_set_brightness() here again,
* once is enough for us
*/
+ if (fbi->enable)
+ fbi->enable(1);
}
static void ipu_fb_disable(struct fb_info *info)
@@ -835,6 +839,9 @@ static void ipu_fb_disable(struct fb_info *info)
struct ipu_fb_info *fbi = info->priv;
u32 reg;
+ if (fbi->enable)
+ fbi->enable(0);
+
reg = reg_read(fbi, SDC_COM_CONF);
reg &= ~SDC_COM_BG_EN;
reg_write(fbi, reg, SDC_COM_CONF);
@@ -866,6 +873,7 @@ static int imxfb_probe(struct device_d *dev)
info->yres = pdata->mode->yres;
info->bits_per_pixel = pdata->bpp;
info->fbops = &imxfb_ops;
+ fbi->enable = pdata->enable;
dev_info(dev, "i.MX Framebuffer driver\n");
--
1.6.3.3
More information about the barebox
mailing list