From patchwork Tue Jun 11 12:25:21 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: 166439 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2293055ilk; Tue, 11 Jun 2019 05:25:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjMoT/593AB6qfdxVPsqQBKS579HbDgBTZV1ybMswUvxNx8V8ohh5w4/BFOy3fB3ixFccM X-Received: by 2002:a63:1919:: with SMTP id z25mr20514869pgl.440.1560255959246; Tue, 11 Jun 2019 05:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560255959; cv=none; d=google.com; s=arc-20160816; b=Nv9ewjvp6OWvvL5obxKGC17Mrhu3sSH6wgP5uuSO4bY5BZ1viLn5yMfNUh+b6KULri Lj4fTDSwJOMfiSMnBk4WvEW0qgmn+Z4NUfLAaHTRH1BjCq/ZKGvCuWqfLHffXphGFNqi TPVekidWVFKShlfr8c2mVHacopxlifbANNI7GoN6K/c0Uv802PTxHgZkJPvPQgB2pfRP WtebyOX5KxhdwRG7Km3lmxp7jx/F8AF9RfDlx2Xeufx3LoeXZGgbUIfKjJRh/juqj1fH f8i85juO5Txz49qjAZS4GZPkVeJ/xQgNUsMmkb8qEsE/qM0BR9eBMApgKtIaKpx2FuJC AWZg== 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=9gSGjqYoy+Fbf2xPESzbOyGUbO7HOvEvjLu/ZOx6/bE=; b=Ji3zbcKOokvwOzTtt28T/r6ibYAKZUQ5ajWWiamZVJzuBuI6wNyHG4O+md53DnOAQt d6r7lTJ26u96swz83cupYDQji280YByRH3q27aO9lyR4r+WlSTj3tKm35sah3WB8PDLT szEUuc4MP4IISytGuhjGVEANya2qaqgFwt4d2VpcmXLww/uOviDS+FJteix/DTn0ega6 jtm164z/L6Wgdc/jePO5/ztuhUNQqzG3z4JTTocQ+PqZ32KO6+zsfBPyeIFulSxiernB o2Ias7QTJlXfGcojscRjZteyTeu1CdfJQqRtwbXKZmcdO23oWMfemaA3+kf1bHzdKlTO uIgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=vfqyNEAR; 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 f16si2559201pjg.50.2019.06.11.05.25.58; Tue, 11 Jun 2019 05:25:59 -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=@st.com header.s=STMicroelectronics header.b=vfqyNEAR; 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 S2389605AbfFKMZ5 (ORCPT + 30 others); Tue, 11 Jun 2019 08:25:57 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:49129 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389224AbfFKMZz (ORCPT ); Tue, 11 Jun 2019 08:25:55 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5BCLjBU023743; Tue, 11 Jun 2019 14:25:41 +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=9gSGjqYoy+Fbf2xPESzbOyGUbO7HOvEvjLu/ZOx6/bE=; b=vfqyNEARQmrgEmlmrqcuJv1pPBpIuYiWyPUO4H+t3g7kW7GBkM+Aq9xLaoNVfJuL+/FB ruoP07PfJHd1IzS0Lx/NxijwEUgohe+fsAMp1MxiSLYBNsTUYTFojV0tkjxGjvahR7vH sIQarKE9Y86DZQWCdRC48035eIYq0niGvvanYAIxfenDSy3o0mfH0VL2/JwdB150onnZ 8xUFJx70ld4Z1neM67d1d6R5N3S2cra6bQ56GMAMKCDhZQ2UH9lZE97gfyX0p5HjCUXD FMOnxu0ae9/5cInaw44RNuaXBpIFgGD1W6/3A6LGycJwNV2Is1j3zguC97rW7SMbrDfk 1A== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2t26rm9vbd-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 11 Jun 2019 14:25:41 +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 A4E6D31; Tue, 11 Jun 2019 12:25:40 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 80D442A2C; Tue, 11 Jun 2019 12:25:40 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Jun 2019 14:25:40 +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:37 +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 01/10] dt-bindings: serial: stm32: add wakeup option Date: Tue, 11 Jun 2019 14:25:21 +0200 Message-ID: <1560255930-22554-2-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a note for enabling wakeup capabilities of usart Signed-off-by: Bich Hemon Signed-off-by: Erwan Le Ray -- 1.9.1 diff --git a/Documentation/devicetree/bindings/serial/st,stm32-usart.txt b/Documentation/devicetree/bindings/serial/st,stm32-usart.txt index 9d3efed..5ec80c1 100644 --- a/Documentation/devicetree/bindings/serial/st,stm32-usart.txt +++ b/Documentation/devicetree/bindings/serial/st,stm32-usart.txt @@ -19,6 +19,11 @@ Optional properties: linux,rs485-enabled-at-boot-time: see rs485.txt. - dmas: phandle(s) to DMA controller node(s). Refer to stm32-dma.txt - dma-names: "rx" and/or "tx" +- wakeup-source: bool flag to indicate this device has wakeup capabilities +- interrupt-names, if optional wake-up interrupt is used, should be: + - "event": the name for the interrupt line of the USART instance + - "wakeup" the name for the optional wake-up interrupt + Examples: usart4: serial@40004c00 { From patchwork Tue Jun 11 12:25:25 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: 166443 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2293326ilk; Tue, 11 Jun 2019 05:26:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyi6j8EpCgr0/AEWlo+Sv8U64Kd3mg2MwkD4JLMmjgZsNIRPf1Z8shYvDBzgt4TIj42EBHm X-Received: by 2002:a62:7552:: with SMTP id q79mr60361591pfc.71.1560255974129; Tue, 11 Jun 2019 05:26:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560255974; cv=none; d=google.com; s=arc-20160816; b=wmS+FS+bHc+a8R5/GnZhU4qAZc0qPuU8cBSwymboUVebEJVLQKSJ2gj8pZ6AVwRdxO TpIg0im1NrhfRl8nUEiQ9hjTlr0itZa1uzMsUBuF2BQcDsH8qJJ23UpvAsFxb/8Br7QM 2ebuNf7CpyTAZNBxYkqM25hLCeFjBIpAmJZ4R47qs0cj8U9yRaHTtGCNjPsdDhrGiZKy 2Yk2sIZwbCTNJAwPi+9TiPAzndV6VUo1dku27vxZZvDZS30i/69ycXCAQUeAMPmRUrJS /L/kqeGHYgpGDZDt9+B8ho20fpDsWvX7v7HuFPL4Br6t4vQwEM7S2vCBx5h4y3vDFCOG oZLA== 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=q+8EPvTaJkovohssWYYhUuM4RMRQjz08eTtbGZ/5swc=; b=NA8aaX2n9XZy+TkBiMmNWXfxJ+0VuwedHvpLQdzsIGo7TVkWiNTgEgRlOIzPMiXkWC uQpPnE8CoKbs6ygKVRfKml6FV3dJGuH/1kqr1YvMj+1+vDWkgrwWnSmDgdshptLBmgRH CnWral1NyZlB7Sz0bbpBPvwGz65Qt4PjhQh+CK5CIzwSg5/tS2v1DVmRB16sx7it17iY anZXLHsn1NWsUxkoYi4rdiJR7HjuAlBHCFl47QDy+w9nmMqEdP2sNnd7trxXJodDYAOO dOOjxQ4dIy+SmwzrYmzhR2jzxsskD9F2lyffLlZWAPjeVstCgfgthLX3yvtunWgMzd07 Px5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=Ys4wns7k; 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 j1si12592166pld.399.2019.06.11.05.26.13; Tue, 11 Jun 2019 05:26:14 -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=@st.com header.s=STMicroelectronics header.b=Ys4wns7k; 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 S2390376AbfFKM0M (ORCPT + 30 others); Tue, 11 Jun 2019 08:26:12 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:13030 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389806AbfFKM0H (ORCPT ); Tue, 11 Jun 2019 08:26:07 -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 x5BCN2JA024846; Tue, 11 Jun 2019 14:25:52 +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=q+8EPvTaJkovohssWYYhUuM4RMRQjz08eTtbGZ/5swc=; b=Ys4wns7kv2MLHTcSdOYO6J36CL38mo3MAhvTgLgFlX8KqIsOR4hhzIPdER+H2iw0M8jU QUzxpvZfgPah0FO2XD8mDB8bdSOBB1NZAQ86Pdz9jfZ6Ve0zTMVyY9hPA3MICPwWi1kI WJll6Lda1t55etzTSab87mtsx6MDdUh/FgLRMJjr4fQ3eIEDqggJc8+RYZ5uwZqH1yme of6PD/CpVsnWI+orcq4uBQXDnkMep8GQHR9hSzz/HdA9THZPU3jpQxNX4nJ6QXJzD+cy lKKt1sEMw5B0FwjLFTyFKyykhLzfQ3Je6hOy8CSCxeCrgln2Tgk9Fv4AFiTnzLBsRnZu bA== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2t26rjsvaq-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 11 Jun 2019 14:25:51 +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 6162A31; Tue, 11 Jun 2019 12:25:51 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 45F772A29; Tue, 11 Jun 2019 12:25:51 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Jun 2019 14:25:51 +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:49 +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" Subject: [PATCH v2 05/10] serial: stm32: Use __maybe_unused instead of #if CONFIG_PM_SLEEP Date: Tue, 11 Jun 2019 14:25:25 +0200 Message-ID: <1560255930-22554-6-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use __maybe_unused for power management related functionsinstead of fixes: 270e5a74fe4c ("serial: stm32: add wakeup mechanism") 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 60f3faf..0d43711 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -1275,8 +1275,8 @@ static int stm32_console_setup(struct console *co, char *options) .cons = STM32_SERIAL_CONSOLE, }; -#ifdef CONFIG_PM_SLEEP -static void stm32_serial_enable_wakeup(struct uart_port *port, bool enable) +static void __maybe_unused stm32_serial_enable_wakeup(struct uart_port *port, + bool enable) { struct stm32_port *stm32_port = to_stm32_port(port); struct stm32_usart_offsets *ofs = &stm32_port->info->ofs; @@ -1300,7 +1300,7 @@ static void stm32_serial_enable_wakeup(struct uart_port *port, bool enable) } } -static int stm32_serial_suspend(struct device *dev) +static int __maybe_unused stm32_serial_suspend(struct device *dev) { struct uart_port *port = dev_get_drvdata(dev); @@ -1316,7 +1316,7 @@ static int stm32_serial_suspend(struct device *dev) return 0; } -static int stm32_serial_resume(struct device *dev) +static int __maybe_unused stm32_serial_resume(struct device *dev) { struct uart_port *port = dev_get_drvdata(dev); @@ -1327,7 +1327,6 @@ static int stm32_serial_resume(struct device *dev) return uart_resume_port(&stm32_usart_driver, port); } -#endif /* CONFIG_PM_SLEEP */ static int __maybe_unused stm32_serial_runtime_suspend(struct device *dev) { From patchwork Tue Jun 11 12:25:26 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: 166447 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2293676ilk; Tue, 11 Jun 2019 05:26:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxl+gN4p8ya1Fa6hpI2y4T9WWmpgTlaTX5OGwzKyXafdsa9l9pRFu8XIJEuFvTJHauxLk98 X-Received: by 2002:a63:f817:: with SMTP id n23mr12627478pgh.35.1560255994326; Tue, 11 Jun 2019 05:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560255994; cv=none; d=google.com; s=arc-20160816; b=lAGlV7THXfqBiuB0gMnAcHCEIoPdkAOKvxgg17vJSXk+zmBCOB3MQaafNRKo48b74+ pPCrpNn3aXz8Cdkh9luTu614gDfUdVGrE6DlEDEPbpduYL9YAG2lXf11DA7Wfm3vLBVO L9IARsyzTrOQ+o2byxsrAtt1CTe0Hv3j1b+mVA1iJlF2+06ccNVPttvXOGIAAK3o4xnJ 6RtalBhQ08VhCNB5OAMixNee29my5nl7X3fEVfI4YsIo6qtkfLUao2jnLhwXf/I4mqLO xaXNMBX2Q/+UL3pGrvNA0wk86YE2Rj7pH8h5WreavzG4g01knSD6DsuKxrU8L3Vtp4VU 7K6w== 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=c3Zd6dL5MxcQw3Ref30L3L2qWk7ypqOTnS2TbnWiQhs=; b=jvvtw4gejElFHRkhzrQEyYmwyroyvNgdTY6g5ElZ9zS2g43bd8kg7ZrbCRAcoiO2Lj Gxji98AiRiMOrWbPXcS3akhFapH/v7xX5bng+H6wPEdUOziYd0kxQCh6foeaRd9eQpvw eTYvYcg5zJZllXc788fGelYbqkPtzXx8z+oorXYZyWLLZ+VTypJYD9opdj4UlkRlo3A6 yz5dySGp7ak4J69hgNKtwSRtlGS/Mra/jRf/6ukY9GYxJ1gIaJhriPx92PXbLPzY40Ev GNzTkmmuDJckIgmYT+SKVzCyFsIENpDXp/XkEqyvnbT1whgIh3f7cjLYy5kWUcRvmoBa q8+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=dn7XWWvD; 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 d8si12593725plr.260.2019.06.11.05.26.33; Tue, 11 Jun 2019 05:26:34 -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=@st.com header.s=STMicroelectronics header.b=dn7XWWvD; 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 S2390437AbfFKM0P (ORCPT + 30 others); Tue, 11 Jun 2019 08:26:15 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:40614 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389955AbfFKM0K (ORCPT ); Tue, 11 Jun 2019 08:26:10 -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 x5BCN52Z024862; Tue, 11 Jun 2019 14:25:56 +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=c3Zd6dL5MxcQw3Ref30L3L2qWk7ypqOTnS2TbnWiQhs=; b=dn7XWWvDTODculAnfPxrB/I8//viPH9zF49Oi90oJikmQJNGnR1t2ehttAPqWkXW/jKn j0x/wKUiaB78X6bBmJuqEENfTJIwh8tzuy64EehqFjwbGs+pHydLW3bymhkvR3g3hEaK a6liRryndHFtdwZogYPkEMMzxUhOzAFiud8eft8qHQq66N8hGzdSV/CywU5IpJTfxHkN yAerKdaUVr2kqbBdSS9R2gEj+qkk5oAjItQ0Pkdb1pqoDLp7ZEjDZx35Fji8Z3w2/1BR 1CRcD4KtvWQTuuooM789QlccXgGLLmqlVaqMbre8jzUpNjom3nWf01G4Qv4+iMm3Ithv 5g== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2t26rjsvb5-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 11 Jun 2019 14:25:55 +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 E91E138; Tue, 11 Jun 2019 12:25:53 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas21.st.com [10.75.90.44]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C74622A2C; Tue, 11 Jun 2019 12:25:53 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS21.st.com (10.75.90.44) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Jun 2019 14:25:53 +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:52 +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 06/10] serial: stm32: add support for no_console_suspend Date: Tue, 11 Jun 2019 14:25:26 +0200 Message-ID: <1560255930-22554-7-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to display console messages in low power mode, console pins must be kept active after suspend call. 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 0d43711..00e4d7a 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #include #include #include @@ -846,6 +848,7 @@ static int stm32_init_port(struct stm32_port *stm32port, { struct uart_port *port = &stm32port->port; struct resource *res; + struct pinctrl *uart_pinctrl; int ret; port->iotype = UPIO_MEM; @@ -879,6 +882,24 @@ static int stm32_init_port(struct stm32_port *stm32port, stm32port->fifoen = stm32port->info->cfg.has_fifo; + uart_pinctrl = devm_pinctrl_get(&pdev->dev); + if (IS_ERR(uart_pinctrl)) { + ret = PTR_ERR(uart_pinctrl); + if (ret != -ENODEV) { + dev_err(&pdev->dev, "Can't get pinctrl, error %d\n", + ret); + return ret; + } + stm32port->console_pins = ERR_PTR(-ENODEV); + } else { + stm32port->console_pins = pinctrl_lookup_state + (uart_pinctrl, "no_console_suspend"); + } + + if (IS_ERR(stm32port->console_pins) && PTR_ERR(stm32port->console_pins) + != -ENODEV) + return PTR_ERR(stm32port->console_pins); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); port->membase = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(port->membase)) @@ -1303,6 +1324,7 @@ static void __maybe_unused stm32_serial_enable_wakeup(struct uart_port *port, static int __maybe_unused stm32_serial_suspend(struct device *dev) { struct uart_port *port = dev_get_drvdata(dev); + struct stm32_port *stm32_port = to_stm32_port(port); uart_suspend_port(&stm32_usart_driver, port); @@ -1311,7 +1333,19 @@ static int __maybe_unused stm32_serial_suspend(struct device *dev) else stm32_serial_enable_wakeup(port, false); - pinctrl_pm_select_sleep_state(dev); + if (uart_console(port) && !console_suspend_enabled) { + if (IS_ERR(stm32_port->console_pins)) { + dev_err(dev, "no_console_suspend pinctrl not found\n"); + return PTR_ERR(stm32_port->console_pins); + } + + pinctrl_select_state(dev->pins->p, stm32_port->console_pins); + } else { + if (device_may_wakeup(dev)) + pinctrl_pm_select_idle_state(dev); + else + pinctrl_pm_select_sleep_state(dev); + } return 0; } diff --git a/drivers/tty/serial/stm32-usart.h b/drivers/tty/serial/stm32-usart.h index 30d2433..050fe04 100644 --- a/drivers/tty/serial/stm32-usart.h +++ b/drivers/tty/serial/stm32-usart.h @@ -255,6 +255,7 @@ struct stm32_port { bool fifoen; int wakeirq; int rdr_mask; /* receive data register mask */ + struct pinctrl_state *console_pins; }; static struct stm32_port stm32_ports[STM32_MAX_PORTS]; From patchwork Tue Jun 11 12:25:30 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: 166446 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp2293565ilk; Tue, 11 Jun 2019 05:26:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqze93Vf4Zza5KpiJssHci2gaDxRqQnkNPHzyikRjbtRCtYcZgIVARWRUsiDOW+AUY2OuNYp X-Received: by 2002:a63:c09:: with SMTP id b9mr19920175pgl.241.1560255987887; Tue, 11 Jun 2019 05:26:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560255987; cv=none; d=google.com; s=arc-20160816; b=ZmaHEq0dUmgy8tfWfbUQbdlZ6g4X2fiuCnmyaU4xcWXEdRBjUBpzwahg14Ujm9ubLU JOX4lVetzvWUGQpjqF05NLxsYvVE99bXrk+ClS0sHwINIv1cq5MDlULOU+tE3S7cKU7G Q+gKdsv9ibqoE5Se6bPiyO4Xs+bq9+FNsVmSMGGHPS5rU8ZWC9ufaBB7Gx/4uqTq7jkM OEU79vShZ8FwjcxtWWOYdxLOWJ+XiWeuCOe2ilpSWn10ub8gIfEXGnZ9vd70RcaHGLZT tBblPuGpAYPIenwFYxA4NQdUduEM/d5NREKwHg9364mN/Rut+KqfG1OG0UukGpKzv2vA D3Mw== 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=Bc+KS/X3joAnx5lC8TCpo/aZhNkGuBuIX5CpxV56wqo=; b=Vh4CaZKG9NDvzYMLx6u8igFM7LgWSeBI8U6jdt8w0TV6M782LbWYuN/gI36F8ZGqlq m+0DUj1Mo2eun0g6xoUj5HIXKyIQlVXueWTDZkF8v1gI8oR7imh2mMh3D1Hw8B1juZ28 HLtVXi6oeaODBXwv02VUTnnlzWpigPyiNZd6lrdD4eb4yl6kkD8qLse/sYCjXBaw0yH9 nGaqu+0ZA/o95DmrcldTdAIEpgjS+1zFi7Eb6je9qBg14wPGQymDL2UvTfp4swIbc1Qw AMjWpXeq3oW0JKqiwRuRcLR5M5gBz+/Owb8nsAJ/mmuFe0dWGsCxC2C+pFcebDaDhXh6 fn3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=xEI5FhZF; 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 j1si12592166pld.399.2019.06.11.05.26.27; Tue, 11 Jun 2019 05:26:27 -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=@st.com header.s=STMicroelectronics header.b=xEI5FhZF; 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 S2390589AbfFKM00 (ORCPT + 30 others); Tue, 11 Jun 2019 08:26:26 -0400 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:48925 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390459AbfFKM0S (ORCPT ); Tue, 11 Jun 2019 08:26:18 -0400 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x5BCPlkg026682; Tue, 11 Jun 2019 14:26:02 +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=Bc+KS/X3joAnx5lC8TCpo/aZhNkGuBuIX5CpxV56wqo=; b=xEI5FhZFwitj8/78fd4/NJhFpZZPx9zvWl4eS3LOTUBv6rdVrdolUWzPqOD5Nke2zDQh tPMI0Qkk0SKuF0MwazbsAt9m39otPXsVlsuCjy5MgKG7/7e1dOtZ2cWcyI4M8Ed5N3gL gb8Vcpxba7NhgQ7NhVvpm3JGo95v3Cef7cHCysitwpBpgLzG3UZQpYFOUrqfwB3jvIvo 1XpBvS1Db1Rowc98dsIBSrLK8TQ9jtou+Ro5FQ6z5FZ1RRZiiC/avF6oSSBOxh4XVIEH EMTWOH7Scfcak7cADeKHTy71fZ48Ix7lhWgqVIoSsMzeHkQq5SXcM+LUq05yaJDUatuf 3w== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2t26rm9ve1-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 11 Jun 2019 14:26:02 +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 0E5DD31; Tue, 11 Jun 2019 12:26:02 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A6E922A38; Tue, 11 Jun 2019 12:26:01 +0000 (GMT) Received: from SAFEX1HUBCAS22.st.com (10.75.90.93) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 11 Jun 2019 14:26:01 +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:26:01 +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" Subject: [PATCH v2 10/10] ARM: dts: stm32: add wakeup capability on each usart/uart on stm32mp157c Date: Tue, 11 Jun 2019 14:25:30 +0200 Message-ID: <1560255930-22554-11-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org - Mark all usart/uart devices as wakeup source. - Identify all dedicated interrupts with a specific interrupt name (either "event" or "wakeup"). - add interrupts-extended wakeup interrupt Signed-off-by: Erwan Le Ray -- 1.9.1 diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b/arch/arm/boot/dts/stm32mp157c.dtsi index 2afeee6..de5b1bf 100644 --- a/arch/arm/boot/dts/stm32mp157c.dtsi +++ b/arch/arm/boot/dts/stm32mp157c.dtsi @@ -395,32 +395,44 @@ usart2: serial@4000e000 { compatible = "st,stm32h7-uart"; reg = <0x4000e000 0x400>; - interrupts = ; + interrupt-names = "event", "wakeup"; + interrupts-extended = <&intc GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>, + <&exti 27 1>; clocks = <&rcc USART2_K>; + wakeup-source; status = "disabled"; }; usart3: serial@4000f000 { compatible = "st,stm32h7-uart"; reg = <0x4000f000 0x400>; - interrupts = ; + interrupt-names = "event", "wakeup"; + interrupts-extended = <&intc GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>, + <&exti 28 1>; clocks = <&rcc USART3_K>; + wakeup-source; status = "disabled"; }; uart4: serial@40010000 { compatible = "st,stm32h7-uart"; reg = <0x40010000 0x400>; - interrupts = ; + interrupt-names = "event", "wakeup"; + interrupts-extended = <&intc GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>, + <&exti 30 1>; clocks = <&rcc UART4_K>; + wakeup-source; status = "disabled"; }; uart5: serial@40011000 { compatible = "st,stm32h7-uart"; reg = <0x40011000 0x400>; - interrupts = ; + interrupt-names = "event", "wakeup"; + interrupts-extended = <&intc GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>, + <&exti 31 1>; clocks = <&rcc UART5_K>; + wakeup-source; status = "disabled"; }; @@ -512,16 +524,22 @@ uart7: serial@40018000 { compatible = "st,stm32h7-uart"; reg = <0x40018000 0x400>; - interrupts = ; + interrupt-names = "event", "wakeup"; + interrupts-extended = <&intc GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>, + <&exti 32 1>; clocks = <&rcc UART7_K>; + wakeup-source; status = "disabled"; }; uart8: serial@40019000 { compatible = "st,stm32h7-uart"; reg = <0x40019000 0x400>; - interrupts = ; + interrupt-names = "event", "wakeup"; + interrupts-extended = <&intc GIC_SPI 83 IRQ_TYPE_LEVEL_HIGH>, + <&exti 33 1>; clocks = <&rcc UART8_K>; + wakeup-source; status = "disabled"; }; @@ -588,8 +606,11 @@ usart6: serial@44003000 { compatible = "st,stm32h7-uart"; reg = <0x44003000 0x400>; - interrupts = ; + interrupt-names = "event", "wakeup"; + interrupts-extended = <&intc GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>, + <&exti 29 1>; clocks = <&rcc USART6_K>; + wakeup-source; status = "disabled"; }; @@ -1201,8 +1222,11 @@ usart1: serial@5c000000 { compatible = "st,stm32h7-uart"; reg = <0x5c000000 0x400>; - interrupts = ; + interrupt-names = "event", "wakeup"; + interrupts-extended = <&intc GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>, + <&exti 26 1>; clocks = <&rcc USART1_K>; + wakeup-source; status = "disabled"; };