From 4afa48a5b7005d1df44a0b2aaaaa6961249c2d74 Mon Sep 17 00:00:00 2001 From: Zheng Yang Date: Tue, 17 Apr 2012 11:48:24 +0800 Subject: [PATCH] rk30 hdmi: 1. add function hdmi_get_hotplug(void) to poll hdmi hotplug status for other modules. 2. add macro HDMI_AUTO_CONFIGURE in rk30_hdmi.h to enable/disable auto confiure output mode according EDID. --- drivers/video/rockchip/hdmi/rk30_hdmi.h | 7 +++++++ drivers/video/rockchip/hdmi/rk30_hdmi_lcdc.c | 11 +++++++++++ drivers/video/rockchip/hdmi/rk30_hdmi_task.c | 2 +- drivers/video/rockchip/hdmi/rk_hdmi.h | 2 ++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/video/rockchip/hdmi/rk30_hdmi.h b/drivers/video/rockchip/hdmi/rk30_hdmi.h index 66ee37685945..6852d936ab07 100755 --- a/drivers/video/rockchip/hdmi/rk30_hdmi.h +++ b/drivers/video/rockchip/hdmi/rk30_hdmi.h @@ -21,10 +21,17 @@ enum { HDMI_SOURCE_LCDC1 = 1 }; +/* default HDMI video source */ #define HDMI_SOURCE_DEFAULT HDMI_SOURCE_LCDC1 +/* If HDMI_ENABLE, system will auto configure output mode according to EDID + * If HDMI_DISABLE, system will output mode according to macro HDMI_VIDEO_DEFAULT_MODE + */ +#define HDMI_AUTO_CONFIGURE HDMI_ENABLE + /* default HDMI output video mode */ #define HDMI_VIDEO_DEFAULT_MODE HDMI_1280x720p_60Hz//HDMI_1920x1080p_60Hz +/* default HDMI output audio mode */ #define HDMI_AUDIO_DEFAULT_CHANNEL 2 #define HDMI_AUDIO_DEFAULT_RATE HDMI_AUDIO_FS_44100 #define HDMI_AUDIO_DEFAULT_WORD_LENGTH HDMI_AUDIO_WORD_LENGTH_16bit diff --git a/drivers/video/rockchip/hdmi/rk30_hdmi_lcdc.c b/drivers/video/rockchip/hdmi/rk30_hdmi_lcdc.c index 391ee1e39945..ac97b46d5494 100755 --- a/drivers/video/rockchip/hdmi/rk30_hdmi_lcdc.c +++ b/drivers/video/rockchip/hdmi/rk30_hdmi_lcdc.c @@ -513,3 +513,14 @@ int hdmi_switch_fb(struct hdmi *hdmi, int vic) } return rc; } + +/** + * hdmi_get_status: get hdmi hotplug status + * + * NOTES: + * + */ +int hdmi_get_hotplug(void) +{ + return hdmi->hotplug; +} \ No newline at end of file diff --git a/drivers/video/rockchip/hdmi/rk30_hdmi_task.c b/drivers/video/rockchip/hdmi/rk30_hdmi_task.c index 383935f63755..51439e0dba77 100755 --- a/drivers/video/rockchip/hdmi/rk30_hdmi_task.c +++ b/drivers/video/rockchip/hdmi/rk30_hdmi_task.c @@ -48,7 +48,7 @@ int hdmi_sys_init(void) hdmi->hotplug = HDMI_HPD_REMOVED; hdmi->state = HDMI_SLEEP; hdmi->enable = HDMI_ENABLE; - hdmi->autoconfig = HDMI_ENABLE; + hdmi->autoconfig = HDMI_AUTO_CONFIGURE; hdmi->vic = HDMI_VIDEO_DEFAULT_MODE; hdmi->audio.channel = HDMI_AUDIO_DEFAULT_CHANNEL; diff --git a/drivers/video/rockchip/hdmi/rk_hdmi.h b/drivers/video/rockchip/hdmi/rk_hdmi.h index c40a180fa2ed..4989ef496bbf 100755 --- a/drivers/video/rockchip/hdmi/rk_hdmi.h +++ b/drivers/video/rockchip/hdmi/rk_hdmi.h @@ -195,4 +195,6 @@ extern const struct fb_videomode hdmi_mode[]; #define hdmi_dbg(dev, format, arg...) #endif +extern int hdmi_get_hotplug(void); + #endif -- 2.34.1