Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1006527imm; Wed, 8 Aug 2018 09:11:04 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwaJ/V+k63Gq37Ezvx0RzwEMCRsX40acTNw48L2HC0PSZyit22RQ1y9UXQ0JpxEf9tBa5un X-Received: by 2002:a63:8341:: with SMTP id h62-v6mr3081521pge.298.1533744664404; Wed, 08 Aug 2018 09:11:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533744664; cv=none; d=google.com; s=arc-20160816; b=joiC/ZjlC8yBRQinMzAk9yGjdqWLaCerrtjc7TEeofsQAFuW5PNP/zpYD4t+HMSUSu k0a8gCyYWeIsC8LxuiiBUP2AwR08ulFZMs6s140ILqmzND8EIqwrNdsUvPUTSbPwSH3z 7vkh3sfEqWmiIZvBMq9LKlqaiL3cvn9TepysJqhWAWI36/db46mAcGD+i5w9UwWHmw1B H55aj0Eh+2Khq8RyDzKO7JclDvI1CXxS5qW3AiFAonCYmDRuBzs2HwAsTqaLnN+Wwz55 dYNF0fGyKDu3mSgILeXI3XaHRWbKH6QLBt/ep0xItvD12TI/+A5g3gQ2rYRl/2zZjEkW hRWw== 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=6my6uAMqziLxxqG1qIv87gR90N+afLl9bRdXzQVqn+I=; b=mM0fmKOdfuq56UOTZnDn6iov3H8BM4R/HFa3mLXjPFDjnNBZRjdWlhH6sw4uYH/pOB spG4cZssK7v1ojptwHKwOUjEm82l51y9JMCp7Sj2kt2Pad8zbQefVzzLxdNXzAbjQxIu SVwBFiS6Sc+06Bz1c9zUv45WahH4HMc0+G+cvLZHiDp7xwH7UbIFr9TF28zh+X1f/Eow PaUVuXrcsFj/HieEptSb8qURiZK6cs9vmT+b8pBazHGXO4cy6Q08wRrwHMigN4DyPbiZ RW+rNUARJdbhxyUIcWa74fBSedQduMr6Qb/Hsj6hv22JSeG5wF8IZZW1gg+6xrvrOuNK EULQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector1 header.b=stvjihHH; 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 k4-v6si3407965pll.456.2018.08.08.09.10.49; Wed, 08 Aug 2018 09:11:04 -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=stvjihHH; 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 S1728424AbeHHSaD (ORCPT + 99 others); Wed, 8 Aug 2018 14:30:03 -0400 Received: from mail-eopbgr40068.outbound.protection.outlook.com ([40.107.4.68]:40736 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728030AbeHHSaC (ORCPT ); Wed, 8 Aug 2018 14:30:02 -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=6my6uAMqziLxxqG1qIv87gR90N+afLl9bRdXzQVqn+I=; b=stvjihHHFoLdCruW/mO5xvqEM401we9eq7Gy1Mi9FMQRqgr4UbbZKBodIHzHM4dbkSi+CFMo6FpQHPXfHLcenxO50Dta7MPpn2lMQpu47wRtNad5sIDkdDgqJbhNJebH0jPHHPiK8sk3QjEJsJ3aa2B/R8+K7oNk6s+TXorzZeg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; Received: from localhost.localdomain (95.76.156.53) by VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Wed, 8 Aug 2018 16:09:33 +0000 From: Leonard Crestez To: Stefan Agner , Marek Vasut , Shawn Guo Cc: Philipp Zabel , Robert Chiras , Fabio Estevam , Anson Huang , dri-devel@lists.freedesktop.org, Dong Aisheng , linux-imx@nxp.com, kernel@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH v4 4/5] drm/mxsfb: Add PM_SLEEP support Date: Wed, 8 Aug 2018 19:09:01 +0300 Message-Id: <3559b9b99a8a48042ee468034e5f1d538ffbd081.1533743954.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: DB6PR02CA0004.eurprd02.prod.outlook.com (2603:10a6:6:15::17) To VI1PR04MB4301.eurprd04.prod.outlook.com (2603:10a6:803:3f::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b84b282f-d218-4bf0-f1ad-08d5fd495533 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:VI1PR04MB4301; X-Microsoft-Exchange-Diagnostics: 1;VI1PR04MB4301;3:jX6pmXQTFslrxamkqUQx3DaCijsu2h1PMDq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uCg1QlkCyfN2HxaU6SVpup2JpAZ9kxqrY4+mV4kOrfVd2zVce0LZZct5SfbqiIfT+GOUKrdyqQSbgRC4tDoms04clhER6j2dyXylyBglfRAoY7ILZUEMmUc0I8Wid8iSqdiaHT8nZmk2EcsbjaSvFh5jLWp0d5m9UYTVOfDYMLBYH6u/eg/A0mC7N0Lxk6McjCGUXv20heeoiMJUSpPmFRf7YpMXjqVFVMo0fFOiSmiQ1lRADcGAQvtESWUv+4DtZ3cpc2aEFLO/PiRm7R3fv2Ot3GdwZcQShWqaAtbQnrRTQ+gTZiwq;4:mjVFuRImG3k2vkYd8UkJQAgHYMXIaaFFjqsAbRWfwoSFjLXf5trglUKG9rsp7knNTOkyO/oRWETY4qeD83HiHPISelJmIHfdxW9gzpoxdQZYP7/HVhUB1jOknFcYiT9uvnPY0BmOp1D1jAiKD/RfRJgMiiof+B+ZB4qfKCxY/XyKgy9dj36TeuwdCEMCZuPo6eDgZw+jUbj/6F8oPl46XHa42gYJQgM/GUOQdK45EodulBKnNmPRvGHpHIyzMftz/xnLfsW14KW64M1q0cU6t4hd6MFpMcYyFYbbDoScjTv9gF/DCq+tRgE/uHpXmaTr 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)(3231311)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:VI1PR04MB4301;BCL:0;PCL:0;RULEID:;SRVR:VI1PR04MB4301; X-Forefront-PRVS: 07584EDBCD X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(979002)(6069001)(39850400004)(376002)(396003)(346002)(366004)(136003)(199004)(189003)(66066001)(7736002)(76176011)(47776003)(6512007)(81166006)(68736007)(81156014)(25786009)(8676002)(6666003)(110136005)(54906003)(36756003)(14444005)(305945005)(106356001)(105586002)(53936002)(50466002)(6486002)(97736004)(48376002)(86362001)(4326008)(575784001)(3846002)(5660300001)(26005)(486006)(16526019)(186003)(316002)(2906002)(16586007)(6116002)(6506007)(44832011)(478600001)(8936002)(956004)(11346002)(2616005)(50226002)(386003)(446003)(476003)(51416003)(52116002)(118296001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR04MB4301;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;VI1PR04MB4301;23:gXc/v81EvW1lWIVbVkKoy7/ohBVA+eVilb4GLycYT?= =?us-ascii?Q?nmtRTKwN2PADGxiMG0WrSclDq4V0x0XNyl8qEANlFIpR0aNvPZX4Ke6hRvW8?= =?us-ascii?Q?RFEpwMgzuTa/uP7RgoMC58vy0nYNDGhtaaiiMS9LusAK23vyz0SuMzKg0YmK?= =?us-ascii?Q?WIIPQkyJmfWYEZdH8gsQ3mHg0te6EjQXcBYKODhQaUVxLTG2oXxn05lNqdcZ?= =?us-ascii?Q?vXNn8OQ7F5j9praP5zWn3VVJw02DFRhRzRENRH2lJ6gcadlWQJxyGIg8Huj0?= =?us-ascii?Q?vXSNFimcZz5OQF12N/vPv5Cg7LOUfJDio2h1+C6FJGtMpn5VueTeWmjZUfBl?= =?us-ascii?Q?Jm/tcho7CIA5vlExl5YZBc9Jel/PUXflazjUFMJchU1lViNkVi70LSHhyVj1?= =?us-ascii?Q?13282IkNghPt6FPmA6ep2gxpKL5WRMZA4RxEcs8/yh6xr/J7jC4qlTeCHZ1X?= =?us-ascii?Q?5tvjsC3Mzs0P0qFY9g30xHIcOLaly9oGRvC6aAGqpKsYgIbHDHn2BsgI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z+VMxQmMmp47YBrSbdrpq?= X-Microsoft-Antispam-Message-Info: 03gRm8Oky+VmGSO1z+oKq5N6p2E40AM4G6MNKpJrDqQxB9mS7mnUmkOrej4LhtnYPJhf9bJxt/tJHl9nlLbB/wKIr8gs82enES+GQV7WyqGEnKcE9y8VeFo6Vk0vplPJBWxOSmnsdlagGcjBk1mc+dkMw09C2dV6iOZv9bWgjcj0JCbWvqfx37q3+/7/DEOdS4vGztewaF+ZH+Rr7nvg/+jt/LTIVGLef+tOzzI8FPrAnFQPcHGt1TGr0NKBYwi0pDhcJJlQWwWU9dEAaPj3UhhLXm5lJWoqILfrQnm0WGg5Qhhy5X1yAalhsUoIhr3j5b9rxxWKyScLi1V/W1irQhYKilYP7NdXXw4IwPvJRxg= X-Microsoft-Exchange-Diagnostics: 1;VI1PR04MB4301;6:9mRgg+sJ0zM73jFlmub4IHvfZqJe9Rh//tTawfhcunCucqoMgQcYrAcUADAXOU2LMe3j2E4dRdswpVZIHBbOOspy4pXpJFKKQ2cUuROULGlHkWNCinyRmJs92u5HS5G354161SUmifP79/PFOCho2yMnuM/A7+cuFripwbgYkTWQIAKoDU5xidKcVd5YUAtM1l09lK7ouMBy5wHfWio/aYRNi9qmTULs2qmH3vG8bxaRwlQ7VTv/x5phekm6g5ugrLZSUCp/ihcjBXO1OCBM4pFkqkhB6D+TJIDqa06cgEbgn5VlrEtpp/mnhW0ezDpeuYVStlTYpkRkDSN5oxdAhIiS73irej/UYHePT8oqIke9KgIuVxMd464uvM9b/CH8I0wJC28UvMbygNDTk+Dnl4+y/+YXLQliut51YedIt3KcD6HXqpCp399cdkbzf2KQow4yBqQxgZeStMVBZYqVTA==;5:AxLlDEpyEmihhayK/kxK26TUGGlf4bsIu4YZbUEyqnH9EwQVu+9CRfvQTD6l+p5VO5BASH+h2KIVreGauJdEByHbrTk55zlTMV7rnfdxUmAxfrYn/B3huECBf4cY/EjLToAtiaucd9w3FkRdrTxNzqCAVUILanluTMXJgzoz034=;7:gPM+XmeYtGtat6WYqmgqf426tiNTY1tOLHGlZuKEhtVuirVTghb2aQJ8qM1tXJv2q0tmuGa56TxLK0dTAEr6rmfcv1joj9ovmcMaxnFeuMMAG+OOpLl9oTEsF4b/zCzyfhNmsi+3CCPieM25ROi10rs/d3NmgAcTcAOJ8kZ6YP8161D9hY5oODTtvuECISx/WUcBFwzUU8kLau/9UrGmfbXbtWqM/jk7VFSY64q3N1q/BZc8Zb8HeBX5q+w98jZ+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 16:09:33.3731 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b84b282f-d218-4bf0-f1ad-08d5fd495533 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB4301 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 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); -- 2.17.1