diff options
Diffstat (limited to 'drivers/video/fbdev/omap2/dss/dispc.c')
-rw-r--r-- | drivers/video/fbdev/omap2/dss/dispc.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/video/fbdev/omap2/dss/dispc.c index e3417af63451..c8e34163211a 100644 --- a/drivers/video/fbdev/omap2/dss/dispc.c +++ b/drivers/video/fbdev/omap2/dss/dispc.c @@ -39,6 +39,7 @@ #include <linux/mfd/syscon.h> #include <linux/regmap.h> #include <linux/of.h> +#include <linux/component.h> #include <video/omapdss.h> @@ -3882,8 +3883,9 @@ void dispc_free_irq(void *dev_id) EXPORT_SYMBOL(dispc_free_irq); /* DISPC HW IP initialisation */ -static int omap_dispchw_probe(struct platform_device *pdev) +static int dispc_bind(struct device *dev, struct device *master, void *data) { + struct platform_device *pdev = to_platform_device(dev); u32 rev; int r = 0; struct resource *dispc_mem; @@ -3955,12 +3957,27 @@ err_runtime_get: return r; } -static int omap_dispchw_remove(struct platform_device *pdev) +static void dispc_unbind(struct device *dev, struct device *master, + void *data) { - pm_runtime_disable(&pdev->dev); + pm_runtime_disable(dev); dss_uninit_overlay_managers(); +} + +static const struct component_ops dispc_component_ops = { + .bind = dispc_bind, + .unbind = dispc_unbind, +}; +static int dispc_probe(struct platform_device *pdev) +{ + return component_add(&pdev->dev, &dispc_component_ops); +} + +static int dispc_remove(struct platform_device *pdev) +{ + component_del(&pdev->dev, &dispc_component_ops); return 0; } @@ -4013,7 +4030,8 @@ static const struct of_device_id dispc_of_match[] = { }; static struct platform_driver omap_dispchw_driver = { - .remove = omap_dispchw_remove, + .probe = dispc_probe, + .remove = dispc_remove, .driver = { .name = "omapdss_dispc", .pm = &dispc_pm_ops, @@ -4024,7 +4042,7 @@ static struct platform_driver omap_dispchw_driver = { int __init dispc_init_platform_driver(void) { - return platform_driver_probe(&omap_dispchw_driver, omap_dispchw_probe); + return platform_driver_register(&omap_dispchw_driver); } void dispc_uninit_platform_driver(void) |