diff options
Diffstat (limited to 'drivers/video/omap2/dss/rfbi.c')
-rw-r--r-- | drivers/video/omap2/dss/rfbi.c | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c index 845b4e70a28e..1127037cb9d5 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) | |||
942 | return 0; | 942 | return 0; |
943 | } | 943 | } |
944 | 944 | ||
945 | static void __init rfbi_probe_pdata(struct platform_device *pdev) | 945 | static struct omap_dss_device * __init rfbi_find_dssdev(struct platform_device *pdev) |
946 | { | 946 | { |
947 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | 947 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; |
948 | int i, r; | 948 | const char *def_disp_name = dss_get_default_display_name(); |
949 | struct omap_dss_device *def_dssdev; | ||
950 | int i; | ||
951 | |||
952 | def_dssdev = NULL; | ||
949 | 953 | ||
950 | for (i = 0; i < pdata->num_devices; ++i) { | 954 | for (i = 0; i < pdata->num_devices; ++i) { |
951 | struct omap_dss_device *dssdev = pdata->devices[i]; | 955 | struct omap_dss_device *dssdev = pdata->devices[i]; |
@@ -953,16 +957,39 @@ static void __init rfbi_probe_pdata(struct platform_device *pdev) | |||
953 | if (dssdev->type != OMAP_DISPLAY_TYPE_DBI) | 957 | if (dssdev->type != OMAP_DISPLAY_TYPE_DBI) |
954 | continue; | 958 | continue; |
955 | 959 | ||
956 | r = rfbi_init_display(dssdev); | 960 | if (def_dssdev == NULL) |
957 | if (r) { | 961 | def_dssdev = dssdev; |
958 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | 962 | |
959 | continue; | 963 | if (def_disp_name != NULL && |
964 | strcmp(dssdev->name, def_disp_name) == 0) { | ||
965 | def_dssdev = dssdev; | ||
966 | break; | ||
960 | } | 967 | } |
968 | } | ||
969 | |||
970 | return def_dssdev; | ||
971 | } | ||
972 | |||
973 | static void __init rfbi_probe_pdata(struct platform_device *pdev) | ||
974 | { | ||
975 | struct omap_dss_device *dssdev; | ||
976 | int r; | ||
977 | |||
978 | dssdev = rfbi_find_dssdev(pdev); | ||
961 | 979 | ||
962 | r = omap_dss_register_device(dssdev, &pdev->dev); | 980 | if (!dssdev) |
963 | if (r) | 981 | return; |
964 | DSSERR("device %s register failed: %d\n", | 982 | |
965 | dssdev->name, r); | 983 | r = rfbi_init_display(dssdev); |
984 | if (r) { | ||
985 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | ||
986 | return; | ||
987 | } | ||
988 | |||
989 | r = omap_dss_register_device(dssdev, &pdev->dev); | ||
990 | if (r) { | ||
991 | DSSERR("device %s register failed: %d\n", dssdev->name, r); | ||
992 | return; | ||
966 | } | 993 | } |
967 | } | 994 | } |
968 | 995 | ||