diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-03-01 15:45:53 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-11 14:52:23 +0300 |
commit | 35deca3de6190b6bc03e34ed45de079047f834ab (patch) | |
tree | 6e778144d508dc5550cb105b39d06a522459069a /drivers/video/omap2/dss/rfbi.c | |
parent | c018c6738bdae8c9f49766fd3d8b3770be2572f9 (diff) | |
download | op-kernel-dev-35deca3de6190b6bc03e34ed45de079047f834ab.zip op-kernel-dev-35deca3de6190b6bc03e34ed45de079047f834ab.tar.gz |
OMAPDSS: interface drivers register their panel devices
Currently the higher level omapdss platform driver gets the list of
displays in its platform data, and uses that list to create the
omap_dss_device for each display.
With DT, the logical way to do the above is to list the displays under
each individual output, i.e. we'd have "dpi" node, under which we would
have the display that uses DPI. In other words, each output driver
handles the displays that use that particular output.
To make the current code ready for DT, this patch modifies the output
drivers so that each of them creates the display devices which use that
output. However, instead of changing the platform data to suit this
method, each output driver is passed the full list of displays, and the
drivers pick the displays that are meant for them. This allows us to
keep the old platform data, and thus we avoid the need to change the
board files.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/rfbi.c')
-rw-r--r-- | drivers/video/omap2/dss/rfbi.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index 58da146..4c0a6c9 100644 --- a/drivers/video/omap2/dss/rfbi.c +++ b/drivers/video/omap2/dss/rfbi.c @@ -930,10 +930,11 @@ int rfbi_init_display(struct omap_dss_device *dssdev) /* RFBI HW IP initialisation */ static int __init omap_rfbihw_probe(struct platform_device *pdev) { + struct omap_dss_board_info *pdata = pdev->dev.platform_data; u32 rev; struct resource *rfbi_mem; struct clk *clk; - int r; + int r, i; rfbi.pdev = pdev; @@ -978,6 +979,18 @@ static int __init omap_rfbihw_probe(struct platform_device *pdev) dss_debugfs_create_file("rfbi", rfbi_dump_regs); + for (i = 0; i < pdata->num_devices; ++i) { + struct omap_dss_device *dssdev = pdata->devices[i]; + + if (dssdev->type != OMAP_DISPLAY_TYPE_DBI) + continue; + + r = omap_dss_register_device(dssdev, &pdev->dev, i); + if (r) + DSSERR("device %s register failed: %d\n", + dssdev->name, r); + } + return 0; err_runtime_get: @@ -987,6 +1000,7 @@ err_runtime_get: static int __exit omap_rfbihw_remove(struct platform_device *pdev) { + omap_dss_unregister_child_devices(&pdev->dev); pm_runtime_disable(&pdev->dev); return 0; } |