diff options
author | Dandawate Saket <dsaket@ti.com> | 2012-04-09 19:00:18 +0530 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-10-01 13:01:14 +0200 |
commit | 0ff9ac1df0353ff2619501088e2474256573338d (patch) | |
tree | 24ca94b2efd2c32b618efebbbad209572dfdea26 | |
parent | 3d1d4464b0f3a3b5bfea136d4078ca9cd0248a1b (diff) | |
download | kernel_samsung_tuna-0ff9ac1df0353ff2619501088e2474256573338d.zip kernel_samsung_tuna-0ff9ac1df0353ff2619501088e2474256573338d.tar.gz kernel_samsung_tuna-0ff9ac1df0353ff2619501088e2474256573338d.tar.bz2 |
OMAP4: HDMI : Support default display configuration for HDMI
Added get_resolution and get_fb_resolution function to HDMI
driver so that we can configure defaults via board files when
HDMI is default panel.
Change-Id: I36cafb4b0bd42c150c1c1a03be4607edec31b4db
Co-Author-by: Victor Kleinik <x0150886@ti.com>
Co-Author-by: Artem Rudenko <artemrudenko@ti.com>
Signed-off-by: Dandawate Saket <dsaket@ti.com>
Signed-off-by: Muralidhar Dixit <murali.dixit@ti.com>
-rw-r--r-- | drivers/video/omap2/dss/core.c | 6 | ||||
-rw-r--r-- | drivers/video/omap2/dss/hdmi.c | 12 | ||||
-rw-r--r-- | drivers/video/omap2/dss/hdmi_panel.c | 12 | ||||
-rw-r--r-- | include/video/omapdss.h | 1 |
4 files changed, 24 insertions, 7 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 9695fbf..1e2d9e2a 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -254,6 +254,9 @@ static int omap_dss_probe(struct platform_device *pdev) for (i = 0; i < pdata->num_devices; ++i) { struct omap_dss_device *dssdev = pdata->devices[i]; + if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0) + pdata->default_device = dssdev; + r = omap_dss_register_device(dssdev); if (r) { DSSERR("device %d %s register failed %d\n", i, @@ -264,9 +267,6 @@ static int omap_dss_probe(struct platform_device *pdev) goto err_register; } - - if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0) - pdata->default_device = dssdev; } return 0; diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 35b70d4..1287958 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -391,8 +391,16 @@ static int hdmi_power_on(struct omap_dss_device *dssdev) dssdev->panel.timings.y_res); if (!hdmi.custom_set) { - struct fb_videomode vesa_vga = vesa_modes[4]; - hdmi_set_timings(&vesa_vga, false); + u32 cea_code = 0; + struct fb_videomode default_mode; + + cea_code = dssdev->panel.hdmi_default_cea_code; + if (cea_code > 0 && cea_code < CEA_MODEDB_SIZE) + default_mode = cea_modes[cea_code]; + else + default_mode = vesa_modes[4]; + + hdmi_set_timings(&default_mode, false); } omapfb_fb2dss_timings(&hdmi.cfg.timings, &dssdev->panel.timings); diff --git a/drivers/video/omap2/dss/hdmi_panel.c b/drivers/video/omap2/dss/hdmi_panel.c index bd234f4..5d608ad 100644 --- a/drivers/video/omap2/dss/hdmi_panel.c +++ b/drivers/video/omap2/dss/hdmi_panel.c @@ -71,8 +71,9 @@ static int hdmi_panel_probe(struct omap_dss_device *dssdev) * This is only for framebuffer update not for TV timing setting * Setting TV timing will be done only on enable */ - dssdev->panel.timings.x_res = 640; - dssdev->panel.timings.y_res = 480; + if (dssdev->panel.timings.x_res == 0) + dssdev->panel.timings = (struct omap_video_timings) + {640, 480, 31746, 128, 24, 29, 9, 40, 2}; /* sysfs entry to provide user space control to set deepcolor mode */ if (device_create_file(&dssdev->dev, &dev_attr_deepcolor)) @@ -296,6 +297,12 @@ static int hdmi_get_modedb(struct omap_dss_device *dssdev, memcpy(modedb, specs->modedb, sizeof(*modedb) * modedb_len); return modedb_len; } +static void hdmi_get_resolution(struct omap_dss_device *dssdev, + u16 *xres, u16 *yres) +{ + *xres = dssdev->panel.timings.x_res; + *yres = dssdev->panel.timings.y_res; +} static struct omap_dss_driver hdmi_driver = { .probe = hdmi_panel_probe, @@ -307,6 +314,7 @@ static struct omap_dss_driver hdmi_driver = { .get_timings = hdmi_get_timings, .set_timings = hdmi_set_timings, .check_timings = hdmi_check_timings, + .get_resolution = hdmi_get_resolution, .get_modedb = hdmi_get_modedb, .set_mode = omapdss_hdmi_display_set_mode, .driver = { diff --git a/include/video/omapdss.h b/include/video/omapdss.h index fc1e7cb..11e88ac 100644 --- a/include/video/omapdss.h +++ b/include/video/omapdss.h @@ -624,6 +624,7 @@ struct omap_dss_device { u32 height_in_um; u16 fb_xres; u16 fb_yres; + u32 hdmi_default_cea_code; } panel; struct { |