History log of /drivers/mfd/wm831x-irq.c
Revision Date Author Comments
334a41ce9b753ec615e8c6c50ee07d6197190610 30-Jul-2013 Jingoo Han <jg1.han@samsung.com> mfd: Use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
1fe17a24e2fe0a9554d19a4249eb2d80050ecb8c 18-May-2012 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Emulate active low IRQs as well as active high IRQs for wm831x

As with the existing emulation this should not be used in production
systems but is useful for test purposes.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
cd99758ba3bde64347a8ece381cbae2fb5c745b2 14-May-2012 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Convert wm831x to irq_domain

The modern idiom is to use irq_domain to allocate interrupts. This is
useful partly to allow further infrastructure to be based on the domains
and partly because it makes it much easier to allocate virtual interrupts
to devices as we don't need to allocate a contiguous range of interrupt
numbers.

Convert the wm831x driver over to this infrastructure, using a legacy
IRQ mapping if an irq_base is specified in platform data and otherwise
using a linear mapping, always registering the interrupts even if they
won't ever be used. Only boards which need to use the GPIOs as
interrupts should need to use an irq_base.

This means that we can't use the MFD irq_base management since the
unless we're using an explicit irq_base from platform data we can't rely
on a linear mapping of interrupts. Instead we need to map things via
the irq_domain - provide a conveniencem function wm831x_irq() to save a
small amount of typing when doing so. Looking at this I couldn't clearly
see anything the MFD core could do to make this nicer.

Since we're not supporting device tree yet there's no meaningful
advantage if we don't do this conversion in one, the fact that the
interrupt resources are used for repeated IP blocks makes accessor
functions for the irq_domain more trouble to do than they're worth.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
4492c4c3ff7bbb5fd400f021532643a3493f0723 13-May-2012 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Don't try to flag IRQ 0 as a wm831x wake source

If we've not got a primary IRQ we shouldn't be trying to flag IRQ 0 as a
wake source.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
953c7d025d97916e56fd6f1bd347e1c19fd7d5f5 27-Dec-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Still check other interrupts if we get a wm831x touchscreen IRQ

It is possible that we will see another interrupt triggering at the same
time as the touchscreen interrupts so it's still worth checking other
possible sources. Almost all of the win from the fast path comes from only
needing to read the primary register and saving the I/O costs.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12aef0ace3758594ab1fcfb027fa690246321e0d 14-Dec-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Remove unused wm831x_irq_data_to_mask_reg()

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
7583a213ec3bde3082547ee37ad96214513bc1cb 16-Sep-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Simulate active high IRQs with wm831x

In order to ease system integration provide a simulation of active high
IRQs on the GPIOs by polling the GPIO status when an IRQ is generated.

This isn't ideal on several fronts and will miss initially active IRQs in
the current implementation but it should work well for most cases.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
1693673fc003d3d5f80ae34b21e0480a1d8a36e3 09-Aug-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Remove spurious newlines from wm831x-irq.c

More annoying than usual as they're in the middle of a function.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
88c939770db375244b00ba92e901fa92677a7164 20-Jul-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Acknowlege all WM831x IRQs before we handle them

Ensure that we never have a window where we've handled an interrupt (and
therefore need to be notified of new events) but haven't yet told the
interrupt controller that this is the case (so any new events will be
discarded).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
08256712a2705f3ced3e54c3728932c9c39b58ad 22-Jun-2011 Dimitris Papastamos <dp@opensource.wolfsonmicro.com> mfd: Fix off by one in WM831x IRQ code

The GPIO IRQs aren't the first IRQs defined, we need to subtract the base
for the GPIOs as well to use them for array indexes.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
5c05a8d1f0105ada3cb04be5b70686fc6b272619 02-Jun-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Support dynamic allocation of IRQ range for wm831x

Use irq_allocate_desc() to get the IRQ range, which turns into a noop on
non-sparse systems. Since all existing users are non-sparse there should
be no compatibility issues.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
ca7a71824ac957b1b9d3322656c05aad38d7275c 02-Jun-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Fix bus lock interaction for WM831x IRQ set_type() operation

The WM831x IRQ set_type() operation is doing a direct register write when
called but since set_type() is called with the bus lock held this isn't
legal and could cause deadlocks in the IRQ core.

Fix this by posting the updates into an array and syncing in the
bus_sync_unlock() callback.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
bc86fcee373f27bffc9ed0c0a734e40ec084aef5 04-Apr-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Continue with IRQ setup even if we don't have PMIC main IRQ

The fact that we can't actually raise any interrupts doesn't stop us
setting up the IRQs we're exporting. While this isn't actually going
to do anything it allows us to proceed further through device setup
during board bringup and avoids issues with the MFD core not letting
us suppress the configuration of IRQ resources.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
d5bb122165981aed327845c32a9916d1b8ae0e4b 25-Mar-2011 Thomas Gleixner <tglx@linutronix.de> mfd: Cleanup irq namespace

Converted with coccinelle.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
f624effb7354814d062f149c8a1e2c46a44acb1f 01-Mar-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Convert WM831x interrupt masking to enable/disable operations

The WM831x interrupt masking support is a much better match for the genirq
enable and disable operations than for the mask and unmask operations. The
latter are intended to used during interrupt handling for temporary changes
which isn't really practical on a slow bus. Convert the operations over to
match this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
f66ea457f616258777cb3349f33745b0240e54fd 13-Feb-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Remove bitrotted genirq comment from wm831x IRQ code

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
8546bd4af1251d17d16b0ef682d84fd23c8beaca 01-Feb-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Add fast path for WM831x touchscreen interrupts

The WM831x interrupt controller provides reporting of the touchscreen
related interrupts in the primary interrupt status register as a
performance optimisation - use this to avoid reading the secondary
status registers for those interrupts.

For code simplicity and to avoid iterating over all interrupts we open
code for the two affected interrupt sources.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
b103e0b3c52e6edb4839ccc961cf335ca6b88918 21-Jan-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Support configuration of WM831x /IRQ output in CMOS mode

Provide platform data allowing the system to set the /IRQ pin into
CMOS mode rather than the default open drain. The default value of
this platform data reflects the default hardware configuration so
there should be no change to existing users.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
df508450870cd5b4478156dcde8e68e6bf0d6661 14-Jan-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Leave acknowledgement of WM831x touchscreen IRQs to the driver

The WM831x touchscreen interrupts need acknowledgement even when using
direct signals to the CPU (which don't go through the core) so leave
the acknowledgement up to the touchscreen driver for simplicity.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
180e4f5f20ef2b03ce2b38634274dde5ccbd8951 05-Jan-2011 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Flag WM831x /IRQ as a wake source

The WM831x can generate wake events, some unconditionally, so flag
the primary IRQ as a wake source in order to help the CPU treat the
/IRQ signal appropriately.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
25a947f805b4132b69f2561589e17a0fe45552b6 11-Dec-2010 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Convert Wolfson MFD drivers to use irq_data accessor function

Actually makes the code larger rathe rthan smaller but does provide some
isolation against core API changes.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
ba81cd393348b504ecc80d5fc363857f49410d5e 24-Nov-2010 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Convert WM831x to new irq_ interrupt methods

Kernel 2.6.37 adds new interrupt methods which take a struct irq_data
rather than an irq number. Convert over to these as they will become
mandatory in future.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
c9d66d3515bbb0ad8062721487de7ade02d2b936 16-Aug-2010 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Ignore non-GPIO IRQs when setting wm831x IRQ types

The driver was originally tested with an additional patch which
made this unneeded but that patch had issuges and got lost on the
way to mainline, causing problems when the errors are reported.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Cc: stable@kernel.org
0d7e0e399d7fcd5ddc3313a1aa2135fab3226d8f 05-Apr-2010 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Initialise WM831x IRQ masks on chip even if interrupts not in use

Ensure that the hardware has interrupts masked if we are not using
the interrupt controller on the WM831x by initialising the masks
before we check for the setup data required for the IRQ line. This
avoids signalling an unused IRQ line and improves the robustness
of checks that the IRQ is in use.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2a0cb351001bebf195d3c43d0f70441eb6a62652 26-Mar-2010 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Remove unused wm831x IRQ handler data

This was used by the old, pre-genirq IRQ implementation but is no
longer required.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
896060c76bdfd8a45eb33b3dd1a8307fe37f6c04 07-May-2010 Mark Brown <broonie@opensource.wolfsonmicro.com> ASoC: Use more idiomatic driver name for WM8731

Make dev_() prints much prettier.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
5fb4d38b19d95a5f980f0a10adba798f5b92128c 11-Nov-2009 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Move WM831x to generic IRQ

Replace the wm831x-local IRQ infrastructure with genirq, allowing access
to the diagnostic infrastructure of genirq and allowing us to implement
interrupt support for the GPIOs. The switchover is done within the
wm831x specific IRQ API, further patches will convert the individual
drivers to use genirq directly.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14f572fa38c55fbe369127b808a4a79b0bbec367 19-Oct-2009 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Always initialise WM831x IRQ mutex

This avoids crashes when running without interrupt support.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
7d4d0a3e7343e3190afaa17253073db58e3d9bff 27-Jul-2009 Mark Brown <broonie@opensource.wolfsonmicro.com> mfd: Add WM831x interrupt support

The WM831x includes an interrupt controller managing interrupts for
the various functions on the chip. This patch adds support for the
core interrupt block on the device.

Ideally this would be supported by genirq, particularly for the
GPIOs, but currently genirq is unable to cope with controllers on
interrupt driven buses so we cut'n'paste the generic interface.
Once genirq is able to cope chips like this it should be a case
of filing the prefixes off the code and redoing wm831x-irq.c to
move over.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>