diff options
Diffstat (limited to 'drivers/video/omap2/dss/hdmi.c')
-rw-r--r-- | drivers/video/omap2/dss/hdmi.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 79393099d505..17f4d55c621c 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c | |||
@@ -328,7 +328,7 @@ static void hdmi_runtime_put(void) | |||
328 | WARN_ON(r < 0 && r != -ENOSYS); | 328 | WARN_ON(r < 0 && r != -ENOSYS); |
329 | } | 329 | } |
330 | 330 | ||
331 | static int __init hdmi_init_display(struct omap_dss_device *dssdev) | 331 | static int hdmi_init_display(struct omap_dss_device *dssdev) |
332 | { | 332 | { |
333 | int r; | 333 | int r; |
334 | 334 | ||
@@ -954,7 +954,7 @@ int hdmi_audio_config(struct omap_dss_audio *audio) | |||
954 | 954 | ||
955 | #endif | 955 | #endif |
956 | 956 | ||
957 | static struct omap_dss_device * __init hdmi_find_dssdev(struct platform_device *pdev) | 957 | static struct omap_dss_device *hdmi_find_dssdev(struct platform_device *pdev) |
958 | { | 958 | { |
959 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; | 959 | struct omap_dss_board_info *pdata = pdev->dev.platform_data; |
960 | const char *def_disp_name = omapdss_get_default_display_name(); | 960 | const char *def_disp_name = omapdss_get_default_display_name(); |
@@ -982,7 +982,7 @@ static struct omap_dss_device * __init hdmi_find_dssdev(struct platform_device * | |||
982 | return def_dssdev; | 982 | return def_dssdev; |
983 | } | 983 | } |
984 | 984 | ||
985 | static void __init hdmi_probe_pdata(struct platform_device *pdev) | 985 | static int hdmi_probe_pdata(struct platform_device *pdev) |
986 | { | 986 | { |
987 | struct omap_dss_device *plat_dssdev; | 987 | struct omap_dss_device *plat_dssdev; |
988 | struct omap_dss_device *dssdev; | 988 | struct omap_dss_device *dssdev; |
@@ -992,11 +992,11 @@ static void __init hdmi_probe_pdata(struct platform_device *pdev) | |||
992 | plat_dssdev = hdmi_find_dssdev(pdev); | 992 | plat_dssdev = hdmi_find_dssdev(pdev); |
993 | 993 | ||
994 | if (!plat_dssdev) | 994 | if (!plat_dssdev) |
995 | return; | 995 | return 0; |
996 | 996 | ||
997 | dssdev = dss_alloc_and_init_device(&pdev->dev); | 997 | dssdev = dss_alloc_and_init_device(&pdev->dev); |
998 | if (!dssdev) | 998 | if (!dssdev) |
999 | return; | 999 | return -ENOMEM; |
1000 | 1000 | ||
1001 | dss_copy_device_pdata(dssdev, plat_dssdev); | 1001 | dss_copy_device_pdata(dssdev, plat_dssdev); |
1002 | 1002 | ||
@@ -1010,7 +1010,7 @@ static void __init hdmi_probe_pdata(struct platform_device *pdev) | |||
1010 | if (r) { | 1010 | if (r) { |
1011 | DSSERR("device %s init failed: %d\n", dssdev->name, r); | 1011 | DSSERR("device %s init failed: %d\n", dssdev->name, r); |
1012 | dss_put_device(dssdev); | 1012 | dss_put_device(dssdev); |
1013 | return; | 1013 | return r; |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | r = omapdss_output_set_device(&hdmi.output, dssdev); | 1016 | r = omapdss_output_set_device(&hdmi.output, dssdev); |
@@ -1018,7 +1018,7 @@ static void __init hdmi_probe_pdata(struct platform_device *pdev) | |||
1018 | DSSERR("failed to connect output to new device: %s\n", | 1018 | DSSERR("failed to connect output to new device: %s\n", |
1019 | dssdev->name); | 1019 | dssdev->name); |
1020 | dss_put_device(dssdev); | 1020 | dss_put_device(dssdev); |
1021 | return; | 1021 | return r; |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | r = dss_add_device(dssdev); | 1024 | r = dss_add_device(dssdev); |
@@ -1027,11 +1027,13 @@ static void __init hdmi_probe_pdata(struct platform_device *pdev) | |||
1027 | omapdss_output_unset_device(&hdmi.output); | 1027 | omapdss_output_unset_device(&hdmi.output); |
1028 | hdmi_uninit_display(dssdev); | 1028 | hdmi_uninit_display(dssdev); |
1029 | dss_put_device(dssdev); | 1029 | dss_put_device(dssdev); |
1030 | return; | 1030 | return r; |
1031 | } | 1031 | } |
1032 | |||
1033 | return 0; | ||
1032 | } | 1034 | } |
1033 | 1035 | ||
1034 | static void __init hdmi_init_output(struct platform_device *pdev) | 1036 | static void hdmi_init_output(struct platform_device *pdev) |
1035 | { | 1037 | { |
1036 | struct omap_dss_output *out = &hdmi.output; | 1038 | struct omap_dss_output *out = &hdmi.output; |
1037 | 1039 | ||
@@ -1052,7 +1054,7 @@ static void __exit hdmi_uninit_output(struct platform_device *pdev) | |||
1052 | } | 1054 | } |
1053 | 1055 | ||
1054 | /* HDMI HW IP initialisation */ | 1056 | /* HDMI HW IP initialisation */ |
1055 | static int __init omapdss_hdmihw_probe(struct platform_device *pdev) | 1057 | static int omapdss_hdmihw_probe(struct platform_device *pdev) |
1056 | { | 1058 | { |
1057 | struct resource *res; | 1059 | struct resource *res; |
1058 | int r; | 1060 | int r; |
@@ -1096,7 +1098,13 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev) | |||
1096 | 1098 | ||
1097 | dss_debugfs_create_file("hdmi", hdmi_dump_regs); | 1099 | dss_debugfs_create_file("hdmi", hdmi_dump_regs); |
1098 | 1100 | ||
1099 | hdmi_probe_pdata(pdev); | 1101 | r = hdmi_probe_pdata(pdev); |
1102 | if (r) { | ||
1103 | hdmi_panel_exit(); | ||
1104 | hdmi_uninit_output(pdev); | ||
1105 | pm_runtime_disable(&pdev->dev); | ||
1106 | return r; | ||
1107 | } | ||
1100 | 1108 | ||
1101 | return 0; | 1109 | return 0; |
1102 | } | 1110 | } |
@@ -1151,6 +1159,7 @@ static const struct dev_pm_ops hdmi_pm_ops = { | |||
1151 | }; | 1159 | }; |
1152 | 1160 | ||
1153 | static struct platform_driver omapdss_hdmihw_driver = { | 1161 | static struct platform_driver omapdss_hdmihw_driver = { |
1162 | .probe = omapdss_hdmihw_probe, | ||
1154 | .remove = __exit_p(omapdss_hdmihw_remove), | 1163 | .remove = __exit_p(omapdss_hdmihw_remove), |
1155 | .driver = { | 1164 | .driver = { |
1156 | .name = "omapdss_hdmi", | 1165 | .name = "omapdss_hdmi", |
@@ -1161,7 +1170,7 @@ static struct platform_driver omapdss_hdmihw_driver = { | |||
1161 | 1170 | ||
1162 | int __init hdmi_init_platform_driver(void) | 1171 | int __init hdmi_init_platform_driver(void) |
1163 | { | 1172 | { |
1164 | return platform_driver_probe(&omapdss_hdmihw_driver, omapdss_hdmihw_probe); | 1173 | return platform_driver_register(&omapdss_hdmihw_driver); |
1165 | } | 1174 | } |
1166 | 1175 | ||
1167 | void __exit hdmi_uninit_platform_driver(void) | 1176 | void __exit hdmi_uninit_platform_driver(void) |