From patchwork Mon Aug 27 11:10:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10576983 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0EB2517DE for ; Mon, 27 Aug 2018 11:13:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 000762972A for ; Mon, 27 Aug 2018 11:13:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E722B296F7; Mon, 27 Aug 2018 11:13:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 643B3296F7 for ; Mon, 27 Aug 2018 11:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=K7Dh19SvdCL/CJKTomm4LZHmg5ypFiD0lpEjQMPDj30=; b=Z5/nivFrabzti5 f4l6OoQTY+VtDWKWxiIqIDsPOaBWDifBs+hfxE4QS3LaCywGjDdwqhTFuBzqGeZKHxB0X3eJrAb7N Xq07lU39eLfpyhsP512334H9QQC5pPPhDZsMEX1kOQBwnY4BG6YomTDZFV3IU7cb+r6uQxDgw1hKj ssq1INfKEAf2ZUaY00GeNMldvTBa+tAxq9H1UN3nY54mr/K0KE2GXsFyu8/hc51Ch2GML79P7dUC5 yQTwkGnYGJ5at5PEUHAI3JaqKJubkzx4yhSc0pgK++14KcsOhnEB9BjBQNF7hetTop+DT8G7klPR8 y6Rv+I5iE57GaLjLVyxQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFSs-0000E4-0L; Mon, 27 Aug 2018 11:13:46 +0000 Received: from mail-he1eur01on0088.outbound.protection.outlook.com ([104.47.0.88] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuFQd-0007gC-EO for linux-arm-kernel@lists.infradead.org; Mon, 27 Aug 2018 11:11:29 +0000 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=6my6uAMqziLxxqG1qIv87gR90N+afLl9bRdXzQVqn+I=; b=EBO4dTKykZN1i2b0ONTDIW7Cs3tXzdIAYMmwyzyMLkP0UVBlnJr88ut4O6okv4FCG+sCZi/XLJiY0vvAaZ7+Unv3KFruC16t6j/tDdllShZ5msOx6U56Y4KwBcr8C6VObjzCG+HJunRzh3AIUscercvIHtP2eV+i4RFUAwSg18o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; Received: from localhost.localdomain (95.76.156.53) by DB7PR04MB4297.eurprd04.prod.outlook.com (2603:10a6:5:28::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Mon, 27 Aug 2018 11:11:11 +0000 From: Leonard Crestez To: Marek Vasut , Philipp Zabel Subject: [RESEND 4/5] drm/mxsfb: Add PM_SLEEP support Date: Mon, 27 Aug 2018 14:10:40 +0300 Message-Id: <7d661819825a36f4aebe412e7bed8fe24c7292ae.1535367027.git.leonard.crestez@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [95.76.156.53] X-ClientProxiedBy: HE1PR0802CA0012.eurprd08.prod.outlook.com (2603:10a6:3:bd::22) To DB7PR04MB4297.eurprd04.prod.outlook.com (2603:10a6:5:28::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15917ca7-ec2a-4bcd-70f6-08d60c0dcd3f X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR04MB4297; X-Microsoft-Exchange-Diagnostics: 1; DB7PR04MB4297; 3:i57l5Il3XzR3jU11c+dWSMEuJkvFzM6E2uBxxWvjF3ciajEPAXY2RvYsOSWpKK8xz5KPFzuJJmXQjqjyUviz4K4WZJRtuOW6hE2O3HTN/fE0yaaO8H41haZ2Qacw3ZfRDctoUkiELjJhx4hLOvC05+2JqF0RyTZL0xxvbLiLrirAr58dmmxm3CaI35YxstACv/a2gMc7zF4/kTYhi9Opx0NDDlc5Hn5VN+tz6SS9jaffPoaZclaiV18KZgc/uczk; 25:zMwwmZTfaN/5PuBfQ4b2RxA8zqj7Bpk9Dew4ORCfU25PbTUl6lrrpo+Ymky6m773myAtJcTvvVwv/4ufErsHHZdU+ix5vroshDPn/FG1qB9dY6KWQw2hHT9FKJ2d4gJHlpL3GygnAM5GGGmcHuas2fa6mSIa8G6aZOS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G+dphT1f/q1OtiCeEeBoM3W8K1TNQ69UE/LvpG/ZncbkoYhxdNjvOmAdn7xvGPu8z9oKXe/2QO5GWTIGoG7v3w+n3sLDVaGFuPHvwkPm/IzOEMkOTUWh11HNd9GFxrLUOdg9VwtF6JkKVxEpL5y/hL3K0Nhg3yhXRitDVfkbzfq3l+UjMD1wH/T3Vkb7PZlnI/+wrgb8cWd4Ll0THIUBF6cTczvVXB4mh0xt+/bmjTMXmbmhS7NHBEP23ryPyH1ZbHaEF 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)(823301075)(3231311)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699016); SRVR:DB7PR04MB4297; BCL:0; PCL:0; RULEID:; SRVR:DB7PR04MB4297; X-Forefront-PRVS: 07778E4001 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(396003)(376002)(136003)(366004)(346002)(39860400002)(199004)(189003)(4326008)(305945005)(478600001)(6666003)(2906002)(36756003)(446003)(476003)(2616005)(956004)(81166006)(8676002)(81156014)(14444005)(44832011)(7736002)(486006)(11346002)(3846002)(6116002)(47776003)(6486002)(66066001)(97736004)(575784001)(86362001)(54906003)(5660300001)(53936002)(6512007)(16586007)(110136005)(316002)(50466002)(48376002)(50226002)(118296001)(105586002)(8936002)(106356001)(51416003)(186003)(26005)(52116002)(16526019)(6506007)(386003)(68736007)(25786009)(76176011)(69590400005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4297; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: n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1/c+Cc8A0d+eJjYFvM9VJeJAwLdyvM/jrDf9J9t5OLx60yb/wGnrxVtwVMjLeOkILgECceJG0OFbDdXXH/q40PCLAjJIgAPNPq3NXbmmY2eqlm/fv3YVXVpZ52y0gD3+FByNUdAibcKy7OwvXnH0IkkxyA==; 5:TERZOpwKpZmyvel43CcmQmpP2rdG0n8KxGFZ/ze42w9HrIjmtAJiX0RZbzA+OiBux6YjeURk1TatDvjpXOII1A1E9h/8ivdcSRbtyZAA4si3kqfV1zc9RjF8EJ1DQXk3ig/QqzCuQZDpbFGAiqW2jp09MquUFF8MKNuwjdilxNM=; 7:Hj4jZabZVyLKB0+z0wTdO1w2Nfyxm1Fkzl5dFoA/jyVfA01vmgprKP6/3t4PpXNhBMnOAa9H6XyWbmY6d1/2DALwfndzh27aOwJvLzNRPTeyJU7soy4XOhJjK8xSUREZDVkbDbE4Afwmaejy9alIP8mctflWCQMzBjJO0pkDjYR8+huCMLCwuRB9RvP/zEW2LLelmE8QDhrG0RkFcL1KaBiU8IoVtNFZIVqkp3cKj/p5ov4MLzVTfVjKaZ3aTHWt SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2018 11:11:11.9136 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15917ca7-ec2a-4bcd-70f6-08d60c0dcd3f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4297 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180827_041127_563440_03FF0359 X-CRM114-Status: GOOD ( 11.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dong Aisheng , David Airlie , linux-kernel@vger.kernel.org, Stefan Agner , Robert Chiras , dri-devel@lists.freedesktop.org, kernel@pengutronix.de, Fabio Estevam , Marco Franchi , Shawn Guo , linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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);