hdmi & fb:
authorZheng Yang <zhengyang@rock-chips.com>
Fri, 7 Nov 2014 10:01:48 +0000 (18:01 +0800)
committerZheng Yang <zhengyang@rock-chips.com>
Fri, 7 Nov 2014 10:01:48 +0000 (18:01 +0800)
        For box, we need to set hdmi switch state when insert/remove,
        regardless of whether the device supports audio. So add function
        rk_fb_get_display_policy() to get display policy.

drivers/video/rockchip/hdmi/rk_hdmi_task.c
drivers/video/rockchip/rk_fb.c
include/linux/rk_fb.h

index b7d96ffd3373b94f80e196a67348802999b09275..eb3c7db97adfaa8b5beab92534570653b7f35785 100755 (executable)
@@ -97,7 +97,8 @@ void hdmi_sys_remove(struct hdmi *hdmi)
        kobject_uevent_env(&hdmi->ddev->dev->kobj, KOBJ_REMOVE, envp);
 
 #ifdef CONFIG_SWITCH
-       if (audio_need)
+       if (audio_need ||
+           rk_fb_get_display_policy() == DISPLAY_POLICY_BOX)
                switch_set_state(&(hdmi->switch_hdmi), 0);
 #endif
        rockchip_clear_system_status(SYS_STATUS_HDMI);
@@ -249,8 +250,10 @@ void hdmi_work(struct work_struct *work)
                                         hdmi->edid.base_audio_support,
                                         hdmi->edid.sink_hdmi);
 #ifdef CONFIG_SWITCH
-                               if (hdmi->edid.base_audio_support == 1 &&
-                                   hdmi->edid.sink_hdmi == 1)
+                               if ((hdmi->edid.base_audio_support == 1 &&
+                                    hdmi->edid.sink_hdmi == 1) ||
+                                    (rk_fb_get_display_policy() ==
+                                     DISPLAY_POLICY_BOX))
                                        switch_set_state(&(hdmi->switch_hdmi),
                                                         1);
 #endif
index 6cdd2cee107d5d6be8987aca0370da6f723197dd..b8ec0f5ae07086228d18ebf27aa019d0522a984a 100755 (executable)
@@ -77,6 +77,18 @@ int support_uboot_display(void)
        return uboot_logo_on;
 }
 
+int rk_fb_get_display_policy(void)
+{
+       struct rk_fb *rk_fb;
+
+       if (fb_pdev) {
+               rk_fb = platform_get_drvdata(fb_pdev);
+               return rk_fb->disp_policy;
+       } else {
+               return DISPLAY_POLICY_SDK;
+       }
+}
+
 int rk_fb_trsm_ops_register(struct rk_fb_trsm_ops *ops, int type)
 {
        switch (type) {
index e34158bcf540c377e2c2cf1468b43136560cffb9..1c4ec6d791e665578b2412a5b96a492222a213e6 100755 (executable)
@@ -666,4 +666,5 @@ extern int rk_get_real_fps(int time);
 extern struct device *rk_fb_get_sysmmu_device_by_compatible(const char *compt);
 extern void rk_fb_platform_set_sysmmu(struct device *sysmmu,
                                       struct device *dev);
+int rk_fb_get_display_policy(void);
 #endif