diff options
author | Jassi Brar <jaswinder.singh@linaro.org> | 2012-06-21 00:47:27 +0530 |
---|---|---|
committer | Andy Green <andy.green@linaro.org> | 2012-06-21 07:31:27 +0800 |
commit | 0f7b5ad6cbe2de903b962e809d5c87594a3061d4 (patch) | |
tree | a1016de378f30a8fa0d05825671be65d30f74718 | |
parent | 134de6360de9c14f2ac513fdb5058e8ea355ad94 (diff) |
OMAPDSS: HDMI: Cache EDID
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r-- | drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c index c09a2dfc361..a777b55489a 100644 --- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c +++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c @@ -239,6 +239,9 @@ void ti_hdmi_4xxx_pll_disable(struct hdmi_ip_data *ip_data) hdmi_set_pll_pwr(ip_data, HDMI_PLLPWRCMD_ALLOFF); } +static u8 edid_cached[512]; +static int edid_len; + static int hdmi_check_hpd_state(struct hdmi_ip_data *ip_data) { unsigned long flags; @@ -251,10 +254,13 @@ static int hdmi_check_hpd_state(struct hdmi_ip_data *ip_data) hpd = gpio_get_value(ip_data->hpd_gpio); - if (hpd) + if (hpd) { r = hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_TXON); - else + } else { + /* Clear EDID Cache */ + edid_len = 0; r = hdmi_set_phy_pwr(ip_data, HDMI_PHYPWRCMD_LDOON); + } /* * HDMI_WP_PWR_CTRL doesn't seem to reflect the change in power * states, ignore the error for now @@ -500,6 +506,11 @@ int ti_hdmi_4xxx_read_edid(struct hdmi_ip_data *ip_data, if (len < 128) return -EINVAL; + if (edid_len) { + memcpy(edid, edid_cached, edid_len); + return edid_len; + } + r = hdmi_core_ddc_init(ip_data); if (r) return r; @@ -517,12 +528,21 @@ int ti_hdmi_4xxx_read_edid(struct hdmi_ip_data *ip_data, l += 128; } + edid_len = l; + memcpy(edid_cached, edid, edid_len); + return l; } bool ti_hdmi_4xxx_detect(struct hdmi_ip_data *ip_data) { - return gpio_get_value(ip_data->hpd_gpio); + if (gpio_get_value(ip_data->hpd_gpio)) + return true; + + /* Clear EDID Cache */ + edid_len = 0; + + return false; } static void hdmi_core_init(struct hdmi_core_video_config *video_cfg, |