Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2803299pxb; Thu, 3 Feb 2022 15:01:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJx8lH8/SqEUkHGKQnr+++/lLFctViB4BJQ3uBvOYtkWKJTkFnKHDpn8LZVWD+qpd0N4MrQj X-Received: by 2002:a17:906:c10f:: with SMTP id do15mr121203ejc.474.1643929302941; Thu, 03 Feb 2022 15:01:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643929302; cv=none; d=google.com; s=arc-20160816; b=KhzStzYrt9MJHwYa2NIDq/SYHeE6SeB1c5NsAN9R+Fdhtj8QRj7WZfWnpv+++Rz3oo RaK6mnkvlhPcA/l7AeKH2gN793fmtKq1OLZ0nAbBwB6ULnPx96U0XGOAssjapidOOLNJ LJTktRlKA3mF9VRBcNTQq6/w8T4B2PST9RmKqY0rCkLGkmqNp4Ie1LyJZa9lHDrkXVlt PuYgTnQD7CXin1eM9vm1SkjMF2URrANkTpsWYeIy2/rAId9+x32Of2Y+u4bNxNwy4D5n 0bY9Dal1vpfGTRfSRt0kQ2MEZnDHQzWvku9XkrNJ5v4hNeyWqdrIhigbJ7mcLfYXBj/l sYLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=RCtJ3BeJ8WdtSkBXKlo8ykGWUNMUkxUiYAgibZ776yE=; b=WDZ6Vjk7EN0L/9HwVnNj64ykFDrlIr3fUMlxVMjJmjjdPnyBAbW5KFhx5zMvvkN0Lr osB9yjy2wAnDif9cotKIg4S7Mvk4apFObkq9ngeNt5hxsBfSMGjMV4XmiUKYGMz1cZU9 P/G9M9wLv/6QSDPdQeqUNO5BVRQsQOldNRo/lXFbd+3Kle2ABqykx+4BvquNX8PejRcX gPjCBFRl6gbwlW/N9Aqjy1K+WbTGZo6d+cDlL5r1PbYv4jaqBWzjqdAFogCe+5wcW4Ri QyOpIvTWOQtkzp6wV2MhemPsc5C252ZSuOekbgu/DEXDyNyNyHhyoxoKfR1O0WgtJ/uk /UQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=kFJZSrJO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg27si120258ejc.363.2022.02.03.15.01.18; Thu, 03 Feb 2022 15:01:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=kFJZSrJO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352755AbiBCRS7 (ORCPT + 99 others); Thu, 3 Feb 2022 12:18:59 -0500 Received: from mx07-00178001.pphosted.com ([185.132.182.106]:40680 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352545AbiBCRS5 (ORCPT ); Thu, 3 Feb 2022 12:18:57 -0500 Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 213CZt9O018956; Thu, 3 Feb 2022 18:16:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=selector1; bh=RCtJ3BeJ8WdtSkBXKlo8ykGWUNMUkxUiYAgibZ776yE=; b=kFJZSrJOJieZ0E4n1DrSB9goEOB7XdPiGKJUqd/Nj2IfP8FwNGO6YV5EuVBcJ6T17LN7 Bz4UzOhgwDBuUqM8R5P+Q6u+OdgH5aBD9eVtnfdrUX4TMPtoj3a3zagVwaUTXNFMtCft x1hisnnRewj5V4lwBZyCIrPMP2NmemLAwx7XiUhSfom3QiEzQ2fnQ/EJI2KlvhLuHi4U 0bCsHtcjjUuaGn2Ogvn/bt2Qx8lnobxmtFojyj6rDRNwLwNsTsVhstQnuCUDf1tTMVaT QiHSjBV0Qx0PTq0rebbUztoVjV8uWVnQ/95cop5xagYsrVMHh7iRAw++GbtL0JJQxvau aw== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3dyrujqpqr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 03 Feb 2022 18:16:49 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DD873100038; Thu, 3 Feb 2022 18:16:48 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id D7B19229A73; Thu, 3 Feb 2022 18:16:48 +0100 (CET) Received: from localhost (10.75.127.45) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Thu, 3 Feb 2022 18:16:48 +0100 From: Erwan Le Ray To: Greg Kroah-Hartman CC: Jiri Slaby , Maxime Coquelin , Alexandre Torgue , Gerald Baeza , Erwan Le Ray , Valentin Caron , , , , Subject: [PATCH 2/2] serial: stm32: enable / disable wake irqs for mcrtl_gpio wakeup sources Date: Thu, 3 Feb 2022 18:16:44 +0100 Message-ID: <20220203171644.12231-3-erwan.leray@foss.st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220203171644.12231-1-erwan.leray@foss.st.com> References: <20220203171644.12231-1-erwan.leray@foss.st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-03_06,2022-02-03_01,2021-12-02_01 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Enable mctrl_gpio wake_irq if device_may_wakeup when usart is suspended, and disable mctrl_gpios wake_irq if device_may_wakeup when usart is resumed. Signed-off-by: Erwan Le Ray diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c index 3244e7f6818c..df86c53e62a7 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -1708,6 +1708,7 @@ static int __maybe_unused stm32_usart_serial_en_wakeup(struct uart_port *port, if (enable) { stm32_usart_set_bits(port, ofs->cr1, USART_CR1_UESM); stm32_usart_set_bits(port, ofs->cr3, USART_CR3_WUFIE); + mctrl_gpio_enable_irq_wake(stm32_port->gpios); /* * When DMA is used for reception, it must be disabled before @@ -1734,7 +1735,7 @@ static int __maybe_unused stm32_usart_serial_en_wakeup(struct uart_port *port, if (ret) return ret; } - + mctrl_gpio_disable_irq_wake(stm32_port->gpios); stm32_usart_clr_bits(port, ofs->cr1, USART_CR1_UESM); stm32_usart_clr_bits(port, ofs->cr3, USART_CR3_WUFIE); } -- 2.17.1