[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZYRY8ypZ1cYNRMcP@smile.fi.intel.com>
Date: Thu, 21 Dec 2023 17:25:39 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Mark Hasemeyer <markhas@...omium.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Tzung-Bi Shih <tzungbi@...nel.org>,
Raul Rangel <rrangel@...omium.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Rob Herring <robh@...nel.org>, Sudeep Holla <sudeep.holla@....com>,
Frank Rowand <frowand.list@...il.com>,
Rob Herring <robh+dt@...nel.org>, devicetree@...r.kernel.org
Subject: Re: [PATCH v2 17/22] of: irq: add wake capable bit to
of_irq_resource()
On Wed, Dec 20, 2023 at 04:54:31PM -0700, Mark Hasemeyer wrote:
> Add wake capability information to the IRQ resource. Wake capability is
> assumed based on conventions provided in the devicetree wakeup-source
> binding documentation. An interrupt is considered wake capable if the
> following are true:
> 1. A wakeup-source property exits in the same device node as the
> interrupt.
> 2. The IRQ is marked as dedicated by setting its interrupt-name to
> "wakeup".
>
> The wakeup-source documentation states that dedicated interrupts can use
> device specific interrupt names and device drivers are still welcome to
> use their own naming schemes. This API is provided as a helper if one is
> willing to conform to the above conventions.
>
> The ACPI subsystems already provides similar APIs that allow one to
> query the wake capability of an IRQ. This brings closer feature parity
> to the devicetree.
...
> r->start = r->end = irq;
> r->flags = IORESOURCE_IRQ | irqd_get_trigger_type(irq_get_irq_data(irq));
> + if (__of_irq_wake_capable(dev, index))
> + r->flags |= IORESOURCE_IRQ_WAKECAPABLE;
> r->name = name ? name : of_node_full_name(dev);
irq_flags = irqd_get_trigger_type(irq_get_irq_data(irq));
if (__of_irq_wake_capable(dev, index))
irq_flags |= IORESOURCE_IRQ_WAKECAPABLE;
*r = DEFINE_RES_NAMED(irq, 1, name ?: of_node_full_name(dev), irq_flags);
?
...
Or even refactor ioport.h (in a separate patch) as we seems already have
two users (and might be more in the existing code):
#define DEFINE_RES_IRQ_NAMED_FLAGS(_irq, _name, _flags) \
DEFINE_RES_NAMED((_irq), 1, (_name), (_flags) | IORESOURCE_IRQ)
#define DEFINE_RES_IRQ_NAMED(_irq, _name) \
DEFINE_RES_IRQ_NAMED_FLAGS((_irq), (_name), 0)
#define DEFINE_RES_IRQ(_irq) \
DEFINE_RES_IRQ_NAMED((_irq), NULL)
(Note, I will Ack such a patch once it appears.)
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists