@@ -904,6 +904,19 @@ static int davincifb_pan_display(struct fb_var_screeninfo *var,
*/
static int davincifb_blank(int blank_mode, struct fb_info *info)
{
+ if (blank_mode == 4) {
+ dm->output_device_config(0);
+ dm->ops->davincifb_power(&dm->osd0->info, 0);
+ dm->ops->davincifb_power(&dm->osd1->info, 0);
+ dm->ops->davincifb_power(&dm->vid0->info, 0);
+ dm->ops->davincifb_power(&dm->vid1->info, 0);
+ } else if (!blank_mode) {
+ dm->output_device_config(1);
+ dm->ops->davincifb_power(&dm->osd0->info, 1);
+ dm->ops->davincifb_power(&dm->osd1->info, 1);
+ dm->ops->davincifb_power(&dm->vid0->info, 1);
+ dm->ops->davincifb_power(&dm->vid1->info, 1);
+ }
return 0;
}
@@ -1416,6 +1429,10 @@ static int davincifb_remove(struct platform_device *pdev)
/* Turn OFF the output device */
dm->output_device_config(0);
+ dm->ops->davincifb_power(&dm->osd0->info, 0);
+ dm->ops->davincifb_power(&dm->osd1->info, 0);
+ dm->ops->davincifb_power(&dm->vid0->info, 0);
+ dm->ops->davincifb_power(&dm->vid1->info, 0);
if (dm->mmio_base)
iounmap((void *)dm->mmio_base);
@@ -1445,6 +1462,7 @@ static int davincifb_probe(struct platform_device *pdev)
}
pdata = pdev->dev.platform_data;
+ dm->ops = pdata->ops;
/* map the regions */
dm->mmio_base =
(unsigned long)ioremap(dm->mmio_base_phys, dm->mmio_size);
@@ -1676,6 +1694,10 @@ static int davincifb_probe(struct platform_device *pdev)
/* Turn ON the output device */
dm->output_device_config(1);
+ dm->ops->davincifb_power(&dm->osd0->info, 1);
+ dm->ops->davincifb_power(&dm->osd1->info, 1);
+ dm->ops->davincifb_power(&dm->vid0->info, 1);
+ dm->ops->davincifb_power(&dm->vid1->info, 1);
return (0);
@@ -439,6 +439,17 @@ struct zoom_params
};
#define FBIO_SETZOOM _IOW('F', 0x24, struct zoom_params)
+/*
+ * davincifb operations
+ *
+ * This functions are used in order to manage external hw that is platform
+ * dependent according to what is done on the framebuffer (turn LCD on/off,
+ * manage backlight, ...)
+ */
+
+struct davincifb_ops {
+ int (*davincifb_power)(struct fb_info *info, int on);
+};
struct davincifb_platform_data {
u32 xres;