From patchwork Tue Jun 11 12:25:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erwan Le Ray X-Patchwork-Id: 166440 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2293108ilk; Tue, 11 Jun 2019 05:26:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqzlmKuq0ijpp7Sln3b5UnNsmvuCqTdyK57ZvwaIw8ScW0Q/Pmw1d/AO/+Bom2LYExVOKXdA X-Received: by 2002:a17:90a:3ac2:: with SMTP id b60mr26970369pjc.74.1560255962323; Tue, 11 Jun 2019 05:26:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560255962; cv=none; d=google.com; s=arc-20160816; b=iEpla5QdZZ32ja6dKSH+9r1J99683fi70MENCENY+qyoG8c78pDeGVPMFWu3LilXjJ ybrIXWR+Bp1z4CarGJVqVjRLWF0HZY6G+W+lBkkvrR1Hp0BDemrBGgwAkQaTq8kuuS/H uHqpCjo6OueNtgwIi3DM8JiXC0pWiWT8aHN3YA/NxHnOR3CMtq80CcoyqQ9m4UM8A3tO oFydlMLsbRgtg2ycjDqK3+Jh6iv01ExfsPOzxEnlVX+++TWYiWsmJqAko60knxzkjhJK 6IkOK++LN1jfUnMGKylusX5hNLXvGf9ockA79vW7y0yu1DI989MGPf8MFRGfYKl7EpoO DI8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=+tBAzKh5NWz8RSislFiiFnxAw1b4w/qgIfasnJAmxqE=; b=PAXHnaE6N3cJSlcRAyNUxBCa0uXd/2bHgMAxDCDu+Pkw7t4g83yg6qrSk5azhdIKGS WC2c3F/nEb2Chf+xg66pidE9gzV5Mz8/8prKc7hfB/h5QcL1Hi/UBkJZoImEHw6Ad3b6 oYQ8gse/uOsZ7g9dYIS4JZhpMuMogcZNnkWKcoLnaXEBRsjzInYATZbBLkOrI47BDmV3 nRZ4fsrxqCKStzCVTFGJFYN6t5t3kDzck3SnHoNpNvoRuWpmvYPJ/xF0egnlndHMHvtV USHFzAkWCri5aeCiQ+WsVkGY3CAX8rtvs9tZPVP8QsEogbnMBKuOF4ckv9Fjwhj3ahag 9kug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="hvmhREP/"; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-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 f16si2559201pjg.50.2019.06.11.05.26.02; Tue, 11 Jun 2019 05:26:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-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=@st.com header.s=STMicroelectronics header.b="hvmhREP/"; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389224AbfFKM0B (ORCPT + 1 other); Tue, 11 Jun 2019 08:26:01 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:40690 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389611AbfFKM0A (ORCPT ); Tue, 11 Jun 2019 08:26:00 -0400 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5BCN52W024862; Tue, 11 Jun 2019 14:25:47 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=+tBAzKh5NWz8RSislFiiFnxAw1b4w/qgIfasnJAmxqE=; b=hvmhREP/wGNx0aMqfeBIxCL3R2/0HEGPoTn7R5szKvDYR0V2/hj8M4QR4ZydBz1PFeXc sYknpctswIyM2vKS2ibPHVCZCold1xooUB5s9rSw5doBOikXih0AUD1cP5Z++NQtAQm3 iBEYuaAUDLok3TwjC9JKQgJSnDV5uTy9CyJ672UpNqkXCOX+lma+TDGtSLpQzxgX2aMG CC4ZKe34gxUTzCF6SWBEfyNCj2Ut8bZoVRmjkEhdhXm2kWLgxmvHhb7D9PCHMKuLRR0P JQf+RL0M8NHE/je0/KLJsUcDjywhTxlnTcx9NbA1hxAPPbeDW78CycbzomiM8J36asIo WA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2t26rjsva4-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 11 Jun 2019 14:25:47 +0200 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 0F81142; Tue, 11 Jun 2019 12:25:46 +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 E61662A29; Tue, 11 Jun 2019 12:25:45 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Jun 2019 14:25:45 +0200 Received: from localhost (10.201.23.31) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Jun 2019 14:25:44 +0200 From: Erwan Le Ray To: Greg Kroah-Hartman , Jiri Slaby , Maxime Coquelin , "Alexandre Torgue" , Rob Herring , "Mark Rutland" CC: , , , , , Erwan Le Ray , "Fabrice Gasnier" , Bich Hemon Subject: [PATCH v2 03/10] serial: stm32: select pinctrl state in each suspend/resume function Date: Tue, 11 Jun 2019 14:25:23 +0200 Message-ID: <1560255930-22554-4-git-send-email-erwan.leray@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1560255930-22554-1-git-send-email-erwan.leray@st.com> References: <1560255930-22554-1-git-send-email-erwan.leray@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.31] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-06-11_06:, , signatures=0 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Bich Hemon Select either pinctrl sleep state in suspend function or default state in resume function. Signed-off-by: Bich Hemon Signed-off-by: Erwan Le Ray -- 1.9.1 diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 9c2b04e..04eda75 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -1298,6 +1298,8 @@ static int stm32_serial_suspend(struct device *dev) else stm32_serial_enable_wakeup(port, false); + pinctrl_pm_select_sleep_state(dev); + return 0; } @@ -1305,6 +1307,8 @@ static int stm32_serial_resume(struct device *dev) { struct uart_port *port = dev_get_drvdata(dev); + pinctrl_pm_select_default_state(dev); + if (device_may_wakeup(dev)) stm32_serial_enable_wakeup(port, false);