History log of /linux-master/drivers/mfd/arizona-irq.c
Revision Date Author Comments
# fe6df2b4 06-Apr-2021 Dinghao Liu <dinghao.liu@zju.edu.cn>

mfd: arizona: Fix rumtime PM imbalance on error

pm_runtime_get_sync() will increase the rumtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# d2912cb1 04-Jun-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500

Based on 2 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license version 2 as
published by the free software foundation #

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 4122 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Enrico Weigelt <info@metux.net>
Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 39c3fd58 02-Dec-2017 Andrew Lunn <andrew@lunn.ch>

kernel/irq: Extend lockdep class for request mutex

The IRQ code already has support for lockdep class for the lock mutex
in an interrupt descriptor. Extend this to add a second class for the
request mutex in the descriptor. Not having a class is resulting in
false positive splats in some code paths.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: linus.walleij@linaro.org
Cc: grygorii.strashko@ti.com
Cc: f.fainelli@gmail.com
Link: https://lkml.kernel.org/r/1512234664-21555-1-git-send-email-andrew@lunn.ch


# 3dfaff27 22-Nov-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: arizona: Correctly clean up after IRQs

Currently we leak a lot of things when tearing down the IRQs this patch
fixes this cleaning up both the IRQ mappings and the IRQ domain itself.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 1a86dcb3 22-Nov-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: arizona: Add defines for IRQs on the main Arizona IRQ domain

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 003db34e 22-Nov-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: arizona: Use arizona_map_irq instead of hard coding it

We have arizona_map_irq we might as well use it rather than hard coding
it in several places.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# d34bffb5 28-Oct-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: arizona: Use irq_find_mapping when appropriate

No need to use irq_create_mapping (although there is no issue with
doing so) when we are only looking up an existing mapping. Just to
streamline things a little and make the code a little more clear
change some calls from irq_create_mapping to irq_find_mapping.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 1f2c3972 15-Jun-2016 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

mfd: arizona: Check if AOD interrupts are pending before dispatching

Previously the arizona_irq_thread implementation would call
handle_nested_irqs() to handle AOD interrupts without checking if any
were actually pending. The kernel will see these as spurious IRQs and
will eventually disable the IRQ.

This patch ensures we only launch the nested handler if there are AOD
interrupts pending in the codec.

Signed-off-by: Simon Trimmer <simont@opensource.wolfsonmicro.com>
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# dedf24a2 25-Mar-2016 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: arizona: Fix lockdep recursion warning on set_irq_wake

Avoid a false recursive locking warning from lockdep by adding a lock
class for the arizona IRQ chip.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 6c006b1b 16-Dec-2015 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: arizona: Request parent IRQ before we request child IRQs

Currently the driver requests the boot done and control interface IRQs
before it has requested its own IRQ line. This can cause problems on
edge triggered IRQ systems as if an edge occurs before the parent IRQ is
enabled it will be missed. Whilst we are changing the error handling
remove an unused label as well.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# ea1f3339 03-Nov-2015 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

mfd: arizona: Support Cirrus Logic CS47L24 and WM1831

This patch adds the regmap configuration tables and
core MFD handling for the CS47L24 and WM1831 codecs.

Note that compared to the other Arizona codecs, these devices
do not have an LDO1 or micsupp regulators, extcon driver, or
the DCVDD isolation control.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 0a464dfd 11-Sep-2015 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: arizona: Fix typo in arizona_irq_map

The type of the data for the main Arizona IRQ chip should be struct
arizona not struct regmap_irq_chip_data. The bug is harmless but should
probably be corrected anyway.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 9bd09f34 27-Jul-2015 Rob Herring <robh@kernel.org>

mfd: Kill off set_irq_flags usage

set_irq_flags is ARM specific with custom flags which have genirq
equivalents. Convert drivers to use the genirq interfaces directly, so we
can kill off set_irq_flags. The translation of flags is as follows:

IRQF_VALID -> !IRQ_NOREQUEST
IRQF_PROBE -> !IRQ_NOPROBE
IRQF_NOAUTOEN -> IRQ_NOAUTOEN

For IRQs managed by an irqdomain, the irqdomain core code handles clearing
and setting IRQ_NOREQUEST already, so there is no need to do this in
.map() functions and we can simply remove the set_irq_flags calls. Some
users also modify IRQ_NOPROBE and this has been maintained although it
is not clear that is really needed. There appears to be a great deal of
blind copy and paste of this code.

Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 6887b042 03-Jul-2015 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

mfd: arizona: Add support for WM8998 and WM1814

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 7ce7b26f 27-Apr-2015 Krzysztof Kozlowski <krzk@kernel.org>

mfd: Constify regmap and irq configuration data

Constify in various drivers configuration data which is not modified:
- regmap_irq_chip,
- individual regmap_irq's in array,
- regmap_config,
- irq_domain_ops,

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# e5d4ef0d 17-Jan-2015 Richard Fitzgerald <rf@opensource.wolfsonmicro.com>

mfd: arizona: Add support for WM8280/WM8281

This adds support for the Wolfson Microelectronics WM8280 and WM8281
codecs.

Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
[Lee: Minor fixup to remove potentially uninitialised variable. ]
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# cfeb35da 09-Sep-2014 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: arizona: Use handle_simple_irq for IRQ dispatch chip

We use a dummy IRQ chip to dispatch interrupts to the two seperate IRQ
domains on the Arizona devices. This is just a simple software IRQ chip
and thus the current handle_edge_irq is unnecessary for its needs.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# c38715fe 01-Sep-2014 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: arizona: Propagate irq_wake through to parent IRQ

If one of the internal Arizona IRQs is set as a wake source this needs
to be propogated back to the actual IRQ line that the Arizona device is
attached to.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 2a3377ee 12-Aug-2014 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: arizona: Avoid use of legacy IRQ mapping

regmap_add_irq_chip is called from arizona_irq_init with the irq_base
specified as -1 and regmap_add_irq_chip uses if (irq_base) to check if
it should use legacy IRQ mapping. As such the irq mappings are currently
added with irq_domain_add_legacy, rather than irq_domain_add_linear.
This is clearly a typo as there is no reason why this driver can't use
irq_domain_add_linear.

This patch corrects this by passing the irq_base as zero to
regmap_add_irq_chip.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 30a2af3a 15-Jul-2014 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: arizona: Only free the CTRLIF_ERR IRQ if we requested it

We only request the control interface error IRQ if we set ctrlif_error,
as such we should only free it in that situation. Otherwise we will
attempt to free an IRQ we never requested and get a warning from the IRQ
core.

This patch moves the ctrlif_error variable into the arizona structure
and checks it in all cases we free the control interface error IRQ.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# 3215501f 15-Jul-2014 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: wm5110: Add new interrupt register definitions

Newer versions of the IP have a lot of new interrupts and move several
existing interrupts. This patch adds the register definitions and regmap
hookup for these interrupts.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# d1cb4cc9 19-May-2014 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: arizona: Correct error message for addition of main IRQ chip

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>


# dc7d4863 13-Jun-2013 Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

mfd: arizona: Integrate wm8997 into Arizona mfd

The wm8997 is a compact, high-performance audio hub CODEC with SLIMbus
interfacing, for smartphones, tablets and other portable audio devices
based on the Arizona platform.

This patch integrates the wm8997 into the Arizona mfd.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>


# 22c75fe7 24-Mar-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: arizona: Try to use interrupt flags from interrupt controller

If no irq_flags are passed in platform data then query the interrupt
controller for the trigger type and try to use that. This provides
default operation with a wider range of hardware and will be needed
for device tree support where the interrupt flags are configured on
the interrupt controller.

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


# 3092f805 24-Mar-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: arizona: Allow GPIO to be specified for IRQ line

If a GPIO is specified for the chip IRQ line then request it. This
improves support for systems that do not put pins into input mode when
used as interrupts.

Also use this GPIO when the primary IRQ is in edge triggered mode to
detect if we have handled pending interrupts in order to improve
robustness.

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


# f8a0941f 21-Mar-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: arizona: Basic support for edge triggered IRQs

Allow the user to configure edge triggered IRQs, though we do not yet
fully handle new interrupts occurring while an interrupt is being handled.

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


# 7994c664 19-Mar-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: arizona: Clarify error message for failed primary IRQ request

regmap has a very similar looking error, help identify where the error
comes from by changing the error message.

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


# 1816cb34 17-Jan-2013 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: arizona: Disable all wake sources by default

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


# e1bfe75d 04-Dec-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: arizona: Disable control interface reporting for WM5102 and WM5110

Rather than disabling the error reporting only for earlier revisions
unconditionally disable it.

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


# b7dea5dc 04-Dec-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: arizona: Log if we fail to create the primary IRQ domain

This is the only thing in probe for which we don't log an error.

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


# 944b0582 19-Nov-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: wm5110: Disable control interface error report for WM5110 rev B

It can misreport.

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


# 46ae368b 26-Sep-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: wm5110: Disable control interface error report for WM5110 rev B

It can misreport.

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


# cdabc1c8 07-Sep-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: arizona: Remove unused variable

Left over as bitrot from previous changes.

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


# 3080de4e 21-Aug-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: arizona: Suppress needless calls to the primary IRQ

We can read back if the primary IRQ is asserted from the register map,
meaning that we can suppress polling of the interrupt status registers
when only the AoD IRQ domain is asserting.

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


# 92d80139 07-Aug-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: arizona: Disable control interface error reporting for early devices

Early revisions of the initial Arizona-based devices can generate spurious
control interface errors in certain circumstances. Avoid causing confusion
by disabling the control interface error reporting on these devices.

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


# e102befe 09-Jul-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: Initial support for the WM5110

The WM5110 is a highly-integrated low-power audio system for smartphones,
tablets and other portable audio devices. It combines an advanced DSP
feature set with a flexible, high-performance audio hub CODEC.

The support is based on the Arizona core driver.

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


# 863df8d5 05-Jul-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: Add missing WM5102 ifdefs

References to the WM5102 tables need to be guarded.

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


# 966cdc96 19-Jun-2012 Mark Brown <broonie@opensource.wolfsonmicro.com>

mfd: arizona: Interrupt support

Several forthcoming Wolfson devices are based on a common platform
known as Arizona allowing a great deal of reuse of driver code. This
patch adds support for the interrupt controller on Arizona class devices.
Since there are two interrupt domains in the device which share a single
/IRQ pin by default we use two regmap IRQ domains with a trivial demux
interrupt domain used to distribute the interrupts to the two devices.
The devices do support multiple interrupt signals, future work will enable
support for using this feature to avoid the demux.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>