aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/hdmi.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/hdmi.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/hdmi.c')
-rw-r--r--drivers/video/omap2/dss/hdmi.c57
1 files changed, 43 insertions, 14 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index bb07143a2d79..76d100b975e0 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -901,32 +901,61 @@ int hdmi_audio_config(struct omap_dss_audio *audio)
901 901
902#endif 902#endif
903 903
904static void __init hdmi_probe_pdata(struct platform_device *pdev) 904static struct omap_dss_device * __init hdmi_find_dssdev(struct platform_device *pdev)
905{ 905{
906 struct omap_dss_board_info *pdata = pdev->dev.platform_data; 906 struct omap_dss_board_info *pdata = pdev->dev.platform_data;
907 int r, i; 907 const char *def_disp_name = dss_get_default_display_name();
908 struct omap_dss_device *def_dssdev;
909 int i;
910
911 def_dssdev = NULL;
908 912
909 for (i = 0; i < pdata->num_devices; ++i) { 913 for (i = 0; i < pdata->num_devices; ++i) {
910 struct omap_dss_device *dssdev = pdata->devices[i]; 914 struct omap_dss_device *dssdev = pdata->devices[i];
911 struct omap_dss_hdmi_data *priv = dssdev->data;
912 915
913 if (dssdev->type != OMAP_DISPLAY_TYPE_HDMI) 916 if (dssdev->type != OMAP_DISPLAY_TYPE_HDMI)
914 continue; 917 continue;
915 918
916 hdmi.ct_cp_hpd_gpio = priv->ct_cp_hpd_gpio; 919 if (def_dssdev == NULL)
917 hdmi.ls_oe_gpio = priv->ls_oe_gpio; 920 def_dssdev = dssdev;
918 hdmi.hpd_gpio = priv->hpd_gpio;
919 921
920 r = hdmi_init_display(dssdev); 922 if (def_disp_name != NULL &&
921 if (r) { 923 strcmp(dssdev->name, def_disp_name) == 0) {
922 DSSERR("device %s init failed: %d\n", dssdev->name, r); 924 def_dssdev = dssdev;
923 continue; 925 break;
924 } 926 }
927 }
928
929 return def_dssdev;
930}
931
932static void __init hdmi_probe_pdata(struct platform_device *pdev)
933{
934 struct omap_dss_device *dssdev;
935 struct omap_dss_hdmi_data *priv;
936 int r;
925 937
926 r = omap_dss_register_device(dssdev, &pdev->dev); 938 dssdev = hdmi_find_dssdev(pdev);
927 if (r) 939
928 DSSERR("device %s register failed: %d\n", 940 if (!dssdev)
929 dssdev->name, r); 941 return;
942
943 priv = dssdev->data;
944
945 hdmi.ct_cp_hpd_gpio = priv->ct_cp_hpd_gpio;
946 hdmi.ls_oe_gpio = priv->ls_oe_gpio;
947 hdmi.hpd_gpio = priv->hpd_gpio;
948
949 r = hdmi_init_display(dssdev);
950 if (r) {
951 DSSERR("device %s init failed: %d\n", dssdev->name, r);
952 return;
953 }
954
955 r = omap_dss_register_device(dssdev, &pdev->dev);
956 if (r) {
957 DSSERR("device %s register failed: %d\n", dssdev->name, r);
958 return;
930 } 959 }
931} 960}
932 961