Re: [PATCH] mfd: Add WM8994 interrupt controller support

Previous thread: [git patch] libata fix by Jeff Garzik on Monday, March 29, 2010 - 1:22 pm. (1 message)

Next thread: [PATCH -tip 0/7] perf-probe updates - data-structure support improvements, etc. by Masami Hiramatsu on Monday, March 29, 2010 - 1:37 pm. (13 messages)
From: Mark Brown
Date: Monday, March 29, 2010 - 1:28 pm

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)	+= ...
From: Mark Brown
Date: Tuesday, March 30, 2010 - 7:12 am

Clearly this is debug code and shouldn't be there in an actual version.
I'll remove this when resubmitting after review & merge path are sorted
out.
--

From: Samuel Ortiz
Date: Friday, April 2, 2010 - 3:17 am

Hi Mark,

All right, I won't merge it for now.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--

From: Mark Brown
Date: Friday, April 2, 2010 - 3:24 am

Did you see the question in the original posting about where this should
be merged?  The bulk of the code using these interrupts will be the
CODEC driver for the device, but the CODEC driver needs to be able to
check if interrupts are set up at all (since commonly CODECs don't have
an IRQ line wired up) so it'd be nice if it were possible to merge via
ASoC.
--

From: Samuel Ortiz
Date: Friday, April 2, 2010 - 4:30 am

I'm fine with that, please carry this patch. During the next merge window I'll
wait for your code to be merged upstream, fix any potential merge conflicts
and send my pull request.
Also, I had a look at the code and feel free to add my:
Acked-by: Samuel Ortiz <sameo@linux.intel.com>

to it.

Cheers,
Samuel.


-- 
Intel Open Source Technology Centre
http://oss.intel.com/
--

From: Mark Brown
Date: Friday, April 2, 2010 - 4:44 am

Thanks.  I'd expect that if things are fine in -next you can probably
not worry about this either way, but given that Takashi normally sends
his pull request very early it probably won't make any difference
--

Previous thread: [git patch] libata fix by Jeff Garzik on Monday, March 29, 2010 - 1:22 pm. (1 message)

Next thread: [PATCH -tip 0/7] perf-probe updates - data-structure support improvements, etc. by Masami Hiramatsu on Monday, March 29, 2010 - 1:37 pm. (13 messages)