From ca7a6ed57825c50fc3f0332e31a7d8feb4b91d8b Mon Sep 17 00:00:00 2001 From: Dandawate Saket Date: Sat, 27 Apr 2013 00:14:13 -0700 Subject: [PATCH] OMAPDSS: HDMI: Add setmode support for android Add support for set mode for android HWC adaptation Change-Id: If21f6444df6f8b48c237088825eeb24944300199 Signed-off-by: Dandawate Saket Conflicts: drivers/video/omap2/dss/dss.h --- drivers/video/omap2/dss/dss.h | 2 ++ drivers/video/omap2/dss/hdmi.c | 19 +++++++++++++++++++ drivers/video/omap2/dss/hdmi_panel.c | 1 + drivers/video/omap2/dss/ti_hdmi.h | 1 + 4 files changed, 23 insertions(+) mode change 100644 => 100755 drivers/video/omap2/dss/dss.h mode change 100644 => 100755 drivers/video/omap2/dss/hdmi_panel.c diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h old mode 100644 new mode 100755 index c5f1f195492..3c3df510eae --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h @@ -500,6 +500,8 @@ int omapdss_hdmi_display_3d_enable(struct omap_dss_device *dssdev, struct s3d_disp_info *info, int code); void sel_i2c(void); void sel_hdmi(void); +int omapdss_hdmi_display_set_mode(struct omap_dss_device *dssdev, + struct fb_videomode *mode); int hdmi_panel_init(void); void hdmi_panel_exit(void); #if defined(CONFIG_OMAP4_DSS_HDMI_AUDIO) || \ diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index a789eca08a1..e430175689a 100755 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -61,6 +61,9 @@ static struct { defined(CONFIG_OMAP5_DSS_HDMI_AUDIO) struct platform_device *audio_pdev; #endif + int code; + int mode; + bool custom_set; struct hdmi_ip_data ip_data; int hdmi_irq; @@ -936,6 +939,22 @@ int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev, } +int omapdss_hdmi_display_set_mode(struct omap_dss_device *dssdev, + struct fb_videomode *vm) +{ + int r1, r2; + /* turn the hdmi off and on to get new timings to use */ + hdmi.ip_data.set_mode = true; + dssdev->driver->disable(dssdev); + hdmi.ip_data.set_mode = false; + r1 = hdmi_set_timings(vm, false) ? 0 : -EINVAL; + hdmi.custom_set = true; + hdmi.code = hdmi.ip_data.cfg.cm.code; + hdmi.mode = hdmi.ip_data.cfg.cm.mode; + r2 = dssdev->driver->enable(dssdev); + return r1 ? : r2; +} + int omapdss_hdmi_display_3d_enable(struct omap_dss_device *dssdev, struct s3d_disp_info *info, int code) { diff --git a/drivers/video/omap2/dss/hdmi_panel.c b/drivers/video/omap2/dss/hdmi_panel.c old mode 100644 new mode 100755 index 95090f27daa..236bb61c13e --- a/drivers/video/omap2/dss/hdmi_panel.c +++ b/drivers/video/omap2/dss/hdmi_panel.c @@ -505,6 +505,7 @@ static struct omap_dss_driver hdmi_driver = { .set_timings = hdmi_set_timings, .check_timings = hdmi_check_timings, .read_edid = hdmi_read_edid, + .set_mode = omapdss_hdmi_display_set_mode, .detect = hdmi_detect, .audio_enable = hdmi_panel_audio_enable, .audio_disable = hdmi_panel_audio_disable, diff --git a/drivers/video/omap2/dss/ti_hdmi.h b/drivers/video/omap2/dss/ti_hdmi.h index ee28928f084..4051e016b70 100755 --- a/drivers/video/omap2/dss/ti_hdmi.h +++ b/drivers/video/omap2/dss/ti_hdmi.h @@ -246,6 +246,7 @@ struct hdmi_ip_data { /* ti_hdmi_4xxx_ip private data. These should be in a separate struct */ int hpd_gpio; struct mutex lock; + bool set_mode; }; int ti_hdmi_4xxx_phy_enable(struct hdmi_ip_data *ip_data); void ti_hdmi_4xxx_phy_disable(struct hdmi_ip_data *ip_data); -- 2.39.2