Skip to contentSkip to conversation

mfd: madera: Add irqchip data pointer into struct madera

PATCH Applied Richard Fitzgerald 2 participants 5 messages Aug 30, 2018 – Sep 10, 2018

Subsystems (3)
lore
Share & tools
lore

Richard Fitzgerald

author maintainer
#0 lore raw

PATCH v11 1/2 mfd: madera: Add irqchip data pointer into struct madera

Put the pointer to struct regmap_irq_chip_data into the parent mfd structure so that the child irqchip driver does not need a trivial private structure to store only this pointer. As the irqchip child driver already has a pointer to the parent struct madera it can use that to store the pointer. This also means that the irqchip driver does not need a double-indirection from its local struct to get at the parent struct madera.

---
 include/linux/mfd/madera/core.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/mfd/madera/core.h +2 -0
index c332681848ef..fe69c0f4398f 100644
@@ -148,6 +148,7 @@ struct snd_soc_dapm_context;
  * @internal_dcvdd:	true if DCVDD is supplied from the internal LDO1
  * @pdata:		our pdata
  * @irq_dev:		the irqchip child driver device
+ * @irq_data:		pointer to irqchip data for the child irqchip driver
  * @irq:		host irq number from SPI or I2C configuration
  * @out_clamp:		indicates output clamp state for each analogue output
  * @out_shorted:	indicates short circuit state for each analogue output
@@ -175,6 +176,7 @@ struct madera {
 	struct madera_pdata pdata;
 
 	struct device *irq_dev;
+	struct regmap_irq_chip_data *irq_data;
 	int irq;
 
 	unsigned int num_micbias;
Signature · 1 line
2.11.0
author maintainer
#1 lore raw

PATCH v11 2/2 irqchip: Add driver for Cirrus Logic Madera codecs

The Cirrus Logic Madera codecs (Cirrus Logic CS47L35/85/90/91 and WM1840) are highly complex devices containing up to 7 programmable DSPs and many other internal sources of interrupts plus a number of GPIOs that can be used as interrupt inputs. The large number (>150) of internal interrupt sources are managed by an on-board interrupt controller.

This driver provides the handling for the interrupt controller. As the codec is accessed via regmap, we can make use of the generic IRQ functionality from regmap to do most of the work. Only around half of the possible interrupt source are currently of interest from the driver so only this subset is defined. Others can be added in future if needed.

The KConfig options are not user-configurable because this driver is mandatory so is automatically included when the parent MFD driver is selected.

---
 MAINTAINERS                        |   2 +
 drivers/irqchip/Kconfig            |   3 +
 drivers/irqchip/Makefile           |   1 +
 drivers/irqchip/irq-madera.c       | 259 +++++++++++++++++++++++++++++++++++++
 include/linux/irqchip/irq-madera.h | 135 +++++++++++++++++++
 5 files changed, 400 insertions(+)
 create mode 100644 drivers/irqchip/irq-madera.c
 create mode 100644 include/linux/irqchip/irq-madera.h
MAINTAINERS +2 -0
index a5b256b25905..d20b81fcbc53 100644
@@ -3594,8 +3594,10 @@ W:	https://github.com/CirrusLogic/linux-drivers/wiki
 S:	Supported
 F:	Documentation/devicetree/bindings/mfd/madera.txt
 F:	Documentation/devicetree/bindings/pinctrl/cirrus,madera-pinctrl.txt
+F:	include/linux/irqchip/irq-madera*
 F:	include/linux/mfd/madera/*
 F:	drivers/gpio/gpio-madera*
+F:	drivers/irqchip/irq-madera*
 F:	drivers/mfd/madera*
 F:	drivers/mfd/cs47l*
 F:	drivers/pinctrl/cirrus/*
drivers/irqchip/Kconfig +3 -0
index 383e7b70221d..0afe6bdd2074 100644
@@ -150,6 +150,9 @@ config IMGPDC_IRQ
 	select GENERIC_IRQ_CHIP
 	select IRQ_DOMAIN
 
+config MADERA_IRQ
+	tristate
+
 config IRQ_MIPS_CPU
 	bool
 	select GENERIC_IRQ_CHIP
drivers/irqchip/Makefile +1 -0
index fbd1ec8070ef..97838212d8e4 100644
@@ -88,3 +88,4 @@ obj-$(CONFIG_GOLDFISH_PIC) 		+= irq-goldfish-pic.o
 obj-$(CONFIG_NDS32)			+= irq-ativic32.o
 obj-$(CONFIG_QCOM_PDC)			+= qcom-pdc.o
 obj-$(CONFIG_SIFIVE_PLIC)		+= irq-sifive-plic.o
+obj-$(CONFIG_MADERA_IRQ)		+= irq-madera.o
drivers/irqchip/irq-madera.c new file +259 -0

259 lines not on this page · raw message

include/linux/irqchip/irq-madera.h new file +135 -0

135 lines not on this page · raw message

Signature · 1 line
2.11.0
Applied
#2 lore raw
In reply to Richard Fitzgerald
Quoted 8 lines · Richard Fitzgerald

Put the pointer to struct regmap_irq_chip_data into the parent mfd structure so that the child irqchip driver does not need a trivial private structure to store only this pointer. As the irqchip child driver already has a pointer to the parent struct madera it can use that to store the pointer. This also means that the irqchip driver does not need a double-indirection from its local struct to get at the parent struct madera.

Quoted 4 lines
---
 include/linux/mfd/madera/core.h | 2 ++
 1 file changed, 2 insertions(+)

Applied, thanks.

Will follow-up with a PR shortly.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#3 lore raw
In reply to Richard Fitzgerald

Enjoy!

The following changes since commit 5b394b2ddf0347bef56e50c69a58773c94343ff3:

Linux 4.19-rc1 (2018-08-26 14:11:59 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-irqchip-v4.20

for you to fetch changes up to d31ca7e5d0fa066d59540859af32ab6f95adb519:

mfd: madera: Add irqchip data pointer into struct madera (2018-09-10 16:43:27 +0100)

----------------------------------------------------------------
Immutable branch between MFD and IRQChip due for the v4.20 merge window

----------------------------------------------------------------
Richard Fitzgerald (1):
mfd: madera: Add irqchip data pointer into struct madera

 include/linux/mfd/madera/core.h | 2 ++
 1 file changed, 2 insertions(+)
Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#4 lore raw

[GIT PULL] Immutable branch between MFD and IRQChip due for the v4.20 merge window

[Resending with correct subject line this time]

Enjoy!

The following changes since commit 5b394b2ddf0347bef56e50c69a58773c94343ff3:

Linux 4.19-rc1 (2018-08-26 14:11:59 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git ib-mfd-irqchip-v4.20

for you to fetch changes up to d31ca7e5d0fa066d59540859af32ab6f95adb519:

mfd: madera: Add irqchip data pointer into struct madera (2018-09-10 16:43:27 +0100)

----------------------------------------------------------------
Immutable branch between MFD and IRQChip due for the v4.20 merge window

----------------------------------------------------------------
Richard Fitzgerald (1):
mfd: madera: Add irqchip data pointer into struct madera

 include/linux/mfd/madera/core.h | 2 ++
 1 file changed, 2 insertions(+)
Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog