aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/dsi.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-06 07:29:31 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-18 09:15:02 -0400
commit1521653c72596aaf1899c8d79a3f541f79ff238b (patch)
treeac36b818043b270996d952fae1ca515026e52b6a /drivers/video/omap2/dss/dsi.c
parent6a03fca96e4d4d010be52e11fc7b8ab89da9d2cf (diff)
OMAPDSS: register only one display device per output
We have boards with multiple panel devices connected to the same physical output, of which only one panel can be enabled at one time. Examples of these are Overo, where you can use different daughter boards that have different LCDs, and 3430SDP which has an LCD and a DVI output and a physical switch to select the active display. These are supported by omapdss so that we add all the possible display devices at probe, but the displays are inactive until somebody enables one. At this point the panel driver starts using the DSS, thus reserving the physcal resource and excluding the other panels. This is problematic: - Panel drivers can't allocate their resources properly at probe(), because the resources can be shared with other panels. Thus they can be only reserved at enable time. - Managing this in omapdss is confusing. It's not natural to have child devices, which may not even exist (for example, a daughterboard that is not connected). Only some boards have multiple displays per output, and of those, only very few have possibility of switching the display during runtime. Because of the above points: - We don't want to make omapdss and all the panel drivers more complex just because some boards have complex setups. - Only few boards support runtime switching, and afaik even then it's not required. So we don't need to support runtime switching. Thus we'll change to a model where we will have only one display device per output and this cannot be (currently) changed at runtime. We'll still have the possibility to select the display from multiple options during boot with the default display option. This patch accomplishes the above by changing how the output drivers register the display device. Instead of registering all the devices given from the board file, we'll only register one. If the default display option is set, the output driver selects that display from its displays. If the default display is not set, or the default display is not one of the output's displays, the output driver selects the first display. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dsi.c')
-rw-r--r--drivers/video/omap2/dss/dsi.c51
1 files changed, 39 insertions, 12 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index f7078fc90459..ee9ae526f5c1 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -5006,11 +5006,15 @@ static void dsi_put_clocks(struct platform_device *dsidev)
5006 clk_put(dsi->sys_clk); 5006 clk_put(dsi->sys_clk);
5007} 5007}
5008 5008
5009static void __init dsi_probe_pdata(struct platform_device *dsidev) 5009static struct omap_dss_device * __init dsi_find_dssdev(struct platform_device *pdev)
5010{ 5010{
5011 struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); 5011 struct omap_dss_board_info *pdata = pdev->dev.platform_data;
5012 struct omap_dss_board_info *pdata = dsidev->dev.platform_data; 5012 struct dsi_data *dsi = dsi_get_dsidrv_data(pdev);
5013 int i, r; 5013 const char *def_disp_name = dss_get_default_display_name();
5014 struct omap_dss_device *def_dssdev;
5015 int i;
5016
5017 def_dssdev = NULL;
5014 5018
5015 for (i = 0; i < pdata->num_devices; ++i) { 5019 for (i = 0; i < pdata->num_devices; ++i) {
5016 struct omap_dss_device *dssdev = pdata->devices[i]; 5020 struct omap_dss_device *dssdev = pdata->devices[i];
@@ -5021,16 +5025,39 @@ static void __init dsi_probe_pdata(struct platform_device *dsidev)
5021 if (dssdev->phy.dsi.module != dsi->module_id) 5025 if (dssdev->phy.dsi.module != dsi->module_id)
5022 continue; 5026 continue;
5023 5027
5024 r = dsi_init_display(dssdev); 5028 if (def_dssdev == NULL)
5025 if (r) { 5029 def_dssdev = dssdev;
5026 DSSERR("device %s init failed: %d\n", dssdev->name, r); 5030
5027 continue; 5031 if (def_disp_name != NULL &&
5032 strcmp(dssdev->name, def_disp_name) == 0) {
5033 def_dssdev = dssdev;
5034 break;
5028 } 5035 }
5036 }
5029 5037
5030 r = omap_dss_register_device(dssdev, &dsidev->dev); 5038 return def_dssdev;
5031 if (r) 5039}
5032 DSSERR("device %s register failed: %d\n", 5040
5033 dssdev->name, r); 5041static void __init dsi_probe_pdata(struct platform_device *dsidev)
5042{
5043 struct omap_dss_device *dssdev;
5044 int r;
5045
5046 dssdev = dsi_find_dssdev(dsidev);
5047
5048 if (!dssdev)
5049 return;
5050
5051 r = dsi_init_display(dssdev);
5052 if (r) {
5053 DSSERR("device %s init failed: %d\n", dssdev->name, r);
5054 return;
5055 }
5056
5057 r = omap_dss_register_device(dssdev, &dsidev->dev);
5058 if (r) {
5059 DSSERR("device %s register failed: %d\n", dssdev->name, r);
5060 return;
5034 } 5061 }
5035} 5062}
5036 5063