From patchwork Mon Nov 7 17:50:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 13034972 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 87C7FC4332F for ; Mon, 7 Nov 2022 17:51:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A3FCB10E872; Mon, 7 Nov 2022 17:51:43 +0000 (UTC) Received: from aposti.net (aposti.net [89.234.176.197]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3F65610E872 for ; Mon, 7 Nov 2022 17:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1667843475; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dlaW9Vtj6RHmjIYO+oE+UbK6k4avV8WMAFCPj+ba7lA=; b=Kq4dVRJp0YG7tZIogHozX1GK3+Z2jMHh9Og4VXG+WqhBUF/62BLn2/OlEKbWOIBHHkHcin toDThWaV+y8YDSm3zZ1AvFrDlQyX40DhI8AJUAULWET6/9PEZ9/IbB7OpZXQITzS7ZY/Lz IGTdIq1PTAHmRc38OOmdIS0jyrgoy/w= From: Paul Cercueil To: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter Subject: [PATCH 04/26] drm: rockchip: Use the dev_pm_ops provided by modeset helper Date: Mon, 7 Nov 2022 17:50:44 +0000 Message-Id: <20221107175106.360578-5-paul@crapouillou.net> In-Reply-To: <20221107175106.360578-1-paul@crapouillou.net> References: <20221107175106.360578-1-paul@crapouillou.net> MIME-Version: 1.0 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: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sandy Huang , Paul Cercueil , linux-rockchip@lists.infradead.org, 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 --- Cc: Sandy Huang Cc: "Heiko Stübner" Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 23 +-------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 813f9f8c8698..c76593b3f8eb 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -236,27 +236,6 @@ static const struct drm_driver rockchip_drm_driver = { .minor = DRIVER_MINOR, }; -#ifdef CONFIG_PM_SLEEP -static int rockchip_drm_sys_suspend(struct device *dev) -{ - struct drm_device *drm = dev_get_drvdata(dev); - - return drm_mode_config_helper_suspend(drm); -} - -static int rockchip_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 rockchip_drm_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(rockchip_drm_sys_suspend, - rockchip_drm_sys_resume) -}; - #define MAX_ROCKCHIP_SUB_DRIVERS 16 static struct platform_driver *rockchip_sub_drivers[MAX_ROCKCHIP_SUB_DRIVERS]; static int num_rockchip_sub_drivers; @@ -480,7 +459,7 @@ static struct platform_driver rockchip_drm_platform_driver = { .driver = { .name = "rockchip-drm", .of_match_table = rockchip_drm_dt_ids, - .pm = &rockchip_drm_pm_ops, + .pm = pm_sleep_ptr(&drm_mode_config_pm_ops), }, };