The WM8994 has an interrupt controller which supports interrupts for
both CODEC and GPIO portions of the chip. Support this using genirq,
while allowing for systems that do not have an interrupt hooked up.
Wrapper functions are provided for the IRQ request and free to simplify
the code in consumer drivers when handling cases where IRQs are not
set up.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
Since the major consumer of this is going to be the CODEC driver for the
device it'd be very helpful if it were possible to merge this via ASoC,
but it's a relatively big change for that.
drivers/mfd/Kconfig | 4 +-
drivers/mfd/Makefile | 2 +-
drivers/mfd/wm8994-core.c | 38 +++++-
drivers/mfd/wm8994-irq.c | 268 ++++++++++++++++++++++++++++++++++++++
include/linux/mfd/wm8994/core.h | 53 ++++++++-
include/linux/mfd/wm8994/pdata.h | 1 +
6 files changed, 359 insertions(+), 7 deletions(-)
create mode 100644 drivers/mfd/wm8994-irq.c
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index b36249f..0dfcae2 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -301,9 +301,9 @@ config MFD_WM8350_I2C
selected to enable support for the functionality of the chip.
config MFD_WM8994
- tristate "Support Wolfson Microelectronics WM8994"
+ bool "Support Wolfson Microelectronics WM8994"
select MFD_CORE
- depends on I2C
+ depends on I2C=y && GENERIC_HARDIRQS
help
The WM8994 is a highly integrated hi-fi CODEC designed for
smartphone applicatiosn. As well as audio functionality it
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 80fdb63..f177e06 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -26,7 +26,7 @@ wm8350-objs := wm8350-core.o wm8350-regmap.o wm8350-gpio.o
wm8350-objs += wm8350-irq.o
obj-$(CONFIG_MFD_WM8350) += wm8350.o
obj-$(CONFIG_MFD_WM8350_I2C) += wm8350-i2c.o
-obj-$(CONFIG_MFD_WM8994) += ...