diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-02 07:55:12 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-05-11 08:09:24 -0400 |
commit | 38f3daf678d909e8ee5638f21a34f35c01343420 (patch) | |
tree | 0e0ea8fa43e038980632906186f1e9d0021f82a7 /drivers/video/omap2/dss/rfbi.c | |
parent | 11ee9606407031827d43ecde8e62a418ac3b4f83 (diff) |
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.c | 45 |
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) | |||
927 | return 0; | 927 | return 0; |
928 | } | 928 | } |
929 | 929 | ||
930 | static void __init rfbi_probe_pdata(struct platform_device *pdev) | ||
931 | { | ||
932 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | ||
933 | int i, r; | ||
934 | |||
935 | for (i = 0; i < pdata->num_devices; ++i) { | ||
936 | struct omap_dss_device *dssdev = pdata->devices[i]; | ||
937 | |||
938 | if (dssdev->type != OMAP_DISPLAY_TYPE_DBI) | ||
939 | continue; | ||
940 | |||
941 | r = rfbi_init_display(dssdev); | ||
942 | if (r) { | ||
943 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | ||
944 | continue; | ||
945 | } | ||
946 | |||
947 | r = omap_dss_register_device(dssdev, &pdev->dev, i); | ||
948 | if (r) | ||
949 | DSSERR("device %s register failed: %d\n", | ||
950 | dssdev->name, r); | ||
951 | } | ||
952 | } | ||
953 | |||
930 | /* RFBI HW IP initialisation */ | 954 | /* RFBI HW IP initialisation */ |
931 | static int __init omap_rfbihw_probe(struct platform_device *pdev) | 955 | static int __init omap_rfbihw_probe(struct platform_device *pdev) |
932 | { | 956 | { |
933 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | ||
934 | u32 rev; | 957 | u32 rev; |
935 | struct resource *rfbi_mem; | 958 | struct resource *rfbi_mem; |
936 | struct clk *clk; | 959 | struct clk *clk; |
937 | int r, i; | 960 | int r; |
938 | 961 | ||
939 | rfbi.pdev = pdev; | 962 | rfbi.pdev = pdev; |
940 | 963 | ||
@@ -979,23 +1002,7 @@ static int __init omap_rfbihw_probe(struct platform_device *pdev) | |||
979 | 1002 | ||
980 | dss_debugfs_create_file("rfbi", rfbi_dump_regs); | 1003 | dss_debugfs_create_file("rfbi", rfbi_dump_regs); |
981 | 1004 | ||
982 | for (i = 0; i < pdata->num_devices; ++i) { | 1005 | rfbi_probe_pdata(pdev); |
983 | struct omap_dss_device *dssdev = pdata->devices[i]; | ||
984 | |||
985 | if (dssdev->type != OMAP_DISPLAY_TYPE_DBI) | ||
986 | continue; | ||
987 | |||
988 | r = rfbi_init_display(dssdev); | ||
989 | if (r) { | ||
990 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | ||
991 | continue; | ||
992 | } | ||
993 | |||
994 | r = omap_dss_register_device(dssdev, &pdev->dev, i); | ||
995 | if (r) | ||
996 | DSSERR("device %s register failed: %d\n", | ||
997 | dssdev->name, r); | ||
998 | } | ||
999 | 1006 | ||
1000 | return 0; | 1007 | return 0; |
1001 | 1008 | ||