Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5059754imm; Tue, 7 Aug 2018 11:56:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeWxrasVwpxOAf/pj6CmBIF6+NFVEwWK35dW6ORK1DGf+BNs5B86/4tEM1TTi8cfEoNAPN6 X-Received: by 2002:a17:902:d710:: with SMTP id w16-v6mr18964263ply.93.1533668196394; Tue, 07 Aug 2018 11:56:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533668196; cv=none; d=google.com; s=arc-20160816; b=KJvSwu7js4xluxMvIG1y84gy1zEcZgdVYC9a2z+o0cD9ZTm3g/TW3D84THr9ZPd8MN p/RjsYS0XcXd9X/q7KPutBjUXEwM8uYyURCl+hyV0t0ReXUcrq+WACwGdnvbZN5Whuxn CiiaPNHLv4mgejtjKNOAFD+y5SufzAO316SC57NVaTcC4oG7PrgYuxCPkYahfcrOzVNu mvQCeoBNCNJEXe7aLXJZQGl2tgsGTw7qLiaVw3rhE36phNnatt90SRxX48Mlz4A4TBVW yrN9rJzefwWWmbYXiKvqmmNz982JKoSpyFQjpugpKmYbhsNkZ3nDgKGF++1dHrq3P5Wx ZkqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=ATgwHit8dvXpxrNpY0WH3WwDDUUt61gFxaeVzbN0cs4=; b=UfI3Vyt4+1/iPukv2d8UKJJcfVTWwcJJzwkmPKw1oxYF0AykAJZLw2ZUswuRuC8/yy vnNjBxRWjVUb4nnR2BKiO/dCdfkYIicP/HfUhCzO/JdHyM4EnpAFET3SLo+t7yBZgdFJ LQPeJIY+MTd6fW4Jx+J+a/BHfa+QT49k5+WRsuxO2dxaEijAcAUVD+caKDtkh2+TZhsR DWjZo9fHFiDxVlbXz3dVojQM61zLdrw6Vi1LPokJfw5HOTXcAcXZD7IlrSxejGkXvK/f I4S1pzgBMzsMU/SuIG30kHJztWPXY3kBaR5uPTcOWIZV9SLPZGA3OzfPsvYo5szVX7Du 85XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=KGaPKjXY; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 29-v6si1788487pgv.292.2018.08.07.11.56.21; Tue, 07 Aug 2018 11:56:36 -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=@agner.ch header.s=dkim header.b=KGaPKjXY; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389680AbeHGU4o (ORCPT + 99 others); Tue, 7 Aug 2018 16:56:44 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:40586 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727198AbeHGU4o (ORCPT ); Tue, 7 Aug 2018 16:56:44 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id A70375C0187; Tue, 7 Aug 2018 20:41:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1533667262; h=from:from: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=ATgwHit8dvXpxrNpY0WH3WwDDUUt61gFxaeVzbN0cs4=; b=KGaPKjXYGv01qN6U1ZUzIpytS7Z2OrxLgubyY6Lasru+HBEgtkvhYWNRKW7Egd++0Nq7oM 8DjyKY9QCv8kKYG2U/20Nd3mGgSM/JrENhdobNjnDHzmTlrpwt2ECJtKcw473b2xgPiypl eez8MjaecxRhYBwuZCG2WZlffde8srk= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Tue, 07 Aug 2018 20:41:02 +0200 From: Stefan Agner To: Leonard Crestez Cc: Philipp Zabel , Marek Vasut , Shawn Guo , Fabio Estevam , Robert Chiras , Mirela Rabulea , Anson Huang , dri-devel@lists.freedesktop.org, Dong Aisheng , linux-imx@nxp.com, kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/4] drm/mxsfb: Add PM_SLEEP support In-Reply-To: <948022edecc7af494e8bb6f55bc4ddbc33c74e3c.1533583611.git.leonard.crestez@nxp.com> References: <948022edecc7af494e8bb6f55bc4ddbc33c74e3c.1533583611.git.leonard.crestez@nxp.com> Message-ID: <9cb6d504595a642c2010bddc0d4f35ef@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06.08.2018 21:31, Leonard Crestez wrote: > Since power to the lcdif block can be lost on suspend implement > PM_SLEEP_OPS using drm_mode_config_helper_suspend/resume to save/restore > the current mode. > > Signed-off-by: Leonard Crestez Reviewed-by: Stefan Agner > --- > drivers/gpu/drm/mxsfb/mxsfb_drv.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c > b/drivers/gpu/drm/mxsfb/mxsfb_drv.c > index 68d79f5dc0d3..d797dfd40d98 100644 > --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c > +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c > @@ -416,17 +416,38 @@ static int mxsfb_remove(struct platform_device *pdev) > drm_dev_unref(drm); > > return 0; > } > > +#ifdef CONFIG_PM_SLEEP > +static int mxsfb_suspend(struct device *dev) > +{ > + struct drm_device *drm = dev_get_drvdata(dev); > + > + return drm_mode_config_helper_suspend(drm); > +} > + > +static int mxsfb_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 mxsfb_pm_ops = { > + SET_SYSTEM_SLEEP_PM_OPS(mxsfb_suspend, mxsfb_resume) > +}; > + > static struct platform_driver mxsfb_platform_driver = { > .probe = mxsfb_probe, > .remove = mxsfb_remove, > .id_table = mxsfb_devtype, > .driver = { > .name = "mxsfb", > .of_match_table = mxsfb_dt_ids, > + .pm = &mxsfb_pm_ops, > }, > }; > > module_platform_driver(mxsfb_platform_driver);