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: 16598 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2200946wru; Mon, 7 Nov 2022 09:54:45 -0800 (PST) X-Google-Smtp-Source: AMsMyM51/9cG+JEhRC4m1ZaRvtRvhuOii/14MzV19h+fGvaX0DLTgkhYLP31u7FWu8T4UZ99iXL9 X-Received: by 2002:a17:902:ce0f:b0:187:640:42f with SMTP id k15-20020a170902ce0f00b001870640042fmr50572969plg.115.1667843685028; Mon, 07 Nov 2022 09:54:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667843685; cv=none; d=google.com; s=arc-20160816; b=luTYYbGZ/ZcpfeknOKfcxUaGIEh+N5RaQTNOWLhbHzI+JtgibHACVwjW0EWCKWzVEv Ue40iOq6TU0UOF+Z9jCEgZbQzNLor6IvQXh3Y734hZ3qr0Ffjea54tL+QscK4coFKVSO vKeU83dX5qhvhEfVtR1umSn1z3SFMzWDjT5r1a5GN8Xh/pXimyTx44Ova+DKNXlSuN7i 4lX7ZxNfnfdvAVN9VH10MxzVz/JE4M6wIEPl6DYJGZTsZgAkPBLcP6UQquh/G3ob2zfk r6S9GS5MOPhD0D00kPMSNCeSBxzfMQ01dG6ARdXGEUXODBFoi1jDwI/gC2saNJa/VTaX E/5w== 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=8+XyDxogaUVBf6HS7jo+DZrvfm9xqEIXgQV4MasKyac=; b=d8PEae/SwqKVqYLLAJ90qxr04nmc8pnQRWFO4ymRS7Bjy93PXalymb7JzsKM4UW5kY o7TkbltLn3eb9nvVbxTawSV79hsb2eDFaTYNHEJbOVEVzq5FBiw9u4/17JyFgJqanR+p TVYg8a0Jug/aVBXdShJlEwbCSUeyC9rufsUx/rDm/cSOWKGPCiVP3yyBxA39INo3iZX4 VrMDRbce+bZHK/4WmXI4pSm4uTOiNy+zWNkh1dGWtJplTjWkAEAblbvA57D/zR5EycEp /XfqVv2j0uym3alGNNval94xKEIQGeLcCARR4YVYPmHyN3fyAiD37MVf8t/kSzr030eN u3sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=I4WGMPR7; 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 d9-20020a056a0010c900b00545c1d801d7si10784305pfu.364.2022.11.07.09.54.30; Mon, 07 Nov 2022 09:54:45 -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=I4WGMPR7; 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 S232274AbiKGRwM (ORCPT + 99 others); Mon, 7 Nov 2022 12:52:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232213AbiKGRv4 (ORCPT ); Mon, 7 Nov 2022 12:51:56 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7F1124BDB for ; Mon, 7 Nov 2022 09:51:55 -0800 (PST) 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 Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Cercueil , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev 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-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?1748860860011504212?= X-GMAIL-MSGID: =?utf-8?q?1748860860011504212?= 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);