diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-02 14:55:12 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-11 15:09:24 +0300 |
commit | 38f3daf678d909e8ee5638f21a34f35c01343420 (patch) | |
tree | 0e0ea8fa43e038980632906186f1e9d0021f82a7 /drivers/video/omap2/dss/dsi.c | |
parent | 11ee9606407031827d43ecde8e62a418ac3b4f83 (diff) | |
download | blackbird-obmc-linux-38f3daf678d909e8ee5638f21a34f35c01343420.tar.gz blackbird-obmc-linux-38f3daf678d909e8ee5638f21a34f35c01343420.zip |
OMAPDSS: separate pdata based initialization
Move the platform-data based display device initialization into a
separate function, so that we may later add of-based initialization.
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.c | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c index b882a77911e6..e2aaf5a167fa 100644 --- a/drivers/video/omap2/dss/dsi.c +++ b/drivers/video/omap2/dss/dsi.c @@ -4602,6 +4602,34 @@ static void dsi_put_clocks(struct platform_device *dsidev) clk_put(dsi->sys_clk); } +static void __init dsi_probe_pdata(struct platform_device *dsidev) +{ + struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev); + struct omap_dss_board_info *pdata = dsidev->dev.platform_data; + int i, r; + + for (i = 0; i < pdata->num_devices; ++i) { + struct omap_dss_device *dssdev = pdata->devices[i]; + + if (dssdev->type != OMAP_DISPLAY_TYPE_DSI) + continue; + + if (dssdev->phy.dsi.module != dsi->module_id) + continue; + + r = dsi_init_display(dssdev); + if (r) { + DSSERR("device %s init failed: %d\n", dssdev->name, r); + continue; + } + + r = omap_dss_register_device(dssdev, &dsidev->dev, i); + if (r) + DSSERR("device %s register failed: %d\n", + dssdev->name, r); + } +} + /* DSI1 HW IP initialisation */ static int __init omap_dsihw_probe(struct platform_device *dsidev) { @@ -4609,7 +4637,6 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev) int r, i; struct resource *dsi_mem; struct dsi_data *dsi; - struct omap_dss_board_info *pdata = dsidev->dev.platform_data; dsi = devm_kzalloc(&dsidev->dev, sizeof(*dsi), GFP_KERNEL); if (!dsi) @@ -4697,26 +4724,7 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev) else dsi->num_lanes_supported = 3; - for (i = 0; i < pdata->num_devices; ++i) { - struct omap_dss_device *dssdev = pdata->devices[i]; - - if (dssdev->type != OMAP_DISPLAY_TYPE_DSI) - continue; - - if (dssdev->phy.dsi.module != dsi->module_id) - continue; - - r = dsi_init_display(dssdev); - if (r) { - DSSERR("device %s init failed: %d\n", dssdev->name, r); - continue; - } - - r = omap_dss_register_device(dssdev, &dsidev->dev, i); - if (r) - DSSERR("device %s register failed: %d\n", - dssdev->name, r); - } + dsi_probe_pdata(dsidev); dsi_runtime_put(dsidev); |