diff options
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_scaler.c')
| -rw-r--r-- | drivers/gpu/drm/exynos/exynos_drm_scaler.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c index f9ae5b038d59..c8a1b6b0a29c 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c @@ -11,10 +11,11 @@ #include <linux/interrupt.h> #include <linux/io.h> #include <linux/kernel.h> -#include <linux/of_device.h> +#include <linux/of.h> #include <linux/platform_device.h> #include <linux/pm_runtime.h> +#include <drm/drm_blend.h> #include <drm/drm_fourcc.h> #include <drm/exynos_drm.h> @@ -402,7 +403,7 @@ static int scaler_commit(struct exynos_drm_ipp *ipp, return 0; } -static struct exynos_drm_ipp_funcs ipp_funcs = { +static const struct exynos_drm_ipp_funcs ipp_funcs = { .commit = scaler_commit, }; @@ -485,7 +486,6 @@ static const struct component_ops scaler_component_ops = { static int scaler_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct resource *regs_res; struct scaler_context *scaler; int irq; int ret, i; @@ -498,8 +498,7 @@ static int scaler_probe(struct platform_device *pdev) (struct scaler_data *)of_device_get_match_data(dev); scaler->dev = dev; - regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - scaler->regs = devm_ioremap_resource(dev, regs_res); + scaler->regs = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(scaler->regs)) return PTR_ERR(scaler->regs); @@ -540,19 +539,15 @@ err_ippdrv_register: return ret; } -static int scaler_remove(struct platform_device *pdev) +static void scaler_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; component_del(dev, &scaler_component_ops); pm_runtime_dont_use_autosuspend(dev); pm_runtime_disable(dev); - - return 0; } -#ifdef CONFIG_PM - static int clk_disable_unprepare_wrapper(struct clk *clk) { clk_disable_unprepare(clk); @@ -585,13 +580,9 @@ static int scaler_runtime_resume(struct device *dev) return scaler_clk_ctrl(scaler, true); } -#endif -static const struct dev_pm_ops scaler_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(scaler_runtime_suspend, scaler_runtime_resume, NULL) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(scaler_pm_ops, scaler_runtime_suspend, + scaler_runtime_resume, NULL); static const struct drm_exynos_ipp_limit scaler_5420_two_pixel_hv_limits[] = { { IPP_SIZE_LIMIT(BUFFER, .h = { 16, SZ_8K }, .v = { 16, SZ_8K }) }, @@ -731,8 +722,7 @@ struct platform_driver scaler_driver = { .remove = scaler_remove, .driver = { .name = "exynos-scaler", - .owner = THIS_MODULE, - .pm = &scaler_pm_ops, + .pm = pm_ptr(&scaler_pm_ops), .of_match_table = exynos_scaler_match, }, }; |
