Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp442064img; Thu, 21 Mar 2019 01:17:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxxM7LmzqLgtYknxsHYYsUshBEWQHfRZZD+pEYcgYONvw/uDVUj8UGFP9SKt/hIn9HEXeL X-Received: by 2002:aa7:8c8b:: with SMTP id p11mr2129795pfd.171.1553156227351; Thu, 21 Mar 2019 01:17:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553156227; cv=none; d=google.com; s=arc-20160816; b=IE1CDNQP88gedeLa4p32chBIQNA3ncUr6e50asU1gtRst0Zts2mKFjS7AKMa4Vo3o5 CABiV3jfvo5ODbBWlz3cJiq3D6OTYss0VMrNVb3cxAImWcrWpaZxNqQkbe1wx8dA2g6O g4zwWUiufocDdFu6FrXCbC9ZDZB3wFjix4LaAmrS7X6w/dez/DbJIQ5Crd7waASYE23B 7BoGfZL/mxitWWagegrywiNmnf1b9HZsFbssKWQFIddB9oBN5xy7ultEGoKMZHnPXIF9 0D8GHCtANXsXcJE/I69MLA48CplZsB3Bg2wsWDtxd4FCZhjx7rgM3zfPbdb0QUrDcmxD JiUA== 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:to:from; bh=cYXWKshLsSGUsSQQrcBsuTveKaDT1c/eLZqa8+KnTeg=; b=iVqoGXJqruPULqrb8Bdt6rlNRDbgDiBIUA2OBKWupu4JogvwIpkDmKLrJYLCJOCstL OWE2kxT83GMFeRITchquRlb5uNR25t+bvMq5AbBlBezOHvQ77gbadsBRYLLyBw2M/qLW Qf6bMxgF5HUcSTXjgLYkQtMtAyvfe9brcm74bG8unC70mpQjhYUqHwMupx4ny1sx8Beb ymy2ZMeQNaqd4zL3GYjo20vcsbXDnWN+GxggMkNj2EIXJqniUtXqqfvfJelX0ZuVxkpP MRX/VDFUbVHZ6u+nZ1GOIsfs4emmA9nQhPtSoUxntjAQeyLF/GBwxFcI4gYI35PSzkj2 S4mg== ARC-Authentication-Results: i=1; mx.google.com; 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 y1si3662264pgf.32.2019.03.21.01.16.51; Thu, 21 Mar 2019 01:17:07 -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; 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 S1728002AbfCUIOV (ORCPT + 99 others); Thu, 21 Mar 2019 04:14:21 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:26630 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727823AbfCUIOV (ORCPT ); Thu, 21 Mar 2019 04:14:21 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x2L8D6MY005365; Thu, 21 Mar 2019 09:14:15 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2r8q5bmd42-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 21 Mar 2019 09:14:15 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4779C31; Thu, 21 Mar 2019 08:14:15 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 2AA0A24DF; Thu, 21 Mar 2019 08:14:15 +0000 (GMT) Received: from SAFEX1HUBCAS23.st.com (10.75.90.47) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.435.0; Thu, 21 Mar 2019 09:14:15 +0100 Received: from localhost (10.201.23.97) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.435.0; Thu, 21 Mar 2019 09:14:14 +0100 From: =?UTF-8?q?Yannick=20Fertr=C3=A9?= To: Yannick Fertre , Philippe Cornu , Thierry Reding , "David Airlie" , Daniel Vetter , , , Subject: [PATCH] drm/stm: dw_mipi_dsi-stm: add sleep power management Date: Thu, 21 Mar 2019 09:13:53 +0100 Message-ID: <1553156033-13792-1-git-send-email-yannick.fertre@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.201.23.97] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-21_04:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implements system sleep power management ops. Signed-off-by: Yannick Fertré --- drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c index a672b59..1bef73e 100644 --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c @@ -356,12 +356,40 @@ static int dw_mipi_dsi_stm_remove(struct platform_device *pdev) return 0; } +static int __maybe_unused dw_mipi_dsi_stm_suspend(struct device *dev) +{ + struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data; + + DRM_DEBUG_DRIVER("\n"); + + clk_disable_unprepare(dsi->pllref_clk); + + return 0; +} + +static int __maybe_unused dw_mipi_dsi_stm_resume(struct device *dev) +{ + struct dw_mipi_dsi_stm *dsi = dw_mipi_dsi_stm_plat_data.priv_data; + + DRM_DEBUG_DRIVER("\n"); + + clk_prepare_enable(dsi->pllref_clk); + + return 0; +} + +static const struct dev_pm_ops dw_mipi_dsi_stm_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(dw_mipi_dsi_stm_suspend, + dw_mipi_dsi_stm_resume) +}; + static struct platform_driver dw_mipi_dsi_stm_driver = { .probe = dw_mipi_dsi_stm_probe, .remove = dw_mipi_dsi_stm_remove, .driver = { .of_match_table = dw_mipi_dsi_stm_dt_ids, .name = "stm32-display-dsi", + .pm = &dw_mipi_dsi_stm_pm_ops, }, }; -- 2.7.4