From patchwork Mon Nov 7 17:50:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 16596 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2200762wru; Mon, 7 Nov 2022 09:54:18 -0800 (PST) X-Google-Smtp-Source: AA0mqf4pd+aZhY5zXT8Oll3GSW8ItPRVmLGz2A4KXw4AJxN4itlbfB/yBYJHjtv3A8sPmy4POycR X-Received: by 2002:a63:d850:0:b0:470:60a4:3792 with SMTP id k16-20020a63d850000000b0047060a43792mr9714151pgj.399.1667843658351; Mon, 07 Nov 2022 09:54:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667843658; cv=none; d=google.com; s=arc-20160816; b=j0d36vHJLFS2s6dGPaHtt5xyOF6N1NZ/Ux5qW5bYzF9cjMoctzsvLgc19RfhwbOE9T W+sCuxBch2YnlSz9QxnxeCcsID7V7Kk3xCFg14KYtWKnrPtQAJosFijnKWfUTDiLvM87 WA6PJh0OfISSORS4UWkLA8Y4sdZM/QVTzRg5U4RfSrHlLfQ2uWK+z+QhxFlwEJJV7F+l FpC/x2LupWrfvLczzekm6qJXkl1qjP3JoYMplIVTErWrxcNYRBIJsT8SwgDxTTy08uBM q8pbzK02Z6KuUOhE3Jv2Hixai899xuUULt9bKl9oZMt806MR3QuDAKy2U9AMlCYMDv7t epEg== 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=klnnbpNcTKD/P5BEtITlZwIsXZ1Fq0oNl7HLfIen9u4=; b=AGdxYMa2xh8A908w8E/xFkX0HGeT4/GWa5FiE85BZtQnNTBwmf3mQLTcUnJsxtL4LL UqXKD8h1r+scsyw+6QuZ4ILB7IGh7WQE6Lh0NeWizKoZNgiYN5VTSzQHlgQ4wN9NPpp0 ZLvBG/4NgcRziMw/HTfCkOdvG2Mh8DJEZmvIOdyt/4cqhP09eNgrzWkQcRPXy7TK6tOf gZZoLvfsTvFeGhnNXpV0WgSWCSXCGAPI0/syKjaoitwS0tzeL/pc1BTzKqxrrwToiCoo PnduJVogF7JG+b5bZLnYF0QI3JkcKPqlkWVFF79S2CbMAGfKo0TGoRbCeVRiv+W00jW+ 8I5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=XNVJToum; 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 u14-20020a63790e000000b0046eecbac482si11280296pgc.415.2022.11.07.09.54.05; Mon, 07 Nov 2022 09:54:18 -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=XNVJToum; 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 S232226AbiKGRwB (ORCPT + 99 others); Mon, 7 Nov 2022 12:52:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232258AbiKGRvt (ORCPT ); Mon, 7 Nov 2022 12:51:49 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDA1B23BCD; Mon, 7 Nov 2022 09:51:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1667843476; 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=klnnbpNcTKD/P5BEtITlZwIsXZ1Fq0oNl7HLfIen9u4=; b=XNVJToum7O1ELLYtHELKa6DULsTzDus/PRW8z07zFik0Yu88BO8U7l2dptcwi44DFmKvCJ sPuN3hW1dlmJjaokQ9uTtYs2cAzqgIy2DG9zjSZmHBdycVP9duTQ44DQD/VNBt3J5IXXKf 7TrK1+e02tHDPjCnGIVQYl8ybDPhN4w= 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 , Thierry Reding , Jonathan Hunter , linux-tegra@vger.kernel.org Subject: [PATCH 05/26] drm: tegra: Use the dev_pm_ops provided by modeset helper Date: Mon, 7 Nov 2022 17:50:45 +0000 Message-Id: <20221107175106.360578-6-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?1748860832072068592?= X-GMAIL-MSGID: =?utf-8?q?1748860832072068592?= 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: Thierry Reding Cc: Jonathan Hunter Cc: linux-tegra@vger.kernel.org --- drivers/gpu/drm/tegra/drm.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 6748ec1e0005..c9b6b3acb8c7 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -1325,25 +1325,6 @@ static int host1x_drm_remove(struct host1x_device *dev) return 0; } -#ifdef CONFIG_PM_SLEEP -static int host1x_drm_suspend(struct device *dev) -{ - struct drm_device *drm = dev_get_drvdata(dev); - - return drm_mode_config_helper_suspend(drm); -} - -static int host1x_drm_resume(struct device *dev) -{ - struct drm_device *drm = dev_get_drvdata(dev); - - return drm_mode_config_helper_resume(drm); -} -#endif - -static SIMPLE_DEV_PM_OPS(host1x_drm_pm_ops, host1x_drm_suspend, - host1x_drm_resume); - static const struct of_device_id host1x_drm_subdevs[] = { { .compatible = "nvidia,tegra20-dc", }, { .compatible = "nvidia,tegra20-hdmi", }, @@ -1388,7 +1369,7 @@ static const struct of_device_id host1x_drm_subdevs[] = { static struct host1x_driver host1x_drm_driver = { .driver = { .name = "drm", - .pm = &host1x_drm_pm_ops, + .pm = pm_sleep_ptr(&drm_mode_config_pm_ops), }, .probe = host1x_drm_probe, .remove = host1x_drm_remove,