Skip to contentSkip to conversation

soc: qcom: Add IRQ combiner driver

PATCH Superseded Agustin Vega-Frias 2 participants 2 messages Feb 23, 2016 – Mar 10, 2016

Subsystems (2)

v1 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc: qcom: Add IRQ combiner driver

Driver for interrupt combiners in the Top-level Control and Status Registers (TCSR) hardware block in Qualcomm Technologies chips.

An interrupt combiner in this block combines a set of interrupts by OR'ing the individual interrupt signals into a summary interrupt signal routed to a parent interrupt controller, and provides read- only, 32-bit registers to query the status of individual interrupts. The status bit for IRQ n is bit (n % 32) within register (n / 32) of the given combiner. Thus, each combiner can be described as a set of register offsets and the number of IRQs managed.

The combiner driver is implemented as a gpio_chip to allow consumers to find their IRQs using devm_gpiod_get_index/gpiod_to_irq under ACPI. This is done because the ACPI core does not use the Resource Source field on the Extended Interrupt Descriptor, which in theory could be used to specify an alternative IRQ controller similar to the way interrupt-parent is used in DT/OF. Under ACPI boot, consumers will specify their IRQs as GpioInt resources, which can be found with devm_gpiod_get_index, and then mapped to irqs by calling gpiod_to_irq.

---
 drivers/soc/qcom/Kconfig             |   8 +
 drivers/soc/qcom/Makefile            |   1 +
 drivers/soc/qcom/qcom_irq_combiner.c | 549 +++++++++++++++++++++++++++++++++++
 3 files changed, 558 insertions(+)
 create mode 100644 drivers/soc/qcom/qcom_irq_combiner.c
drivers/soc/qcom/Kconfig +8 -0
index 461b387..486048a 100644
@@ -76,3 +76,11 @@ config QCOM_WCNSS_CTRL
 	help
 	  Client driver for the WCNSS_CTRL SMD channel, used to download nv
 	  firmware to a newly booted WCNSS chip.
+
+config QCOM_IRQ_COMBINER
+	bool "QCOM IRQ combiner support"
+	depends on GPIOLIB && ARCH_QCOM
+	select GPIOLIB_IRQCHIP
+	help
+	  Say yes here to add support for the IRQ combiner devices embedded
+	  in Qualcomm Technologies chips.
drivers/soc/qcom/Makefile +1 -0
index fdd664e..f97bb88 100644
@@ -1,4 +1,5 @@
 obj-$(CONFIG_QCOM_GSBI)	+=	qcom_gsbi.o
+obj-$(CONFIG_QCOM_IRQ_COMBINER) += qcom_irq_combiner.o
 obj-$(CONFIG_QCOM_PM)	+=	spm.o
 obj-$(CONFIG_QCOM_SMD) +=	smd.o
 obj-$(CONFIG_QCOM_SMD_RPM)	+= smd-rpm.o
drivers/soc/qcom/qcom_irq_combiner.c new file +549 -0

549 lines not on this page · raw message

Signature · 3 lines
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
#1 lore raw
Quoted 12 lines · Agustin Vega-Frias <agustinv <at> codeaurora.org> writes:

Driver for interrupt combiners in the Top-level Control and Status Registers (TCSR) hardware block in Qualcomm Technologies chips.

An interrupt combiner in this block combines a set of interrupts by OR'ing the individual interrupt signals into a summary interrupt signal routed to a parent interrupt controller, and provides read- only, 32-bit registers to query the status of individual interrupts. The status bit for IRQ n is bit (n % 32) within register (n / 32) of the given combiner. Thus, each combiner can be described as a set of register offsets and the number of IRQs managed.

Quoted 8 lines

The combiner driver is implemented as a gpio_chip to allow consumers to find their IRQs using devm_gpiod_get_index/gpiod_to_irq under ACPI. This is done because the ACPI core does not use the Resource Source field on the Extended Interrupt Descriptor, which in theory could be used to specify an alternative IRQ controller similar to the way interrupt-parent is used in DT/OF. Under ACPI boot, consumers will specify their IRQs as GpioInt resources, which can be found with devm_gpiod_get_index, and then mapped to irqs by calling gpiod_to_irq.

[disclaimer: I've been pointed at this patch, and as I'm not subscribed to this ML, I'm replying through a horrible web interface.]

So you've noticed that the core ACPI is broken, but instead of addressing the issue, you are papering over it by adding something completely outlandish to the driver? And forcing users of this irqchip to use a completely alien API?

Let's be clear here. This is not a GPIO chip. This is an interrupt controller, please represent it as such. If the firmware interface is broken, please fix it.

Quoted 6 lines
Signed-off-by Agustin Vega-Frias <agustinv <at> codeaurora.org>
---
 drivers/soc/qcom/Kconfig             |   8 +
 drivers/soc/qcom/Makefile            |   1 +
 drivers/soc/qcom/qcom_irq_combiner.c | 549

+++++++++++++++++++++++++++++++++++

This is not where interrupt controllers live.

I am not going to do a patch review here, but just state what I'd like to see for v2:

- If ACPI has any issue, please address them, or get in touch with people who can help you addressing them
- Please copy the irqchip maintainers and LKML - this is where this code should be discussed
- Add a DT binding
- Copy the DT maintainers and the DT mailing list
- Move this code to where it actually belongs

Thanks,

        M.