summaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss/rfbi.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-05-02 13:55:12 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-05-11 14:09:24 +0200
commit38f3daf678d909e8ee5638f21a34f35c01343420 (patch)
tree0e0ea8fa43e038980632906186f1e9d0021f82a7 /drivers/video/omap2/dss/rfbi.c
parentOMAPDSS: DSI: improve DSI module id handling (diff)
downloadlinux-38f3daf678d909e8ee5638f21a34f35c01343420.tar.xz
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/rfbi.c')
-rw-r--r--drivers/video/omap2/dss/rfbi.c45
1 files changed, 26 insertions, 19 deletions
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index f081f01b0b7d..3d8c206e90e5 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -927,14 +927,37 @@ static int __init rfbi_init_display(struct omap_dss_device *dssdev)
return 0;
}
+static void __init rfbi_probe_pdata(struct platform_device *pdev)
+{
+ struct omap_dss_board_info *pdata = pdev->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_DBI)
+ continue;
+
+ r = rfbi_init_display(dssdev);
+ if (r) {
+ DSSERR("device %s init failed: %d\n", dssdev->name, r);
+ continue;
+ }
+
+ r = omap_dss_register_device(dssdev, &pdev->dev, i);
+ if (r)
+ DSSERR("device %s register failed: %d\n",
+ dssdev->name, r);
+ }
+}
+
/* 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, i;
+ int r;
rfbi.pdev = pdev;
@@ -979,23 +1002,7 @@ 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 = rfbi_init_display(dssdev);
- if (r) {
- DSSERR("device %s init failed: %d\n", dssdev->name, r);
- continue;
- }
-
- r = omap_dss_register_device(dssdev, &pdev->dev, i);
- if (r)
- DSSERR("device %s register failed: %d\n",
- dssdev->name, r);
- }
+ rfbi_probe_pdata(pdev);
return 0;