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: 16595 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2200685wru; Mon, 7 Nov 2022 09:54:07 -0800 (PST) X-Google-Smtp-Source: AMsMyM4PFvZVErHd8ALaQJc4AxKDndYAjZhJ2IbfriPfrHVUB3u21YSGOOLykZh4KYCbuvD+3MCX X-Received: by 2002:a17:902:c209:b0:186:67b0:b1d0 with SMTP id 9-20020a170902c20900b0018667b0b1d0mr52726138pll.129.1667843646966; Mon, 07 Nov 2022 09:54:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667843646; cv=none; d=google.com; s=arc-20160816; b=U2E/T91pxVSIQkfF7cofV3RntwfjHw3mAOMbIZuZgX/H2Ygvb6DZzlOUbVpuEce8Bv vpc5T+GsKw+VyO5GgdWH0Z5EAh3vH/yDF49oBspuLjsfHBdtMTr+QOg22EYaY1c3CkFr 7LHKfD3d6hGo+QBgaJGgW7/4wA0glydRmldvGNTOBMYKIdBpIBZQuv9+9sdQ6XESRm68 HEbEyHZy11otq/hZoR7GDhcdXMstvmbpS7Ov6Q29Hfo9dTB+FWiKUkbwjjrdl7mv9/aP vZs9546EN0LbSM/yZ7qSvIQaYs395QUwekDf64TJkTEa/mHLxFhehNzL0gv7bUcxe9h6 SfXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dlaW9Vtj6RHmjIYO+oE+UbK6k4avV8WMAFCPj+ba7lA=; b=botWDWWQv7lj0Vivp6iySpkc7d5+Vkq1rjee7guKFUdd2utoEEuPTa5mcqYwBtaDYz bw68kXzVqN26J/hZWySf8AxLdM43j3EtKHUbnbeWrKHMqW2SSlwmUQ6ea4d4E1zVjwGU zJIHaTfm9qzm+hAOcWHTilB2oZSWk89XDjwE9aBH6IPPyUC+ncDIiwDfh42c7VDFwxfk ov/WuFGpM5IvFOY7G6JGnotb8zCBhdfgRQAlg38Q1TLW2hbJyLtsf025/vVjl1UGrH8U Tn2maseBJfYyhOs6S02Bc+Pt8WTxkZHaMDLvz6GqKj/o6rlSF4BD4Z5wUmwhEtXkx8iM 6L2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=Kq4dVRJp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b21-20020a056a000cd500b00565ba4c501asi11793478pfv.276.2022.11.07.09.53.53; Mon, 07 Nov 2022 09:54:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=Kq4dVRJp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232282AbiKGRv6 (ORCPT + 99 others); Mon, 7 Nov 2022 12:51:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231464AbiKGRvm (ORCPT ); Mon, 7 Nov 2022 12:51:42 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0AA623E98 for ; Mon, 7 Nov 2022 09:51:41 -0800 (PST) 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 Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Cercueil , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748860819473664047?= X-GMAIL-MSGID: =?utf-8?q?1748860819473664047?= 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), }, };