Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3979319imm; Mon, 6 Aug 2018 14:16:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdAgx2gm3rsF2VGx3RasJBMxhXcRjkKJqh5DWGX1ghGm/5d9I+cCd+92YbJeE4F63KZCblo X-Received: by 2002:a63:4e25:: with SMTP id c37-v6mr16005310pgb.6.1533590192499; Mon, 06 Aug 2018 14:16:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533590192; cv=none; d=google.com; s=arc-20160816; b=BNpywymbL+tjfUev6sT1jFQjuXibZR5S12Uu+IvPgvsems4BK6JQAQNiXLQh6Cm0nj hA1EjXo8k9WwwN+C0BRS+rtooolj6baM4rFbqQ+9SI0DYkGY9AZ1mpiUTh/6R1BBmDk1 xggBHzcC9TaH7nzX8s8Jpj3Glr+7D9GUG/Sm8H6PEq90UNKr6cKNQ57pVJY7kI8ZnsUi LqjxUfyFRe3h1kRudsZ/vCREFeeFTF2+F8U1bF+nvOXBu2I4tIPRME1FW1OhhK4ZZxvn J5SZ6qT8NLObl3M6NS96ZShY6AyVUUxZ+eW1UIeO0roDuVs9AZeltb4d/yOKaaBfQnjD QUnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=8YXYWPS8UPXT2fZWKPxA/MG6g3TPed3zxy2zxOQmTek=; b=ktbOQltUSA367mzUNA3afRPGYgZMeGafI+1c4XxhFQkxeNY4I2HMesv/6dtSLJOIDL 63KY3pYB+IXPXLtMhchyosH/EVX1rulPWDfs2z0H8LYYnaidTS4/Y9zQqbXjI5+xwWfC FzQ2onibho/2PV89wSxAB6agmYNzpeytZn0VEC5+RhoIC6Wm9JznQhQaihvM35PJ9RzL PVrWOXZDE2VH4ChOvrrup+jQP0ge9/pd/+IUg+FcjiqVN4bqeudDAxVDMePN5mIDQDbr mGNoxmP3YZx5z6NLdNCmy7PyZXuIAwiw86Xp4ZkFO1CmkH2ShHluZRmKw3MaLrvSJi6b khCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=DDcjASaH; 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=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d128-v6si14749453pfc.211.2018.08.06.14.16.17; Mon, 06 Aug 2018 14:16:32 -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=@nxp.com header.s=selector1 header.b=DDcjASaH; 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=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733278AbeHFVmJ (ORCPT + 99 others); Mon, 6 Aug 2018 17:42:09 -0400 Received: from mail-eopbgr40050.outbound.protection.outlook.com ([40.107.4.50]:22570 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731324AbeHFVmI (ORCPT ); Mon, 6 Aug 2018 17:42:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8YXYWPS8UPXT2fZWKPxA/MG6g3TPed3zxy2zxOQmTek=; b=DDcjASaHPHcRzfwvi9poJkK+odws2fWvhqhhFYkHX5wsqVDRYoU2geOT4O1vvpOeEs35GcKTnCl0rkhgtF/HWG92r1NLEWQ1ldXd0dPe7cBJ0E9mnyGqrsswYlSFTPZ2g2JN/SsXDyy2lNOSKwcQQbYVv3SAMpbQW9naEKTGU/0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; Received: from localhost.localdomain (95.76.156.53) by AM0PR04MB4290.eurprd04.prod.outlook.com (2603:10a6:208:67::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Mon, 6 Aug 2018 19:31:30 +0000 From: Leonard Crestez To: Stefan Agner , Philipp Zabel , Marek Vasut Cc: 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: [PATCH v3 3/4] drm/mxsfb: Add PM_SLEEP support Date: Mon, 6 Aug 2018 22:31:09 +0300 Message-Id: <948022edecc7af494e8bb6f55bc4ddbc33c74e3c.1533583611.git.leonard.crestez@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [95.76.156.53] X-ClientProxiedBy: DB6PR07CA0162.eurprd07.prod.outlook.com (2603:10a6:6:43::16) To AM0PR04MB4290.eurprd04.prod.outlook.com (2603:10a6:208:67::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d62b7614-08ba-4c84-fd8c-08d5fbd33668 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM0PR04MB4290; X-Microsoft-Exchange-Diagnostics: 1;AM0PR04MB4290;3:Z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8EtXyK86sLiqZtFnfhzLUe4LhGZlLyiE0gj6tvIjLMrshryuU6w6qFSt3cezUFZ1lu+MwkIOX/CErpEa7DW5Iwd0YaX0ukfDNvYfykN5LvY2fz5iJ7tVTMLVbC1i5KnEjpcD1OdiadclyMtqbu2q515wG86rk0A28OHMHNGRmRKOHlZ2aL4EhBlkY5cceXw9OXr3xwtcaRsoM8Du6EZPYqQYkXH4a2lN1OTvEZXhSJhu1T88A8UMjMTdcnJsXsZEH11/jZSse4DGBnGek200JACRhe2DMzSJLOHt7DZosaEru9+NfG5gVOM8qbFKsAlnOnJ8GIojil4Z/Jvtzic;4:RYop5SdqjdzcbwTKBGf6UXuVVcejsB6frWS+AOIUUHdzcLY8ocxHnBRP2PysAqihKhNzCQDU/3vsIOeXhDdx3qA5Hp4S1U4OZrII7OX/H+YtYNtyfM1+c1/8FDETV3pRBra2tc4k9eIYCZRi5wx6KIGwpy8OivcMwwl+K2rhGlyCk19nUf4q/K41WxCNOq8yKFIa3uw6orWZCmtqd0E5aKil22W8lwVc6sAzw95lOayFyHIvpp6WSWyz+ulnrUqsHsCKwew+lziy9MyH/6KfR9Z1UgJEVFnQW5Pq2wX4m84eLsjyX2uIY5UuEiLTgYdP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:AM0PR04MB4290;BCL:0;PCL:0;RULEID:;SRVR:AM0PR04MB4290; X-Forefront-PRVS: 07562C22DA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(39860400002)(376002)(346002)(366004)(396003)(136003)(189003)(199004)(486006)(86362001)(575784001)(50226002)(76176011)(316002)(6486002)(68736007)(14444005)(386003)(6506007)(2906002)(6512007)(50466002)(51416003)(5660300001)(478600001)(6116002)(16526019)(3846002)(66066001)(25786009)(26005)(47776003)(305945005)(44832011)(186003)(8936002)(52116002)(476003)(48376002)(6666003)(2616005)(4326008)(446003)(118296001)(54906003)(8676002)(105586002)(81166006)(53936002)(7736002)(97736004)(110136005)(11346002)(956004)(106356001)(81156014)(16586007)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR04MB4290;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM0PR04MB4290;23:VRt7s62xWiVEZtRZzs9BGhOpf2H7QHVA67HdDNAoM?= =?us-ascii?Q?ToAmTNWj/NDtZbTl9k9T7fOIJpNTt5vhv/0RFz0VgLRPEMB2uPy6kLFnSRr7?= =?us-ascii?Q?1XsiXbE3jU32LWGNJT6n5SfAjtt3A1aVW7ShhikMAEq8qdKGtaCsPBXJ2ho5?= =?us-ascii?Q?A9kE52FOPlxX8lilQsH45/YRYSwfWLLWqxH3gY+A8SUdjODZhpmtJuWjrsdm?= =?us-ascii?Q?54XdKtH6nzfSB0SmKVKsgOFbyQjCHe1D0jaj1RLrfWnj/K647+cqC0AWKt29?= =?us-ascii?Q?Oa9ggpKQ7f94kSj6pDyCDV+ED0neDMT7o8Ts/8/QYJhrkqoK1NfC6mGJZ122?= =?us-ascii?Q?95+4aT+ioVCkUpdBXhMC0/LO3OLnDgLYHSmQ504aG4K2XSX+YcDtMuNALdaA?= =?us-ascii?Q?65XX8ur7hzr8WTf6Ax002+aGXo+vk3+ZvXhsp6KbNZl6jNLgnuiCyVlpUBas?= =?us-ascii?Q?0wy/Hbnu99NnfBWdSxDKcu8G1+wxKIveMBHaGkCde4KGESY+S29zr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huvacPq6zN4DTsd31THrPhquYDyh+zor72l0louYhRXxuj3V9aJDVKZSF0gFYurGNZHMpMYR53psHxBceKptxH6TvRG5vK6NBkCex9cZbROXqEBTOZPnAsWhtpRg0hfzhedCcpcgp/SU5M7buxV6+4WL SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2018 19:31:30.0806 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d62b7614-08ba-4c84-fd8c-08d5fbd33668 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB4290 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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); -- 2.17.1