From: "tip-bot2 for Aniket Limaye" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Aniket Limaye <a-limaye@ti.com>,
Thomas Gleixner <tglx@kernel.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: irq/drivers] irqchip/ti-sci-intr: Allow parsing interrupt-types per-line
Date: Mon, 26 Jan 2026 15:41:12 -0000 [thread overview]
Message-ID: <176944207229.510.8507537492169657639.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260123-ul-driver-i2c-j722s-v4-2-b08625c487d5@ti.com>
The following commit has been merged into the irq/drivers branch of tip:
Commit-ID: 3d9617ea8ab5ca779a227d1e7d23741f5f8400c1
Gitweb: https://git.kernel.org/tip/3d9617ea8ab5ca779a227d1e7d23741f5f8400c1
Author: Aniket Limaye <a-limaye@ti.com>
AuthorDate: Fri, 23 Jan 2026 12:25:46 +05:30
Committer: Thomas Gleixner <tglx@kernel.org>
CommitterDate: Mon, 26 Jan 2026 16:40:04 +01:00
irqchip/ti-sci-intr: Allow parsing interrupt-types per-line
Some INTR router instances act as simple passthroughs that preserve the
source interrupt type unchanged at the output line, rather than
converting all interrupts to a fixed type.
When interrupt sources are not homogeneous with respect to trigger type,
the driver needs to read each source's interrupt type from DT and pass
it unchanged to its interrupt parent.
Add support to check for absence of "ti,intr-trigger-type" to indicate
passthrough mode. When this property is absent, parse interrupt type
per-line from the DT fwspec provided by the interrupt source. Else, use
the global setting for all interrupt lines.
Signed-off-by: Aniket Limaye <a-limaye@ti.com>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260123-ul-driver-i2c-j722s-v4-2-b08625c487d5@ti.com
---
drivers/irqchip/irq-ti-sci-intr.c | 54 ++++++++++++++++++++----------
1 file changed, 36 insertions(+), 18 deletions(-)
diff --git a/drivers/irqchip/irq-ti-sci-intr.c b/drivers/irqchip/irq-ti-sci-intr.c
index 354613e..0ea1704 100644
--- a/drivers/irqchip/irq-ti-sci-intr.c
+++ b/drivers/irqchip/irq-ti-sci-intr.c
@@ -61,12 +61,21 @@ static int ti_sci_intr_irq_domain_translate(struct irq_domain *domain,
{
struct ti_sci_intr_irq_domain *intr = domain->host_data;
- if (fwspec->param_count != 1)
- return -EINVAL;
+ if (intr->type) {
+ /* Global interrupt-type */
+ if (fwspec->param_count != 1)
+ return -EINVAL;
- *hwirq = fwspec->param[0];
- *type = intr->type;
+ *hwirq = fwspec->param[0];
+ *type = intr->type;
+ } else {
+ /* Per-Line interrupt-type */
+ if (fwspec->param_count != 2)
+ return -EINVAL;
+ *hwirq = fwspec->param[0];
+ *type = fwspec->param[1];
+ }
return 0;
}
@@ -128,11 +137,12 @@ static void ti_sci_intr_irq_domain_free(struct irq_domain *domain,
* @domain: Pointer to the interrupt router IRQ domain
* @virq: Corresponding Linux virtual IRQ number
* @hwirq: Corresponding hwirq for the IRQ within this IRQ domain
+ * @hwirq_type: Corresponding hwirq trigger type for the IRQ within this IRQ domain
*
* Returns intr output irq if all went well else appropriate error pointer.
*/
-static int ti_sci_intr_alloc_parent_irq(struct irq_domain *domain,
- unsigned int virq, u32 hwirq)
+static int ti_sci_intr_alloc_parent_irq(struct irq_domain *domain, unsigned int virq,
+ u32 hwirq, u32 hwirq_type)
{
struct ti_sci_intr_irq_domain *intr = domain->host_data;
struct device_node *parent_node;
@@ -156,11 +166,22 @@ static int ti_sci_intr_alloc_parent_irq(struct irq_domain *domain,
fwspec.param_count = 3;
fwspec.param[0] = 0; /* SPI */
fwspec.param[1] = p_hwirq - 32; /* SPI offset */
- fwspec.param[2] = intr->type;
+ fwspec.param[2] = hwirq_type;
} else {
/* Parent is Interrupt Router */
- fwspec.param_count = 1;
- fwspec.param[0] = p_hwirq;
+ u32 parent_trigger_type;
+
+ if (!of_property_read_u32(parent_node, "ti,intr-trigger-type",
+ &parent_trigger_type)) {
+ /* Parent has global trigger type */
+ fwspec.param_count = 1;
+ fwspec.param[0] = p_hwirq;
+ } else {
+ /* Parent supports per-line trigger types */
+ fwspec.param_count = 2;
+ fwspec.param[0] = p_hwirq;
+ fwspec.param[1] = hwirq_type;
+ }
}
err = irq_domain_alloc_irqs_parent(domain, virq, 1, &fwspec);
@@ -196,15 +217,15 @@ static int ti_sci_intr_irq_domain_alloc(struct irq_domain *domain,
void *data)
{
struct irq_fwspec *fwspec = data;
+ unsigned int hwirq_type;
unsigned long hwirq;
- unsigned int flags;
int err, out_irq;
- err = ti_sci_intr_irq_domain_translate(domain, fwspec, &hwirq, &flags);
+ err = ti_sci_intr_irq_domain_translate(domain, fwspec, &hwirq, &hwirq_type);
if (err)
return err;
- out_irq = ti_sci_intr_alloc_parent_irq(domain, virq, hwirq);
+ out_irq = ti_sci_intr_alloc_parent_irq(domain, virq, hwirq, hwirq_type);
if (out_irq < 0)
return out_irq;
@@ -247,12 +268,9 @@ static int ti_sci_intr_irq_domain_probe(struct platform_device *pdev)
return -ENOMEM;
intr->dev = dev;
- ret = of_property_read_u32(dev_of_node(dev), "ti,intr-trigger-type",
- &intr->type);
- if (ret) {
- dev_err(dev, "missing ti,intr-trigger-type property\n");
- return -EINVAL;
- }
+
+ if (of_property_read_u32(dev_of_node(dev), "ti,intr-trigger-type", &intr->type))
+ intr->type = IRQ_TYPE_NONE;
intr->sci = devm_ti_sci_get_by_phandle(dev, "ti,sci");
if (IS_ERR(intr->sci))
prev parent reply other threads:[~2026-01-26 15:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-23 6:55 [PATCH v4 0/2] ti-sci-intr: Support level+pulse interrupt sources together Aniket Limaye
2026-01-23 6:55 ` [PATCH v4 1/2] dt-bindings: interrupt-controller: ti,sci-intr: Per-line interrupt-types Aniket Limaye
2026-01-26 15:41 ` [tip: irq/drivers] " tip-bot2 for Aniket Limaye
2026-01-23 6:55 ` [PATCH v4 2/2] irqchip/ti-sci-intr: Allow parsing interrupt-types per-line Aniket Limaye
2026-01-26 15:41 ` tip-bot2 for Aniket Limaye [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=176944207229.510.8507537492169657639.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=a-limaye@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=tglx@kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®