Use irq_alloc_descs() to get the IRQ number range dynamically instead of
the hardwired use if pdata->irq_base.
The twl6040 only provides interrupts for it's internal components which
means that it is not working as an IRQ expander type of device.
The client drivers will receive their interrupt numbers as resource which
is configured based on the received IRQ range we got from irq_alloc_descs()
Signed-off-by: Peter Ujfalusi <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
No functional change, just to make the code a bit more uniform and
remove wrapped lines.
Signed-off-by: Peter Ujfalusi <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
This patch will allow the ab8500-gpadc driver to be probed during
Device Tree enabled boot.
Signed-off-by: Lee Jones <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Before this patch if probe failed to find the platform IRQ it
would attempt to print a message out using dev_err, which in
turn was being passed an unassigned pointer. This patch
ensures the information passed to dev_err is correct.
Signed-off-by: Lee Jones <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Allow the ab8500-debugfs driver to be probed during DT start-up.
Signed-off-by: Lee Jones <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
This patch will allow the ab8500-core driver to be probed and set up
when booting when Device Tree is enabled. This includes platform ID
look-up which identifies the machine it is currently running on. If
we are undergoing a DT enabled boot, we will refuse to setup each of
the other ab8500-* devices, as they will be probed individually by DT.
Signed-off-by: Lee Jones <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
ab8500-i2c is used as core code to register the ab8500 device.
After allocating ab8500 memory, it immediately calls into
ab8500-core where the real initialisation takes place. This
patch moves all core registration and memory allocation into
the true ab8500-core file and removes ab8500-i2c completely.
Signed-off-by: Lee Jones <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Since the core is not usable without one of the bus modules it should not
be presented in the UI but should instead be selected by the bus modules.
Signed-off-by: Samuel Ortiz <[email protected]>
Fix double free in probe error path introduced by the recent conversion
of wm8350 to use regmap.
Signed-off-by: Johan Hovold <[email protected]>
Acked-by: Mark Brown <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
This patch adds ADC support to the DA9052/53 core.
Tested on smdkv6410 and i.mx53 QS boards.
Signed-off-by: Ashish Jangam <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
This change changes the tps65910-irq code to use irqdomain, and support
initialization from devicetree. This assumes that the irq_base in the
platform data is -1 if devicetree is used.
Signed-off-by: Rhyland Klein <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
- rename to anatop_read_reg and anatop_write_reg
- anatop_read_reg directly return reg value
- anatop_write_reg write reg with mask
Signed-off-by: Richard Zhao <[email protected]>
Reviewed-by: Ying-Chun Liu (PaulLiu) <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
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 <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
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 <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
This patch adds MFD driver for MAX77693 to enable its sub devices.
The MAX77693 is a multi-function devices. It includes PMIC,
MUIC(Micro USB Interface Controller), flash LED control and
haptic motor control.
Signed-off-by: Chanwoo Choi <[email protected]>
Signed-off-by: Myungjoo Ham <[email protected]>
Signed-off-by: Kyungmin Park <[email protected]>
Reviewed-by: Mark Brown <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
This is supposed to be umode_t. It causes a GCC warning:
drivers/mfd/lm3533-core.c:440:2: warning: initialization from incompatible pointer type [enabled by default]
drivers/mfd/lm3533-core.c:440:2: warning: (near initialization for ‘lm3533_attribute_group.is_visible’) [enabled by default]
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
The name of the tunnelcreek watchdog device is not tunnelcreek_wdt but
ie6xx_wdt.
Signed-off-by: Wim Van Sebroeck <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Current code calls regmap_update_bits() with mask and val arguments swapped.
Signed-off-by: Axel Lin <[email protected]>
Acked-by: Johan Hovold <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Use SI-units (uA) for max-current interface (5000 - 29800 uA).
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
The max-current attributes of the subdrivers have been dropped so
remove the no longer used lm3533_ctrlbank_get_max_current function.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Remove boost-frequency and ovp attributes, which can be set through
platform data, from sysfs.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Add boost-frequency and over-voltage-protection settings to platform
data.
Signed-off-by: Johan Hovold <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Save a useful amount of code by removing the custom cache implementation
for wm8400 and using the regmap cache. Also simplify things by not
separately reseting the CODEC registers, this is a sufficiently infrequent
operation that we can simply invalidate the entire cache when this happens.
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
The tps65910_parse_dt() prototype for !CONFIG_OF was not correct, leading to:
drivers/mfd/tps65910.c: In function ‘tps65910_i2c_probe’:
drivers/mfd/tps65910.c:218:3: error: too many arguments to function ‘tps65910_parse_dt’
Signed-off-by: Samuel Ortiz <[email protected]>
As gpio support for tps65910 is on gpio driver, registering
gpio support as the mfd sub devices instead of calling gpio_init()
from the core probe.
Signed-off-by: Laxman Dewangan <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Convert memory allocation and regmap initialization to
use devm_* functions.
Signed-off-by: Laxman Dewangan <[email protected]>
Reviewed-by: Mark Brown <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
During regmap initialization, we do not provide the default value and
hence in place of caching register during regmap_init(), cache it
when actually we need it i.e. after reading of that register.
Signed-off-by: Laxman Dewangan <[email protected]>
Reviewed-by: Mark Brown <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
twl-regulator has a collection of feature flags, some defined
in twl-core.c and one defined in i2c/twl.h.
This is confusing for anyone adding a new feature flag.
So collect them together and place them in twl.h immediately
after the structure in which they are initially set.
Signed-off-by: NeilBrown <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Add device tree based initialization support for TI's tps65910 pmic.
Signed-off-by: Rhyland Klein <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
This change removes the read/write callback functions in favor of common
regmap accessors inside the header file. This change also makes use of
regmap_read/write for single register access which maps better onto what this
driver actually needs.
Signed-off-by: Rhyland Klein <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
Palmas is a PMIC from Texas Instruments and this is the MFD part of the
driver for this chip. The PMIC has SMPS and LDO regulators, a general
purpose ADC, GPIO, USB OTG mode detection, watchdog and RTC features.
Signed-off-by: Graeme Gregory <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Take advantage of the new regmap irq_domain support to dynamically
allocate interrupts, using regmap_irq_get_virq() rather than irq_base
to look up the interrupts. This means that most users should not need
to specify an irq_base at all.
Signed-off-by: Mark Brown <[email protected]>
Acked-by: Samuel Ortiz <[email protected]>
This gets us up to date with the recommended current kernel infrastructure
and should transparently give us device tree interrupt bindings for any
devices using the framework. If an explicit IRQ mapping is passed in then
a legacy interrupt range is created, otherwise a simple linear mapping is
used. Previously a mapping was mandatory so existing drivers should not
be affected.
A function regmap_irq_get_virq() is provided to allow drivers to map
individual IRQs which should be used in preference to the existing
regmap_irq_chip_get_base() which is only valid if a legacy IRQ range is
provided.
Signed-off-by: Mark Brown <[email protected]>
Rather than using the pointer passed back by the regmap API (or complaining
because that wasn't actually being set) the da9052 driver was having some
fun and games peering through genirq and regmap internals. Fix the driver
to use the API as expected.
Signed-off-by: Mark Brown <[email protected]>
Hierarchical interrupt is supported since ab8500 V2.
However, it is not implemented in the ab8500-core driver.
With the current implementation, when an ab9540 interrupt
occurs, 17 Latch registers are read through i2c. With
hierarchical interrupt implementation, there are only 4 i2c
accesses.
Signed-off-by: Maxime Coquelin <[email protected]>
Reviewed-by: Michel Jaouen <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
twl6040 has three power supply source:
VBAT needs to be connected to VBAT, VIO, and V2V1.
Add regulator support for the VIO, V2V1 supplies.
Initially handle the two supply together with bulk commands.
Signed-off-by: Peter Ujfalusi <[email protected]>
Reviewed-by: Mark Brown <[email protected]>
Signed-off-by: Tero Kristo <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>