diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-09-25 11:23:14 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-09-25 11:23:14 +0300 |
commit | c0ca7c38c5d35c12a9b94ef42842b325dfd2a3cd (patch) | |
tree | 2190b0a91130b8b9c7f0e562ea5d28a885f3eb19 /drivers/video/omap2/dss/rfbi.c | |
parent | 524d9f48a64dbe1ec3a276b57ac2a422fc14af07 (diff) | |
parent | 5274484b821bb2cf34a697624ef14084c31b16ce (diff) | |
download | blackbird-op-linux-c0ca7c38c5d35c12a9b94ef42842b325dfd2a3cd.tar.gz blackbird-op-linux-c0ca7c38c5d35c12a9b94ef42842b325dfd2a3cd.zip |
Merge omapdss single-dssdev series
This series contains patches that change how omapdss's panel devices
(omap_dss_device) are initialized and registered. There are two patches that
change behaviour, the rest are just cleanups:
The patch "omap_dss_register_device() doesn't take display index" affects the
number for the "displayX" sysfs files. This hopefully doesn't affect the
userspace, as the number has never been a clear indication of what the
particular display is.
The patch "register only one display device per output" affects how panel
devices are created. Currently we support multiple panels per output, i.e. you
could have DVI and an LCD displays using the same DPI output, as long as the
DVI and LCD are not used at the same time.
This patch changes the omapdss driver to only register one display device per
output. If there are multiple displays for the output, either the first one is
picked or, if def_display has been defined in kernel parameters and the
def_display is one of the displays for this output, the def_display is picked.
See the patch for more information.
OMAPDSS: alloc dssdevs dynamically
OMAPDSS: cleanup dss_recheck_connections further
OMAPDSS: cleanup dss_recheck_connections
OMAPDSS: handle errors in dss_init_device
OMAPDSS: explicitely initialize dssdev->channel for new displays
OMAPDSS: register only one display device per output
OMAPDSS: Add dss_get_default_display_name()
OMAPDSS: omap_dss_register_device() doesn't take display index
Diffstat (limited to 'drivers/video/omap2/dss/rfbi.c')
-rw-r--r-- | drivers/video/omap2/dss/rfbi.c | 58 |
1 files changed, 47 insertions, 11 deletions
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index 2e520d3085c8..38d9b8ecbe3c 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c @@ -942,10 +942,14 @@ static int __init rfbi_init_display(struct omap_dss_device *dssdev) return 0; } -static void __init rfbi_probe_pdata(struct platform_device *pdev) +static struct omap_dss_device * __init rfbi_find_dssdev(struct platform_device *pdev) { struct omap_dss_board_info *pdata = pdev->dev.platform_data; - int i, r; + const char *def_disp_name = dss_get_default_display_name(); + struct omap_dss_device *def_dssdev; + int i; + + def_dssdev = NULL; for (i = 0; i < pdata->num_devices; ++i) { struct omap_dss_device *dssdev = pdata->devices[i]; @@ -953,16 +957,48 @@ static void __init rfbi_probe_pdata(struct platform_device *pdev) if (dssdev->type != OMAP_DISPLAY_TYPE_DBI) continue; - r = rfbi_init_display(dssdev); - if (r) { - DSSERR("device %s init failed: %d\n", dssdev->name, r); - continue; + if (def_dssdev == NULL) + def_dssdev = dssdev; + + if (def_disp_name != NULL && + strcmp(dssdev->name, def_disp_name) == 0) { + def_dssdev = dssdev; + break; } + } + + return def_dssdev; +} + +static void __init rfbi_probe_pdata(struct platform_device *rfbidev) +{ + struct omap_dss_device *plat_dssdev; + struct omap_dss_device *dssdev; + int r; + + plat_dssdev = rfbi_find_dssdev(rfbidev); - r = omap_dss_register_device(dssdev, &pdev->dev, i); - if (r) - DSSERR("device %s register failed: %d\n", - dssdev->name, r); + if (!plat_dssdev) + return; + + dssdev = dss_alloc_and_init_device(&rfbidev->dev); + if (!dssdev) + return; + + dss_copy_device_pdata(dssdev, plat_dssdev); + + r = rfbi_init_display(dssdev); + if (r) { + DSSERR("device %s init failed: %d\n", dssdev->name, r); + dss_put_device(dssdev); + return; + } + + r = dss_add_device(dssdev); + if (r) { + DSSERR("device %s register failed: %d\n", dssdev->name, r); + dss_put_device(dssdev); + return; } } @@ -1028,7 +1064,7 @@ err_runtime_get: static int __exit omap_rfbihw_remove(struct platform_device *pdev) { - omap_dss_unregister_child_devices(&pdev->dev); + dss_unregister_child_devices(&pdev->dev); pm_runtime_disable(&pdev->dev); return 0; } |