From nobody Fri Oct 3 05:30:51 2025 Received: from fllvem-ot04.ext.ti.com (fllvem-ot04.ext.ti.com [198.47.19.246]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69ED52BE047; Thu, 4 Sep 2025 21:25:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.246 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757021109; cv=none; b=H8sZ4cPNPWJU92LcYdLRcGGJDAbk14IeJvaZeQXhOiJ/oQBdlEx/mQD570V9D6es7vLNk5IvfPBxZaPaPI3Wz44F89dJtDosanUgR81e1gmV4gTbtwWAtFUo8dr6PKlH5F9LYiPhTHVWhFjMGUByv6HJXbwXcV6VPkpkZOyJvHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757021109; c=relaxed/simple; bh=pKAQLsshWECw1X3z2y70UhSzMLQ4h+Oc9fVb+lbsv84=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=abyjKjtz90hA+qxNTy8L06h0vePTNCuB0cR4A+UqaXyrw0aSM9NuZA9/MXVj5lXj/8k2fZYwaki5YmjWIac+Z5RVngqX+1cfTMfBMDGKi40f2xtd49rWh8RPRSKmGfu2acadatE3vEv/Ye2RmUmKToT3vlIw/Y8ziFJ78KYCib4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=EQHMPls6; arc=none smtp.client-ip=198.47.19.246 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="EQHMPls6" Received: from fllvem-sh03.itg.ti.com ([10.64.41.86]) by fllvem-ot04.ext.ti.com (8.15.2/8.15.2) with ESMTP id 584LOxtJ3561776; Thu, 4 Sep 2025 16:24:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1757021099; bh=jBgeeqpoNro25yUCNp3rX608oj6F8xXhDRGf+2Go+LI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=EQHMPls6CxLKe/nikFjARk/yJcLz/U8zVDRQ9EQqCWk4lIcGIJxEQ1DEZsRullvX/ c4kiUBCDl9aelLWhAhQJeDpn6qn2g8HfylOx+bf6Gtah+324tjv94B0kLvz+zubN7m oScDa4qA+xpHPDDoriNvphVHNfFkksg7Amx0uNng= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllvem-sh03.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 584LOxFi405712 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Thu, 4 Sep 2025 16:24:59 -0500 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Thu, 4 Sep 2025 16:24:58 -0500 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55 via Frontend Transport; Thu, 4 Sep 2025 16:24:58 -0500 Received: from uda0506412.dhcp.ti.com (uda0506412.dhcp.ti.com [128.247.81.19]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 584LOvle3611150; Thu, 4 Sep 2025 16:24:58 -0500 From: Kendall Willis To: , , , , , , , , CC: , , , , , , , , , , , Subject: [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property Date: Thu, 4 Sep 2025 16:24:53 -0500 Message-ID: <20250904212455.3729029-2-k-willis@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250904212455.3729029-1-k-willis@ti.com> References: <20250904212455.3729029-1-k-willis@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea Content-Type: text/plain; charset="utf-8" Allow the wakeup-source property to be either of type boolean or of a phandle array. The phandle array points to the system idle states that the UART can wakeup the system from. Signed-off-by: Kendall Willis --- Documentation/devicetree/bindings/serial/8250_omap.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/serial/8250_omap.yaml b/Docu= mentation/devicetree/bindings/serial/8250_omap.yaml index 1859f71297ff2..851a5291b4be4 100644 --- a/Documentation/devicetree/bindings/serial/8250_omap.yaml +++ b/Documentation/devicetree/bindings/serial/8250_omap.yaml @@ -69,7 +69,13 @@ properties: clock-frequency: true current-speed: true overrun-throttle-ms: true - wakeup-source: true + + wakeup-source: + oneOf: + - type: boolean + - $ref: /schemas/types.yaml#/definitions/phandle-array + description: + List of phandles to system idle states in which UARTs can wakeup= the system. =20 required: - compatible --=20 2.34.1 From nobody Fri Oct 3 05:30:51 2025 Received: from lelvem-ot02.ext.ti.com (lelvem-ot02.ext.ti.com [198.47.23.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 185AC2BE04C; Thu, 4 Sep 2025 21:25:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.235 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757021110; cv=none; b=NErKlv0w0lpqtllpnHJXQRg2HGOpjtChugWud4UT4MMpm7I6Xzal7no/yDmg5rAST0EBPuq3I0Tn+S5OOTApqS+F93bdWKc3GFx3wPPy7JN4u6EIgSAEvLCjlrdJaMDMp8g7XocTlgH02v4U9sNRk7JY3pT9Chzn64ASctgSyRQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757021110; c=relaxed/simple; bh=uNCFwB3C+5Rw/IK15HEcSHsXBjCM8xjH8MVpjkI9if0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Im1Zv8WsVenR9kgK4Z5lKcBxpH0SdNY2d3BgtKH24SdpcPRFlgZNh2J59+UN9tFgcGUSvItnLSBiKRl+vbe1gv4nTZuOHXhfL5pmWAa3XtnALDl+6Jj+AqJZhvLlOQOY7D0YwC46JIRZecDKl7KBby7rHXrKDngHtRiIgjc8SEk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=cIf7k1mE; arc=none smtp.client-ip=198.47.23.235 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="cIf7k1mE" Received: from fllvem-sh03.itg.ti.com ([10.64.41.86]) by lelvem-ot02.ext.ti.com (8.15.2/8.15.2) with ESMTP id 584LP0FQ3603115; Thu, 4 Sep 2025 16:25:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1757021100; bh=Yl4PQBUK+AuhwJxjt4s/jV51T5GLI2nXcvVAFKVs1mE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=cIf7k1mESroSFDwbW0PeHmrO3hOZ2sGaTtIH89PxMvB8O8Qln+P30ELYNOYz9XHlU rTGL8myv/3Bta6hB3aVETCCyPpaScTdEJnZoLYFq5YhEuZwSPWtBfxuEie5l/pWAcs DFaUX6xwAXK3DdmbJMs7ZimwTNU1mCeRbjpS2pZE= Received: from DLEE101.ent.ti.com (dlee101.ent.ti.com [157.170.170.31]) by fllvem-sh03.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 584LP0Df405716 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Thu, 4 Sep 2025 16:25:00 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Thu, 4 Sep 2025 16:24:59 -0500 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55 via Frontend Transport; Thu, 4 Sep 2025 16:24:59 -0500 Received: from uda0506412.dhcp.ti.com (uda0506412.dhcp.ti.com [128.247.81.19]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 584LOvlf3611150; Thu, 4 Sep 2025 16:24:59 -0500 From: Kendall Willis To: , , , , , , , , CC: , , , , , , , , , , , Subject: [PATCH 2/3] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state Date: Thu, 4 Sep 2025 16:24:54 -0500 Message-ID: <20250904212455.3729029-3-k-willis@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250904212455.3729029-1-k-willis@ti.com> References: <20250904212455.3729029-1-k-willis@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea Content-Type: text/plain; charset="utf-8" From: Markus Schneider-Pargmann Pins associated with the 8250 omap unit can be the source of a wakeup in deep sleep states. To be able to wakeup, these pins have to be configured in a special way. To support this configuration add the default and wakeup pinctrl states. Add support for the sleep state as well which is in use by some devicetrees. Signed-off-by: Markus Schneider-Pargmann Signed-off-by: Kendall Willis --- .../devicetree/bindings/serial/8250_omap.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/8250_omap.yaml b/Docu= mentation/devicetree/bindings/serial/8250_omap.yaml index 851a5291b4be4..1c4040a9f9d0b 100644 --- a/Documentation/devicetree/bindings/serial/8250_omap.yaml +++ b/Documentation/devicetree/bindings/serial/8250_omap.yaml @@ -77,6 +77,23 @@ properties: description: List of phandles to system idle states in which UARTs can wakeup= the system. =20 + pinctrl-0: + description: Default pinctrl state + + pinctrl-1: + description: Can be "sleep" or "wakeup" pinctrl state + + pinctrl-names: + description: + When present should contain at least "default" describing the defaul= t pin + states. Other states are "sleep" which describes the pinstate when + sleeping and "wakeup" describing the pins if wakeup is enabled. + minItems: 1 + items: + - const: default + - const: sleep + - const: wakeup + required: - compatible - reg --=20 2.34.1 From nobody Fri Oct 3 05:30:51 2025 Received: from lelvem-ot02.ext.ti.com (lelvem-ot02.ext.ti.com [198.47.23.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 186232BE050; Thu, 4 Sep 2025 21:25:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.23.235 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757021110; cv=none; b=PBJJNaKEXUtWZaB/cpY+hov4jfOZ72lPw1CxpMt4IJaW0C52q20sKMwBXG/4XjhE13aT8r+oaKzECMK39jcZ4fQ+++zTM7dWdjcG4LJ6U4BdokwLrXubv5ZZCEubEj99hViEDqxSScj4vt5utqz9a1si1wPT0Cgkg9D2w94eZoM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757021110; c=relaxed/simple; bh=dQThrLQFDn6/9HUHfoM9KqjetvzbcwKFUWuVunPKJdA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lby6y1uTnPq8GexdsNKnvI/+s9Pk/Y2ECCz7yJgNVLD/8LWMikExI1LkVGbiVVSzyI8mRE4fPwcEe92SDvf1xOQyM4VVb9lllce4YYXbW7QuWYNmg2sjE/fGRDJETYSphUDxDFv+UVbVUz/IIc3kGxxGZHxBxx9jI9MHMmJ+Sy8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=uYtXkufg; arc=none smtp.client-ip=198.47.23.235 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="uYtXkufg" Received: from fllvem-sh04.itg.ti.com ([10.64.41.54]) by lelvem-ot02.ext.ti.com (8.15.2/8.15.2) with ESMTP id 584LP0AP3603119; Thu, 4 Sep 2025 16:25:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1757021100; bh=o3L77FAgZE7CyMiTKAGd3ndivBgklsA1s4OZmLaELQ8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=uYtXkufgJCOYL2cOkcbj9+ijF9E5KsknZrKqnNCBtMpWNQPER+tZAaAyMt2bP40cj gvrBoy9zB2dgPnfj7BhMObJNAnD0nub/ln6NlAvarcnY6A5KDjN9PEnSg9f9GORvnb y68WSqRRdNC5aYVejnU2tvHNRuX9j8xjJa/hl/vQ= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by fllvem-sh04.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 584LP0s21154231 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Thu, 4 Sep 2025 16:25:00 -0500 Received: from DLEE100.ent.ti.com (157.170.170.30) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Thu, 4 Sep 2025 16:25:00 -0500 Received: from lelvem-mr06.itg.ti.com (10.180.75.8) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55 via Frontend Transport; Thu, 4 Sep 2025 16:25:00 -0500 Received: from uda0506412.dhcp.ti.com (uda0506412.dhcp.ti.com [128.247.81.19]) by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 584LOvlg3611150; Thu, 4 Sep 2025 16:25:00 -0500 From: Kendall Willis To: , , , , , , , , CC: , , , , , , , , , , , Subject: [PATCH 3/3] serial: 8250: omap: Support wakeup pinctrl state on suspend Date: Thu, 4 Sep 2025 16:24:55 -0500 Message-ID: <20250904212455.3729029-4-k-willis@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250904212455.3729029-1-k-willis@ti.com> References: <20250904212455.3729029-1-k-willis@ti.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea Content-Type: text/plain; charset="utf-8" From: Markus Schneider-Pargmann UART can be used as a wakeup source for am62 from suspend to ram states. To enable wakeup from UART am62 requires a wakeup flag being set in the pinctrl. If the device is marked as wakeup enabled, select the 'wakeup' pinctrl state on suspend and restore the default pinctrl state on resume. Signed-off-by: Markus Schneider-Pargmann Signed-off-by: Kendall Willis --- drivers/tty/serial/8250/8250_omap.c | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/= 8250_omap.c index bb23afdd63f29..9e49ef48b851b 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -27,6 +27,8 @@ #include #include #include +#include +#include =20 #include "8250.h" =20 @@ -145,6 +147,9 @@ struct omap8250_priv { spinlock_t rx_dma_lock; bool rx_dma_broken; bool throttled; + + struct pinctrl *pinctrl; + struct pinctrl_state *pinctrl_wakeup; }; =20 struct omap8250_dma_params { @@ -1349,6 +1354,18 @@ static int omap8250_no_handle_irq(struct uart_port *= port) return 0; } =20 +static int omap8250_select_wakeup_pinctrl(struct device *dev, + struct omap8250_priv *priv) +{ + if (IS_ERR_OR_NULL(priv->pinctrl_wakeup)) + return 0; + + if (!device_may_wakeup(dev)) + return 0; + + return pinctrl_select_state(priv->pinctrl, priv->pinctrl_wakeup); +} + static struct omap8250_dma_params am654_dma =3D { .rx_size =3D SZ_2K, .rx_trigger =3D 1, @@ -1573,6 +1590,11 @@ static int omap8250_probe(struct platform_device *pd= ev) priv->line =3D ret; pm_runtime_mark_last_busy(&pdev->dev); pm_runtime_put_autosuspend(&pdev->dev); + + priv->pinctrl =3D devm_pinctrl_get(&pdev->dev); + if (!IS_ERR_OR_NULL(priv->pinctrl)) + priv->pinctrl_wakeup =3D pinctrl_lookup_state(priv->pinctrl, "wakeup"); + return 0; err: pm_runtime_dont_use_autosuspend(&pdev->dev); @@ -1630,6 +1652,13 @@ static int omap8250_suspend(struct device *dev) struct uart_8250_port *up =3D serial8250_get_port(priv->line); int err =3D 0; =20 + err =3D omap8250_select_wakeup_pinctrl(dev, priv); + if (err) { + dev_err(dev, "Failed to select wakeup pinctrl, aborting suspend %pe\n", + ERR_PTR(err)); + return err; + } + serial8250_suspend_port(priv->line); =20 err =3D pm_runtime_resume_and_get(dev); @@ -1651,6 +1680,13 @@ static int omap8250_resume(struct device *dev) struct uart_8250_port *up =3D serial8250_get_port(priv->line); int err; =20 + err =3D pinctrl_select_default_state(dev); + if (err) { + dev_err(dev, "Failed to select default pinctrl state on resume: %pe\n", + ERR_PTR(err)); + return err; + } + if (uart_console(&up->port) && console_suspend_enabled) { err =3D pm_runtime_force_resume(dev); if (err) --=20 2.34.1