diff options
Diffstat (limited to 'drivers/video/fbdev/omap2/dss/rfbi.c')
| -rw-r--r-- | drivers/video/fbdev/omap2/dss/rfbi.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/video/fbdev/omap2/dss/rfbi.c b/drivers/video/fbdev/omap2/dss/rfbi.c index 065effca9236..1525a494d057 100644 --- a/drivers/video/fbdev/omap2/dss/rfbi.c +++ b/drivers/video/fbdev/omap2/dss/rfbi.c | |||
| @@ -36,6 +36,7 @@ | |||
| 36 | #include <linux/semaphore.h> | 36 | #include <linux/semaphore.h> |
| 37 | #include <linux/platform_device.h> | 37 | #include <linux/platform_device.h> |
| 38 | #include <linux/pm_runtime.h> | 38 | #include <linux/pm_runtime.h> |
| 39 | #include <linux/component.h> | ||
| 39 | 40 | ||
| 40 | #include <video/omapdss.h> | 41 | #include <video/omapdss.h> |
| 41 | #include "dss.h" | 42 | #include "dss.h" |
| @@ -938,7 +939,7 @@ static void rfbi_init_output(struct platform_device *pdev) | |||
| 938 | omapdss_register_output(out); | 939 | omapdss_register_output(out); |
| 939 | } | 940 | } |
| 940 | 941 | ||
| 941 | static void __exit rfbi_uninit_output(struct platform_device *pdev) | 942 | static void rfbi_uninit_output(struct platform_device *pdev) |
| 942 | { | 943 | { |
| 943 | struct omap_dss_device *out = &rfbi.output; | 944 | struct omap_dss_device *out = &rfbi.output; |
| 944 | 945 | ||
| @@ -946,8 +947,9 @@ static void __exit rfbi_uninit_output(struct platform_device *pdev) | |||
| 946 | } | 947 | } |
| 947 | 948 | ||
| 948 | /* RFBI HW IP initialisation */ | 949 | /* RFBI HW IP initialisation */ |
| 949 | static int omap_rfbihw_probe(struct platform_device *pdev) | 950 | static int rfbi_bind(struct device *dev, struct device *master, void *data) |
| 950 | { | 951 | { |
| 952 | struct platform_device *pdev = to_platform_device(dev); | ||
| 951 | u32 rev; | 953 | u32 rev; |
| 952 | struct resource *rfbi_mem; | 954 | struct resource *rfbi_mem; |
| 953 | struct clk *clk; | 955 | struct clk *clk; |
| @@ -1005,8 +1007,10 @@ err_runtime_get: | |||
| 1005 | return r; | 1007 | return r; |
| 1006 | } | 1008 | } |
| 1007 | 1009 | ||
| 1008 | static int __exit omap_rfbihw_remove(struct platform_device *pdev) | 1010 | static void rfbi_unbind(struct device *dev, struct device *master, void *data) |
| 1009 | { | 1011 | { |
| 1012 | struct platform_device *pdev = to_platform_device(dev); | ||
| 1013 | |||
| 1010 | rfbi_uninit_output(pdev); | 1014 | rfbi_uninit_output(pdev); |
| 1011 | 1015 | ||
| 1012 | pm_runtime_disable(&pdev->dev); | 1016 | pm_runtime_disable(&pdev->dev); |
| @@ -1014,6 +1018,22 @@ static int __exit omap_rfbihw_remove(struct platform_device *pdev) | |||
| 1014 | return 0; | 1018 | return 0; |
| 1015 | } | 1019 | } |
| 1016 | 1020 | ||
| 1021 | static const struct component_ops rfbi_component_ops = { | ||
| 1022 | .bind = rfbi_bind, | ||
| 1023 | .unbind = rfbi_unbind, | ||
| 1024 | }; | ||
| 1025 | |||
| 1026 | static int rfbi_probe(struct platform_device *pdev) | ||
| 1027 | { | ||
| 1028 | return component_add(&pdev->dev, &rfbi_component_ops); | ||
| 1029 | } | ||
| 1030 | |||
| 1031 | static int rfbi_remove(struct platform_device *pdev) | ||
| 1032 | { | ||
| 1033 | component_del(&pdev->dev, &rfbi_component_ops); | ||
| 1034 | return 0; | ||
| 1035 | } | ||
| 1036 | |||
| 1017 | static int rfbi_runtime_suspend(struct device *dev) | 1037 | static int rfbi_runtime_suspend(struct device *dev) |
| 1018 | { | 1038 | { |
| 1019 | dispc_runtime_put(); | 1039 | dispc_runtime_put(); |
| @@ -1038,8 +1058,8 @@ static const struct dev_pm_ops rfbi_pm_ops = { | |||
| 1038 | }; | 1058 | }; |
| 1039 | 1059 | ||
| 1040 | static struct platform_driver omap_rfbihw_driver = { | 1060 | static struct platform_driver omap_rfbihw_driver = { |
| 1041 | .probe = omap_rfbihw_probe, | 1061 | .probe = rfbi_probe, |
| 1042 | .remove = __exit_p(omap_rfbihw_remove), | 1062 | .remove = rfbi_remove, |
| 1043 | .driver = { | 1063 | .driver = { |
| 1044 | .name = "omapdss_rfbi", | 1064 | .name = "omapdss_rfbi", |
| 1045 | .pm = &rfbi_pm_ops, | 1065 | .pm = &rfbi_pm_ops, |
| @@ -1052,7 +1072,7 @@ int __init rfbi_init_platform_driver(void) | |||
| 1052 | return platform_driver_register(&omap_rfbihw_driver); | 1072 | return platform_driver_register(&omap_rfbihw_driver); |
| 1053 | } | 1073 | } |
| 1054 | 1074 | ||
| 1055 | void __exit rfbi_uninit_platform_driver(void) | 1075 | void rfbi_uninit_platform_driver(void) |
| 1056 | { | 1076 | { |
| 1057 | platform_driver_unregister(&omap_rfbihw_driver); | 1077 | platform_driver_unregister(&omap_rfbihw_driver); |
| 1058 | } | 1078 | } |
