From patchwork Mon Nov 7 17:50:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 13034974 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC122C433FE for ; Mon, 7 Nov 2022 17:51:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D552010E87D; Mon, 7 Nov 2022 17:51:55 +0000 (UTC) Received: from aposti.net (aposti.net [89.234.176.197]) by gabe.freedesktop.org (Postfix) with ESMTPS id 75D1810E87D for ; Mon, 7 Nov 2022 17:51:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1667843477; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8+XyDxogaUVBf6HS7jo+DZrvfm9xqEIXgQV4MasKyac=; b=I4WGMPR7s2z5M/wHNBc/ayUSIPqMHRc4uyoGTHcaF7jQfd347WPruo18xlo7qIezQ+++S4 qEJrLUIK9LyFsOWst/V8Qu3CQ3bD2svIWL14fhc3AOj5nzULXuI2WBmAL99apdBy8EYM2n S+xEBCam5RvZu0k+2GHgkxKdsS8n3GQ= From: Paul Cercueil To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Subject: [PATCH 06/26] drm: sun4i: Use the dev_pm_ops provided by modeset helper Date: Mon, 7 Nov 2022 17:50:46 +0000 Message-Id: <20221107175106.360578-7-paul@crapouillou.net> In-Reply-To: <20221107175106.360578-1-paul@crapouillou.net> References: <20221107175106.360578-1-paul@crapouillou.net> MIME-Version: 1.0 X-Spam: Yes X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Holland , linux-kernel@vger.kernel.org, Jernej Skrabec , Paul Cercueil , Chen-Yu Tsai , dri-devel@lists.freedesktop.org, linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use the drm_mode_config_pm_ops structure exported by drm_modeset_helper.c, which provides the exact same PM callbacks. Signed-off-by: Paul Cercueil Reviewed-by: Samuel Holland --- Cc: Maxime Ripard Cc: Chen-Yu Tsai Cc: Jernej Skrabec Cc: Samuel Holland Cc: linux-arm-kernel@lists.infradead.org Cc: linux-sunxi@lists.linux.dev --- drivers/gpu/drm/sun4i/sun4i_drv.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index d06ffd99d86e..8147b2abe5ba 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -339,27 +340,6 @@ static int sun4i_drv_add_endpoints(struct device *dev, return count; } -#ifdef CONFIG_PM_SLEEP -static int sun4i_drv_drm_sys_suspend(struct device *dev) -{ - struct drm_device *drm = dev_get_drvdata(dev); - - return drm_mode_config_helper_suspend(drm); -} - -static int sun4i_drv_drm_sys_resume(struct device *dev) -{ - struct drm_device *drm = dev_get_drvdata(dev); - - return drm_mode_config_helper_resume(drm); -} -#endif - -static const struct dev_pm_ops sun4i_drv_drm_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(sun4i_drv_drm_sys_suspend, - sun4i_drv_drm_sys_resume) -}; - static int sun4i_drv_probe(struct platform_device *pdev) { struct component_match *match = NULL; @@ -440,7 +420,7 @@ static struct platform_driver sun4i_drv_platform_driver = { .driver = { .name = "sun4i-drm", .of_match_table = sun4i_drv_of_table, - .pm = &sun4i_drv_drm_pm_ops, + .pm = pm_sleep_ptr(&drm_mode_config_pm_ops), }, }; drm_module_platform_driver(sun4i_drv_platform_driver);