rk2928 lcdc:switch all lcdc io to gpio mode when hdmi plug in
authoryxj <yxj@rock-chips.com>
Mon, 12 Nov 2012 01:34:49 +0000 (09:34 +0800)
committeryxj <yxj@rock-chips.com>
Mon, 12 Nov 2012 07:50:21 +0000 (15:50 +0800)
drivers/video/rockchip/lcdc/rk2928_lcdc.c
drivers/video/rockchip/rk_fb.c
include/linux/rk_fb.h

index fe8cc8d9c1ba49f56f33ce78dec8f1c6c95e0129..55434bc83c5fb5a0b82fcacf61ecf5a187d052b1 100644 (file)
@@ -1006,6 +1006,16 @@ static int rk2928_fb_get_layer(struct rk_lcdc_device_driver *dev_drv,const char
         return  layer_id;
 }
 
+static int rk2928_lcdc_hdmi_process(struct rk_lcdc_device_driver *dev_drv,int mode)
+{
+       if(mode)
+               rk2928_lcdc_iomux(dev_drv->screen0,0); //switch to gpio mode,to avoid  current leakage
+       else
+               rk2928_lcdc_iomux(dev_drv->screen0,1); //switch to gpio mode,to avoid  current leakage
+       
+       return 0;
+       
+}
 int rk2928_lcdc_early_suspend(struct rk_lcdc_device_driver *dev_drv)
 {
        struct rk2928_lcdc_device *lcdc_dev = container_of(dev_drv,struct rk2928_lcdc_device,driver);
@@ -1042,6 +1052,7 @@ int rk2928_lcdc_early_suspend(struct rk_lcdc_device_driver *dev_drv)
 }
 
 
+
 int rk2928_lcdc_early_resume(struct rk_lcdc_device_driver *dev_drv)
 {  
        struct rk2928_lcdc_device *lcdc_dev = container_of(dev_drv,struct rk2928_lcdc_device,driver);
@@ -1123,6 +1134,7 @@ static struct rk_lcdc_device_driver lcdc_driver = {
        .fps_mgr                = rk2928_lcdc_fps_mgr,
        .fb_get_layer           = rk2928_fb_get_layer,
        .fb_layer_remap         = rk2928_fb_layer_remap,
+       .lcdc_hdmi_process      = rk2928_lcdc_hdmi_process,
 };
 #ifdef CONFIG_PM
 static int rk2928_lcdc_suspend(struct platform_device *pdev, pm_message_t state)
@@ -1298,7 +1310,7 @@ static int __init rk2928_lcdc_init(void)
 
 static void __exit rk2928_lcdc_exit(void)
 {
-    platform_driver_unregister(&rk2928lcdc_driver);
+       platform_driver_unregister(&rk2928lcdc_driver);
 }
 
 
index cf44ce11fc640fe935d4f18f360f8fa8dd5e25d3..586f1618932bd3e5ff5f0475b906afe4846c2570 100644 (file)
@@ -748,6 +748,9 @@ int rk_fb_switch_screen(rk_screen *screen ,int enable ,int lcdc_id)
        ret = info->fbops->fb_open(info,1);
        ret = dev_drv->load_screen(dev_drv,1);
        ret = info->fbops->fb_set_par(info);
+       if(dev_drv->lcdc_hdmi_process)
+               dev_drv->lcdc_hdmi_process(dev_drv,enable);
+
        #if defined(CONFIG_DUAL_LCDC_DUAL_DISP_IN_KERNEL)
                if(likely(inf->num_lcdc == 2))
                {
@@ -964,6 +967,8 @@ static int init_lcdc_device_driver(struct rk_lcdc_device_driver *dev_drv,
                dev_drv->set_dsp_lut    = def_drv->set_dsp_lut;
        if(def_drv->read_dsp_lut)
                dev_drv->read_dsp_lut   = def_drv->read_dsp_lut;
+       if(def_drv->lcdc_hdmi_process)
+               dev_drv->lcdc_hdmi_process = def_drv->lcdc_hdmi_process;
        init_layer_par(dev_drv);
        init_completion(&dev_drv->frame_done);
        spin_lock_init(&dev_drv->cpl_lock);
index 1ab21b6f1d115debe4b751a28a6911a344942e4c..feb79735ff00f6ba57d932cf59ea4c5caf78a32a 100644 (file)
@@ -236,6 +236,7 @@ struct rk_lcdc_device_driver{
        int (*fb_layer_remap)(struct rk_lcdc_device_driver *dev_drv,enum fb_win_map_order order);
        int (*set_dsp_lut)(struct rk_lcdc_device_driver *dev_drv,int *lut);
        int (*read_dsp_lut)(struct rk_lcdc_device_driver *dev_drv,int *lut);
+       int (*lcdc_hdmi_process)(struct rk_lcdc_device_driver *dev_drv,int mode); //some lcdc need to some process in hdmi mode
        
 };