linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] serial: 8250: omap: Add wakeup support
@ 2025-09-04 21:24 Kendall Willis
  2025-09-04 21:24 ` [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property Kendall Willis
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Kendall Willis @ 2025-09-04 21:24 UTC (permalink / raw)
  To: gregkh, jirislaby, robh, krzk+dt, conor+dt, vigneshr,
	linux-kernel, linux-serial, devicetree
  Cc: d-gole, vishalm, sebin.francis, msp, khilman, a-kaur, k-willis,
	john.ogness, andriy.shevchenko, yujiaoliang, b-liu,
	u.kleine-koenig

This series adds wakeup support for the serial 8250_omap driver. On the
TI K3 AM62 family of devices, the UARTs are able to wakeup the system
from various low power modes by using I/O daisy-chaining.

The wakeup functionality is implemented by adding the pinctrl state
'wakeup' in which specific flags are set on the pins to enable wakeup
via I/O daisy-chain. If the 'wakeup' pinctrl state exists for the serial
device, the 'wakeup' pinctrl state is selected on suspend. Upon resume,
the pinctrl 'default' state is selected.

The commits "dt-bindings: serial: 8250_omap: Add wakeup pinctrl state"
and "serial: 8250: omap: Support wakeup pinctrl state on suspend" were
picked from this series [1]. The commit "dt-bindings: serial: 8250_omap:
Add wakeup pinctrl state" was updated to follow the structure of a
similar patch [2] by Markus for the m_can driver. The commit "serial:
8250: omap: Support wakeup pinctrl state on suspend" was updated to only
include s2ram functionality instead of a poweroff state.

Implementation
--------------
This series is intended to be implemented along with the following
series:

1. "pmdomain: ti_sci: Handle wakeup constraint if device has pinctrl
   wakeup state": Patch which skips setting constraints for wakeup sources
   that use pinctrl state 'wakeup'.

2. "serial: 8250: omap: Add wakeup support" (this series): Implements
   wakeup from the UARTs for TI K3 SoCs

3. "arm64: dts: ti: k3-am62: Support Main UART wakeup": Implements the
   functionality to wakeup the system from the Main UART

Testing
-------
Tested on a SK-AM62B-P1 board with all series and dependencies
implemented. Suspend/resume verified with the Main UART wakeup source
by entering a keypress on the console.

[1] https://lore.kernel.org/all/20240523075819.1285554-1-msp@baylibre.com/
[2] https://lore.kernel.org/all/20250820-topic-mcan-wakeup-source-v6-12-v9-1-0ac13f2ddd67@baylibre.com/

Kendall Willis (1):
  dt-bindings: serial: 8250_omap: Update wakeup-source type property

Markus Schneider-Pargmann (2):
  dt-bindings: serial: 8250_omap: Add wakeup pinctrl state
  serial: 8250: omap: Support wakeup pinctrl state on suspend

 .../devicetree/bindings/serial/8250_omap.yaml | 25 ++++++++++++-
 drivers/tty/serial/8250/8250_omap.c           | 36 +++++++++++++++++++
 2 files changed, 60 insertions(+), 1 deletion(-)


base-commit: 4ac65880ebca1b68495bd8704263b26c050ac010
-- 
2.34.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property
  2025-09-04 21:24 [PATCH 0/3] serial: 8250: omap: Add wakeup support Kendall Willis
@ 2025-09-04 21:24 ` Kendall Willis
  2025-09-05 18:38   ` Conor Dooley
  2025-09-05 20:38   ` Rob Herring
  2025-09-04 21:24 ` [PATCH 2/3] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state Kendall Willis
  2025-09-04 21:24 ` [PATCH 3/3] serial: 8250: omap: Support wakeup pinctrl state on suspend Kendall Willis
  2 siblings, 2 replies; 12+ messages in thread
From: Kendall Willis @ 2025-09-04 21:24 UTC (permalink / raw)
  To: gregkh, jirislaby, robh, krzk+dt, conor+dt, vigneshr,
	linux-kernel, linux-serial, devicetree
  Cc: d-gole, vishalm, sebin.francis, msp, khilman, a-kaur, k-willis,
	john.ogness, andriy.shevchenko, yujiaoliang, b-liu,
	u.kleine-koenig

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 <k-willis@ti.com>
---
 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/Documentation/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.
 
 required:
   - compatible
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/3] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state
  2025-09-04 21:24 [PATCH 0/3] serial: 8250: omap: Add wakeup support Kendall Willis
  2025-09-04 21:24 ` [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property Kendall Willis
@ 2025-09-04 21:24 ` Kendall Willis
  2025-09-05 20:41   ` Rob Herring
  2025-09-04 21:24 ` [PATCH 3/3] serial: 8250: omap: Support wakeup pinctrl state on suspend Kendall Willis
  2 siblings, 1 reply; 12+ messages in thread
From: Kendall Willis @ 2025-09-04 21:24 UTC (permalink / raw)
  To: gregkh, jirislaby, robh, krzk+dt, conor+dt, vigneshr,
	linux-kernel, linux-serial, devicetree
  Cc: d-gole, vishalm, sebin.francis, msp, khilman, a-kaur, k-willis,
	john.ogness, andriy.shevchenko, yujiaoliang, b-liu,
	u.kleine-koenig

From: Markus Schneider-Pargmann <msp@baylibre.com>

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 <msp@baylibre.com>
Signed-off-by: Kendall Willis <k-willis@ti.com>
---
 .../devicetree/bindings/serial/8250_omap.yaml   | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Documentation/devicetree/bindings/serial/8250_omap.yaml b/Documentation/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.
 
+  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 default 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
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/3] serial: 8250: omap: Support wakeup pinctrl state on suspend
  2025-09-04 21:24 [PATCH 0/3] serial: 8250: omap: Add wakeup support Kendall Willis
  2025-09-04 21:24 ` [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property Kendall Willis
  2025-09-04 21:24 ` [PATCH 2/3] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state Kendall Willis
@ 2025-09-04 21:24 ` Kendall Willis
  2 siblings, 0 replies; 12+ messages in thread
From: Kendall Willis @ 2025-09-04 21:24 UTC (permalink / raw)
  To: gregkh, jirislaby, robh, krzk+dt, conor+dt, vigneshr,
	linux-kernel, linux-serial, devicetree
  Cc: d-gole, vishalm, sebin.francis, msp, khilman, a-kaur, k-willis,
	john.ogness, andriy.shevchenko, yujiaoliang, b-liu,
	u.kleine-koenig

From: Markus Schneider-Pargmann <msp@baylibre.com>

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 <msp@baylibre.com>
Signed-off-by: Kendall Willis <k-willis@ti.com>
---
 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 <linux/pm_wakeirq.h>
 #include <linux/dma-mapping.h>
 #include <linux/sys_soc.h>
+#include <linux/reboot.h>
+#include <linux/pinctrl/consumer.h>
 
 #include "8250.h"
 
@@ -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;
 };
 
 struct omap8250_dma_params {
@@ -1349,6 +1354,18 @@ static int omap8250_no_handle_irq(struct uart_port *port)
 	return 0;
 }
 
+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 = {
 	.rx_size = SZ_2K,
 	.rx_trigger = 1,
@@ -1573,6 +1590,11 @@ static int omap8250_probe(struct platform_device *pdev)
 	priv->line = ret;
 	pm_runtime_mark_last_busy(&pdev->dev);
 	pm_runtime_put_autosuspend(&pdev->dev);
+
+	priv->pinctrl = devm_pinctrl_get(&pdev->dev);
+	if (!IS_ERR_OR_NULL(priv->pinctrl))
+		priv->pinctrl_wakeup = 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 = serial8250_get_port(priv->line);
 	int err = 0;
 
+	err = 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);
 
 	err = pm_runtime_resume_and_get(dev);
@@ -1651,6 +1680,13 @@ static int omap8250_resume(struct device *dev)
 	struct uart_8250_port *up = serial8250_get_port(priv->line);
 	int err;
 
+	err = 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 = pm_runtime_force_resume(dev);
 		if (err)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property
  2025-09-04 21:24 ` [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property Kendall Willis
@ 2025-09-05 18:38   ` Conor Dooley
  2025-09-05 18:48     ` Dhruva Gole
  2025-09-09  9:05     ` Markus Schneider-Pargmann
  2025-09-05 20:38   ` Rob Herring
  1 sibling, 2 replies; 12+ messages in thread
From: Conor Dooley @ 2025-09-05 18:38 UTC (permalink / raw)
  To: Kendall Willis
  Cc: gregkh, jirislaby, robh, krzk+dt, conor+dt, vigneshr,
	linux-kernel, linux-serial, devicetree, d-gole, vishalm,
	sebin.francis, msp, khilman, a-kaur, john.ogness,
	andriy.shevchenko, yujiaoliang, b-liu, u.kleine-koenig

[-- Attachment #1: Type: text/plain, Size: 1291 bytes --]

On Thu, Sep 04, 2025 at 04:24:53PM -0500, Kendall Willis wrote:
> 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 <k-willis@ti.com>
> ---
>  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/Documentation/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.

Is there a single other instance of the wakeup-source property being
used like this?

>  
>  required:
>    - compatible
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property
  2025-09-05 18:38   ` Conor Dooley
@ 2025-09-05 18:48     ` Dhruva Gole
  2025-09-09  9:05     ` Markus Schneider-Pargmann
  1 sibling, 0 replies; 12+ messages in thread
From: Dhruva Gole @ 2025-09-05 18:48 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Kendall Willis, gregkh, jirislaby, robh, krzk+dt, conor+dt,
	vigneshr, linux-kernel, linux-serial, devicetree, vishalm,
	sebin.francis, msp, khilman, a-kaur, john.ogness,
	andriy.shevchenko, yujiaoliang, b-liu, u.kleine-koenig

On Sep 05, 2025 at 19:38:00 +0100, Conor Dooley wrote:
> On Thu, Sep 04, 2025 at 04:24:53PM -0500, Kendall Willis wrote:
> > 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 <k-willis@ti.com>
> > ---
> >  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/Documentation/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.
> 
> Is there a single other instance of the wakeup-source property being
> used like this?

I think there's an ongoing thread here [1],
[1] https://lore.kernel.org/all/20250820-topic-mcan-wakeup-source-v6-12-v9-1-0ac13f2ddd67@baylibre.com/


-- 
Best regards,
Dhruva Gole
Texas Instruments Incorporated

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property
  2025-09-04 21:24 ` [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property Kendall Willis
  2025-09-05 18:38   ` Conor Dooley
@ 2025-09-05 20:38   ` Rob Herring
  2025-09-09 19:00     ` Kendall Willis
  1 sibling, 1 reply; 12+ messages in thread
From: Rob Herring @ 2025-09-05 20:38 UTC (permalink / raw)
  To: Kendall Willis
  Cc: gregkh, jirislaby, krzk+dt, conor+dt, vigneshr, linux-kernel,
	linux-serial, devicetree, d-gole, vishalm, sebin.francis, msp,
	khilman, a-kaur, john.ogness, andriy.shevchenko, yujiaoliang,
	b-liu, u.kleine-koenig

On Thu, Sep 04, 2025 at 04:24:53PM -0500, Kendall Willis wrote:
> 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 <k-willis@ti.com>
> ---
>  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/Documentation/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.

You don't need to be defining the type here. Did you find either type 
didn't work?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state
  2025-09-04 21:24 ` [PATCH 2/3] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state Kendall Willis
@ 2025-09-05 20:41   ` Rob Herring
  2025-09-09 21:26     ` Kendall Willis
  0 siblings, 1 reply; 12+ messages in thread
From: Rob Herring @ 2025-09-05 20:41 UTC (permalink / raw)
  To: Kendall Willis
  Cc: gregkh, jirislaby, krzk+dt, conor+dt, vigneshr, linux-kernel,
	linux-serial, devicetree, d-gole, vishalm, sebin.francis, msp,
	khilman, a-kaur, john.ogness, andriy.shevchenko, yujiaoliang,
	b-liu, u.kleine-koenig

On Thu, Sep 04, 2025 at 04:24:54PM -0500, Kendall Willis wrote:
> From: Markus Schneider-Pargmann <msp@baylibre.com>
> 
> 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 <msp@baylibre.com>
> Signed-off-by: Kendall Willis <k-willis@ti.com>
> ---
>  .../devicetree/bindings/serial/8250_omap.yaml   | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/serial/8250_omap.yaml b/Documentation/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.
>  
> +  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 default 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

This doesn't match what 'pinctrl-1' says. Perhaps you want?:

items:
  - const: default
  - enum: [ sleep, wakeup ]

> +
>  required:
>    - compatible
>    - reg
> -- 
> 2.34.1
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property
  2025-09-05 18:38   ` Conor Dooley
  2025-09-05 18:48     ` Dhruva Gole
@ 2025-09-09  9:05     ` Markus Schneider-Pargmann
  2025-09-09 18:59       ` Kendall Willis
  1 sibling, 1 reply; 12+ messages in thread
From: Markus Schneider-Pargmann @ 2025-09-09  9:05 UTC (permalink / raw)
  To: Conor Dooley, Kendall Willis
  Cc: gregkh, jirislaby, robh, krzk+dt, conor+dt, vigneshr,
	linux-kernel, linux-serial, devicetree, d-gole, vishalm,
	sebin.francis, khilman, a-kaur, john.ogness, andriy.shevchenko,
	yujiaoliang, b-liu, u.kleine-koenig

[-- Attachment #1: Type: text/plain, Size: 1615 bytes --]

On Fri Sep 5, 2025 at 8:38 PM CEST, Conor Dooley wrote:
> On Thu, Sep 04, 2025 at 04:24:53PM -0500, Kendall Willis wrote:
>> 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 <k-willis@ti.com>
>> ---
>>  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/Documentation/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.
>
> Is there a single other instance of the wakeup-source property being
> used like this?

This was added to the dt-schema repository:
  https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/wakeup-source.yaml

I don't think this needs to be repeated in every binding, so I think you
can just drop this unless there are specifics for this device.

Best
Markus

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 289 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property
  2025-09-09  9:05     ` Markus Schneider-Pargmann
@ 2025-09-09 18:59       ` Kendall Willis
  0 siblings, 0 replies; 12+ messages in thread
From: Kendall Willis @ 2025-09-09 18:59 UTC (permalink / raw)
  To: Markus Schneider-Pargmann, Conor Dooley
  Cc: gregkh, jirislaby, robh, krzk+dt, conor+dt, vigneshr,
	linux-kernel, linux-serial, devicetree, d-gole, vishalm,
	sebin.francis, khilman, a-kaur, john.ogness, andriy.shevchenko,
	yujiaoliang, b-liu, u.kleine-koenig

On 9/9/25 04:05, Markus Schneider-Pargmann wrote:
> On Fri Sep 5, 2025 at 8:38 PM CEST, Conor Dooley wrote:
>> On Thu, Sep 04, 2025 at 04:24:53PM -0500, Kendall Willis wrote:
>>> 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 <k-willis@ti.com>
>>> ---
>>>   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/Documentation/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.
>>
>> Is there a single other instance of the wakeup-source property being
>> used like this?
> 
> This was added to the dt-schema repository:
>    https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/wakeup-source.yaml
> 
> I don't think this needs to be repeated in every binding, so I think you
> can just drop this unless there are specifics for this device.
> 
> Best
> Markus

Okay, I will likely drop this patch in the next version. Thanks for 
reviewing :)

Best,
Kendall

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property
  2025-09-05 20:38   ` Rob Herring
@ 2025-09-09 19:00     ` Kendall Willis
  0 siblings, 0 replies; 12+ messages in thread
From: Kendall Willis @ 2025-09-09 19:00 UTC (permalink / raw)
  To: Rob Herring
  Cc: gregkh, jirislaby, krzk+dt, conor+dt, vigneshr, linux-kernel,
	linux-serial, devicetree, d-gole, vishalm, sebin.francis, msp,
	khilman, a-kaur, john.ogness, andriy.shevchenko, yujiaoliang,
	b-liu, u.kleine-koenig

On 9/5/25 15:38, Rob Herring wrote:
> On Thu, Sep 04, 2025 at 04:24:53PM -0500, Kendall Willis wrote:
>> 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 <k-willis@ti.com>
>> ---
>>   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/Documentation/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.
> 
> You don't need to be defining the type here. Did you find either type
> didn't work?

You're right, this should not be redefined. I'll be dropping this patch 
in the next version. Thanks for reviewing :)

Best,
Kendall

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state
  2025-09-05 20:41   ` Rob Herring
@ 2025-09-09 21:26     ` Kendall Willis
  0 siblings, 0 replies; 12+ messages in thread
From: Kendall Willis @ 2025-09-09 21:26 UTC (permalink / raw)
  To: Rob Herring
  Cc: gregkh, jirislaby, krzk+dt, conor+dt, vigneshr, linux-kernel,
	linux-serial, devicetree, d-gole, vishalm, sebin.francis, msp,
	khilman, a-kaur, john.ogness, andriy.shevchenko, yujiaoliang,
	b-liu, u.kleine-koenig

Hi Rob,
On 9/5/25 15:41, Rob Herring wrote:
> On Thu, Sep 04, 2025 at 04:24:54PM -0500, Kendall Willis wrote:
>> From: Markus Schneider-Pargmann <msp@baylibre.com>
>>
>> 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 <msp@baylibre.com>
>> Signed-off-by: Kendall Willis <k-willis@ti.com>
>> ---
>>   .../devicetree/bindings/serial/8250_omap.yaml   | 17 +++++++++++++++++
>>   1 file changed, 17 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/serial/8250_omap.yaml b/Documentation/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.
>>   
>> +  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 default 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
> 
> This doesn't match what 'pinctrl-1' says. Perhaps you want?:
> 
> items:
>    - const: default
>    - enum: [ sleep, wakeup ]

That is my mistake, I should have added another pinctrl-2 which could be 
either "sleep" or "wakeup" state. This would mean that all three states 
could be present at the same time so it should stay as separate items. 
The thought process for the availability of all three states is that if 
the UART is not wakeup capable, it could use the sleep state when 
suspending.

However, the serial 8250 omap driver does not use the sleep pinctrl 
state as of now, so for the next version I think I will remove the sleep 
state since it is not necessary/used as of this moment.

Thanks for reviewing!

Best,
Kendall

> 
>> +
>>   required:
>>     - compatible
>>     - reg
>> -- 
>> 2.34.1
>>


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-09-09 21:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-04 21:24 [PATCH 0/3] serial: 8250: omap: Add wakeup support Kendall Willis
2025-09-04 21:24 ` [PATCH 1/3] dt-bindings: serial: 8250_omap: Update wakeup-source type property Kendall Willis
2025-09-05 18:38   ` Conor Dooley
2025-09-05 18:48     ` Dhruva Gole
2025-09-09  9:05     ` Markus Schneider-Pargmann
2025-09-09 18:59       ` Kendall Willis
2025-09-05 20:38   ` Rob Herring
2025-09-09 19:00     ` Kendall Willis
2025-09-04 21:24 ` [PATCH 2/3] dt-bindings: serial: 8250_omap: Add wakeup pinctrl state Kendall Willis
2025-09-05 20:41   ` Rob Herring
2025-09-09 21:26     ` Kendall Willis
2025-09-04 21:24 ` [PATCH 3/3] serial: 8250: omap: Support wakeup pinctrl state on suspend Kendall Willis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).