diff mbox series

[v6,1/2] dt-bindings: serial: sc16is7xx: Add description for polling mode

Message ID 20250113073030.15970-1-andre.werner@systec-electronic.com
State Superseded
Headers show
Series [v6,1/2] dt-bindings: serial: sc16is7xx: Add description for polling mode | expand

Commit Message

Andre Werner Jan. 13, 2025, 7:30 a.m. UTC
Polling mode is enabled if the "interrupts" property is missing.
Thus, this commit deletes "interrupts" entry from "required" section
and adds a description for the fallback to polling mode at the
"interrupts" entry.

Signed-off-by: Andre Werner <andre.werner@systec-electronic.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
V3:
- No changes on source.
- Add Acked-By to commit message.
V4:
- No changes
V5:
- No changes
V6:
- No changes
---
 Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Andre Werner Jan. 13, 2025, 1:02 p.m. UTC | #1
On Mon, 13 Jan 2025, Andy Shevchenko wrote:

> On Mon, Jan 13, 2025 at 08:30:30AM +0100, Andre Werner wrote:
> > Fall back to polling mode if no interrupt is configured because there
> > is no possibility to connect the interrupt pin.
> > If "interrupts" property is missing in devicetree the driver
> > uses a delayed worker to pull the state of interrupt status registers.
>
> pull ? Hmm...

Ah ... poll ... sorry.

>
> ...
>
> > V6:
> > - Use polling mode for IRQ numbers <= 0 which encounter no valid IRQ
> >   were found/defined.
>
> Thanks, this part looks better now.
>
> ...
>
> > +static void sc16is7xx_poll_proc(struct kthread_work *ws)
> > +{
> > +	struct sc16is7xx_port *s = container_of(ws, struct sc16is7xx_port, poll_work.work);
> > +
> > +	/* Reuse standard IRQ handler. Interrupt ID is unused in this context. */
>
> Period.

What do you expect here? Shall I add the period time from the define as
the dedicated value? I do not understand what I should add here in
detail.

>
> > +	sc16is7xx_irq(0, s);
> > +
> > +	/* Setup delay based on SC16IS7XX_POLL_PERIOD_MS */
>
> No period.

Or do you mean that I add the define only once and not add all used
places?

>
> > +	kthread_queue_delayed_work(&s->kworker, &s->poll_work,
> > +				   msecs_to_jiffies(SC16IS7XX_POLL_PERIOD_MS));
> > +}
>
> Please, go through the comments you added in the patch and use the style that
> is mostly used in the driver for the similar (one-line comment) situations.
>
> ...
>
> > +		/* Initialize kernel thread for polling */
>
> Again, no period.

Same here. Do you expect the value here or the name of the used define?

>
> --
> With Best Regards,
> Andy Shevchenko
>
>
>

Thanks in advance

André
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml b/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml
index 88871480018e..ab39b95dae40 100644
--- a/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml
+++ b/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml
@@ -23,6 +23,8 @@  properties:
     maxItems: 1
 
   interrupts:
+    description:
+      When missing, device driver uses polling instead.
     maxItems: 1
 
   clocks:
@@ -76,7 +78,6 @@  properties:
 required:
   - compatible
   - reg
-  - interrupts
 
 allOf:
   - $ref: /schemas/spi/spi-peripheral-props.yaml#