Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4255339ybg; Tue, 29 Oct 2019 04:34:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUQwg7p6UmoEAA2iIyFW/s8YTo3N0UnAEbAaHLGGKJ1S1xX53Rf2s+dCv2F7G2qh99pm0O X-Received: by 2002:a17:906:2989:: with SMTP id x9mr2725193eje.318.1572348842620; Tue, 29 Oct 2019 04:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572348842; cv=none; d=google.com; s=arc-20160816; b=0+0b5kZsViDy+7+3v6jxCBeSAPzMb4WcwArjTo+UU+sHYyJnAj9UC7+y8ODlt5wt1s LfCPFckNnQpJPjFrGBLn7cTv41BgOUbI+8nljKvlwt505r2vOwMFd+wxv4GBemSiQ/Sj mQvkpufdhTC6TfaLGK2K3bLm4sA3MJIQpmx015KMWmiv30HXdc2U+7Aa5JQ2UWbDBtAv M7KA0OJeIYSouEa2KVOO4nASnHZtG6dbaE1RKeeMiXzpheSG1t5o88qCGWLjRDqvaj3L PSvE7fybOTLy5A8dof0AsNzXbMQAXDjuFHnVyowpUg/w3bpK5eXt6ozzhhlwqrY7v/+C 8xFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=V8IsLh2eF2tud/UsHy+zE40SITpAVsYDCvpg+6D8kvw=; b=tD82BINf6UyHcjXGTFgO0+gZ6vY44Hak7r30clN5ROhkh+mXFAnK9+EqreUCbUzpgG +RbR1GnuUkngTMdkpgU6psJ2bomiwmnjqipfMMdtQFYNOwXv8isKVCQuB8EinD95eJJT WZxh1tuNyx3/e1rltIk9aJfGa+C+PS10dKtrvXSUh5gQD74fPeuc2e+WWLzWIyrG+ZQq O7qEkrAfOqTqKi3O462vKLc1dx5f95zqpnJE3rjO7412gAA2RBZ5z/r2duUxDPWPZYOn wxmxP2umddMpbhWfOPYJcmIPXOw6iBWuFoISvA/4p6GU+vXx+7HEmQaOZ1JnkaUJBdEp A0Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=rCaxpPR2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d25si10065759edb.19.2019.10.29.04.33.39; Tue, 29 Oct 2019 04:34:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@megous.com header.s=mail header.b=rCaxpPR2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=megous.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731205AbfJ2L2w (ORCPT + 99 others); Tue, 29 Oct 2019 07:28:52 -0400 Received: from vps.xff.cz ([195.181.215.36]:60276 "EHLO vps.xff.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725927AbfJ2L2v (ORCPT ); Tue, 29 Oct 2019 07:28:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megous.com; s=mail; t=1572348530; bh=7CvZFllA5Lo3ke7W4E4r8AmPqCtcdtZ72Xnw6OysY14=; h=From:To:Cc:Subject:Date:From; b=rCaxpPR2UhHDsQQ7Z4TX360K5iP0YBo4qKopDd7yNu0zAFiRBG39FmQ9J+Htaednr +MeXaB5cGXQf1+HuM+Q9pUW0qPMz1zRzTeXAWk/vQpOEVEh39u8M7s7xZvekDuPRK7 JItx9M4N6QwfjCvlpk8RdiZC3Ybj8/1oWHZE2rkc= From: Ondrej Jirman To: linux-sunxi@googlegroups.com Cc: Ondrej Jirman , Maxime Ripard , Chen-Yu Tsai , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS FOR ALLWINNER A10), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Allwinner sunXi SoC support), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2] drm: sun4i: Add support for suspending the display driver Date: Tue, 29 Oct 2019 12:28:46 +0100 Message-Id: <20191029112846.3604925-1-megous@megous.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Shut down the display engine during suspend. Signed-off-by: Ondrej Jirman --- Changes in v2: - spaces -> tabs drivers/gpu/drm/sun4i/sun4i_drv.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index a5757b11b730..c519d7cfcf43 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -346,6 +346,27 @@ 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; @@ -418,6 +439,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, }, }; module_platform_driver(sun4i_drv_platform_driver); -- 2.23.0