Commit Graph

1423 Commits (e03088972f6e38e90077eaf09acf7b8a327a2da2)

Author SHA1 Message Date
Lee Jones 01247ef7ec mfd: Enable Device Tree support in the ab8500-sysctrl driver
This patch ensures probing of the ab8500-sysctrl driver during a DT
enabled boot, so long as the associated nodes are present in the
Device Tree binary.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:13 +02:00
Peter Ujfalusi 37e13cecaa mfd: Add support for Device Tree to twl6040
Device tree based probing support for the core twl6040 driver. Child
devices will be created as MFD devices:
- ASoC codec is always created
- Vibra child is only created if the vibra section present in the DT blob.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:12 +02:00
Peter Ujfalusi 1f01d60e4c mfd: Register the twl6040 child for the ASoC codec unconditionally
The main function of the twl6040 is to provide audio on OMAP4+ platforms.
Since the ASoC codec driver can work without the pdata we can register the
child to load the codec driver whenever the twl6040 MFD driver is loaded.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:12 +02:00
Peter Ujfalusi 6712419d69 mfd: Allocate twl6040 IRQ numbers dynamically
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 <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:12 +02:00
Peter Ujfalusi 68029c6cf9 mfd: twl6040 code cleanup in interrupt initialization part
No functional change, just to make the code a bit more uniform and
remove wrapped lines.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:11 +02:00
Lee Jones 3690fb2ca5 mfd: Enable ab8500-gpadc driver for Device Tree
This patch will allow the ab8500-gpadc driver to be probed during
Device Tree enabled boot.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:11 +02:00
Lee Jones 6dff11e5ab mfd: Prevent unassigned pointer from being used in ab8500-gpadc driver
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 <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:11 +02:00
Lee Jones 5a8fea031e mfd: Enable ab8500-debug when Device Tree is enabled
Allow the ab8500-debugfs driver to be probed during DT start-up.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:10 +02:00
Lee Jones 6bc4a56841 mfd: Enable Device Tree for ab8500-core driver
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 <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:10 +02:00
Lee Jones d28f1db818 mfd: Remove confusing ab8500-i2c file and merge into ab8500-core
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 <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:10 +02:00
Mark Brown 1cb3642a68 mfd: mc13xxx core should not be user visible
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 <sameo@linux.intel.com>
2012-05-20 17:27:09 +02:00
Johan Hovold 65ee362cb2 mfd: Fix double free in wm8350 error path
Fix double free in probe error path introduced by the recent conversion
of wm8350 to use regmap.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:09 +02:00
Johan Hovold fa648e51f8 mfd: Convert lm3533 to use devres
Use devres to manage core driver data and regmap.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:08 +02:00
Ashish Jangam 16e5e204c9 mfd: Add ADC support to the DA9052/53 core
This patch adds ADC support to the DA9052/53 core.

Tested on smdkv6410 and i.mx53 QS boards.

Signed-off-by: Ashish Jangam <ashish.jangam@kpitcummins.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:08 +02:00
Rhyland Klein 21f7541d88 mfd: Add tps65910-irq devicetree init and irqdomain support
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 <rklein@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:08 +02:00
Richard Zhao b09530ef84 mfd: Make anatop register accessor more flexible and rename meaningfully
- 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 <richard.zhao@freescale.com>
Reviewed-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:07 +02:00
Mark Brown 08b4c118af mfd: wm8400 needs to depend on I2C=y
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:07 +02:00
Mark Brown cd99758ba3 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>
2012-05-20 17:27:07 +02:00
Mark Brown 4492c4c3ff 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>
2012-05-20 17:27:06 +02:00
Chanwoo Choi 6592ebb397 mfd: Add MAX77693 irq handler
This patch supports IRQ handling for MAX77693.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:06 +02:00
Chanwoo Choi 83871c00bb mfd: Add MAX77693 driver
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 <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:05 +02:00
Mark Brown ebd29c6cc0 mfd: Export wm8400_block_read()
Used by the regulator driver.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:05 +02:00
Mark Brown eee0e4b44f mfd: Don't support non-modular wm8400 build
It's relying on non-exported symbols.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:05 +02:00
Dan Carpenter 168755ebb1 mfd: Silence an lm3533 gcc warning
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 <dan.carpenter@oracle.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:04 +02:00
Axel Lin aa4603a0a7 mfd: Convert pcf50633-core to use devm_* APIs
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:04 +02:00
Axel Lin 6608a5e2dd mfd: Convert da9052 to use devm_* APIs
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:03 +02:00
Wim Van Sebroeck 805b237a63 mfd: Change tunnelcreek watchdog name on the lpc_sch subdevices array
The name of the tunnelcreek watchdog device is not tunnelcreek_wdt but
ie6xx_wdt.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:03 +02:00
Axel Lin 664dd0665e mfd: Fix lm3533 regmap_update_bits() call
Current code calls regmap_update_bits() with mask and val arguments swapped.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:02 +02:00
Johan Hovold 6fa4b9d802 mfd: Use SI-units for the lm3533 max-current interface
Use SI-units (uA) for max-current interface (5000 - 29800 uA).

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:02 +02:00
Johan Hovold 7af5e87dc5 mfd: Remove unused max-current lm3533 function
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 <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:02 +02:00
Johan Hovold f4cf18ca59 mfd: Remove lm3533 boost attributes
Remove boost-frequency and ovp attributes, which can be set through
platform data, from sysfs.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:01 +02:00
Johan Hovold d9055dc501 mfd: Add boost frequency and ovp to lm3533 platform data
Add boost-frequency and over-voltage-protection settings to platform
data.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:01 +02:00
Mark Brown 879eed6826 mfd: Remove wm8400 custom cache implementation
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 <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:01 +02:00
Mark Brown 27757e8262 mfd: Staticise non-exported tps65217_update_bits()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: AnilKumar Ch <anilkumar@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:27:00 +02:00
Samuel Ortiz 7f65f74cce mfd: Fix tps65910 build failure
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 <sameo@linux.intel.com>
2012-05-20 17:27:00 +02:00
Laxman Dewangan 32df986e98 mfd: Register tps65910 gpios as an mfd device
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 <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:26:59 +02:00
Laxman Dewangan 63fe7dee91 mfd: Convert all tps65910 allocation to devm_*
Convert memory allocation and regmap initialization to
use devm_* functions.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:26:59 +02:00
Laxman Dewangan 3bf6bf9be5 mfd: Cache tps65910 register when we need it
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 <ldewangan@nvidia.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:26:59 +02:00
NeilBrown 9577e8c3fb mfd: Define all twl-regulator feature flags in one place
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 <neilb@suse.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:26:58 +02:00
Rhyland Klein cd4209ced4 mfd: Add tps65910 device-tree support
Add device tree based initialization support for TI's tps65910 pmic.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:26:58 +02:00
Rhyland Klein 3f7e82759c mfd: Commonize tps65910 regmap access through header
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 <rklein@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-20 17:25:23 +02:00
Mark Brown b4410a891a mfd: tpx6586x: Depend on regulator
Some of the OF binding stuff is done in the MFD.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-19 18:16:33 +01:00
Graeme Gregory c948ef3ae7 mfd: palmas PMIC device support Kconfig
Add the new palmas MFD to Kconfig and Makefile

Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-18 16:54:48 +01:00
Graeme Gregory 2945fbc2fc mfd: palmas PMIC device support
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 <gg@slimlogic.co.uk>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-18 16:54:47 +01:00
Philippe Rétornaz e3a0871c8f mfd: mc13xxx: add codec platform data
Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-18 16:42:08 +01:00
Mark Brown 6550334f96 mfd: wm8994: Update to fully use irq_domain
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 <broonie@opensource.wolfsonmicro.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-15 18:57:25 +01:00
Mark Brown 4af8be67fd regmap: Convert regmap_irq to use irq_domain
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 <broonie@opensource.wolfsonmicro.com>
2012-05-13 19:25:59 +01:00
Mark Brown 06e65cb322 Merge branches 'regmap-core', 'regmap-stride', 'regmap-mmio' and 'regmap-irq' into regmap-next 2012-05-13 19:20:47 +01:00
Mark Brown 8614419451 mfd: da9052: Fix genirq abuse
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 <broonie@opensource.wolfsonmicro.com>
2012-05-13 19:14:02 +01:00
Mark Brown 5949a7e9ab Merge remote-tracking branch 'regulator/topic/drivers' into regulator-next
Conflicts:
	drivers/regulator/88pm8607.c (simple overlap with a bugfix in v3.4)
2012-05-12 11:10:25 +01:00
Mark Brown 178e43aef2 Merge remote-tracking branches 'regulator/topic/core', 'regulator/topic/regmap' and 'regulator/topic/register' into regulator-next 2012-05-12 11:09:47 +01:00
Michel JAOUEN 7ccfe9b1d5 mfd: Support of hierachical interrupt for ab8500
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 <maxime.coquelin@stericsson.com>
Reviewed-by: Michel Jaouen <michel.jaouen@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-11 11:16:27 +02:00
Peter Ujfalusi 5af7df6b83 mfd: Add regulator support for twl6040 VIO, V2V1 supplies
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 <peter.ujfalusi@ti.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 21:55:45 +02:00
NeilBrown 5a2f1b5fae mfd: enable wakeup on twl4030 IRQ.
Most of the interrupts that come through this line should trigger
wakeups:
  power button
  RTC alarm
  power available
  usb plug/unplug

so mark the interrupt as a wakeup interrupt.
This is particularly important for when the interrupt arrives during
the late suspend phase.  Without this setting it will be ignored.

Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 18:02:51 +02:00
Axel Lin bbf6adc10c mfd: Convert twl6040-core to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 17:52:15 +02:00
Axel Lin 0ef4619c74 mfd: Convert tps65217 to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 17:51:50 +02:00
Axel Lin 1d88f7a01d mfd: Convert tps65090 to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 17:51:26 +02:00
Axel Lin 1092e1c761 mfd: Convert s5m-core to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 17:50:53 +02:00
Axel Lin f8dddc0cfe mfd: Convert rc5t583 to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 17:50:29 +02:00
Axel Lin b683a0a675 mfd: Return proper error if tps65090 regmap_init_i2c fails
Return proper error instead of 0 if regmap_init_i2c fails.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 17:47:24 +02:00
Aaron Sierra 887c8ec721 watchdog: Convert iTCO_wdt driver to mfd model
This patch converts the iTCO_wdt driver to use the multi-function device
driver model. It uses resources discovered by the lpc_ich driver, so that
it no longer does its own PCI scanning.

Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 17:20:09 +02:00
Johan Hovold 16c5c023aa mfd: Add LM3533 lighting-power core driver
Add support for National Semiconductor / TI LM3533 lighting power chips.

This is the core driver which provides register access over I2C and
registers the ambient-light-sensor, LED and backlight sub-drivers.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 17:20:01 +02:00
Lee Jones ae8406357e mfd: Add support for db8500-prcmu regulator supply for nmk-i2c.4
This applies a supply alias for the db8500's fifth Nomadik i2c port.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 17:19:53 +02:00
Lee Jones ca7edd16ae mfd: Enable Device Tree support for the db8500-prcmu
This patch will enable probing to occur during a Device Tree enabled
boot. The IRQ base is expected to be located in and will be fetched
from the DT itself. We also prevent any of the db8500 regulators
from being registered here, as they will be enabled via DT instead.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 17:19:25 +02:00
Lee Jones 9fc63f670f mfd: Register db8500-prcmu as a platform driver instead of only probing
Pass the probe function as part of the platform_driver struct and
register using the more common platform_driver_register call. In
subsequent patches we'll also add DT support into the struct.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 17:14:15 +02:00
Olof Johansson 9e69ab4116 mfd: Fix of_match_node() da9052 arguments
The driver calls of_match_node() with the arguments swapped.

Signed-off-by: Olof Johansson <olof@lixom.net>
Tested-by: Ying-Chun Liu <paul.liu@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 16:09:32 +02:00
Seth Heasley 8ee3c2a79f lpc_sch: Add Intel Centerton Multifunction Device support
This patch adds the Intel Centerton processor DeviceID for the
Integrated Legacy Block (ILB).
The ILB provides GPIO, SMBus, and Watchdog functionality.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 15:58:21 +02:00
Alessandro Rubini 35bdd29095 mfd: Add driver for STA2X11 MFD block
This also introduces <asm/sta2x11.h> to export a function that is in
the base sta2x11 support patches. The header will increase with other
prototypes and constants over time.

Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-09 15:34:28 +02:00
Olof Johansson d5a2a1ba83 Linux 3.4-rc6
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQEcBAABAgAGBQJPpvY9AAoJEHm+PkMAQRiGpEoIAJgbu+Y8gITnBK/wh9O6zy3S
 5jie5KK4YWdbJsvO58WbNr3CyVIwGIqQ2dUZLiU59aBVLarlGw8xor0MmW+cZwhp
 6fBHaf0qDYAV0MZjD+mnnExOiCRyISa2lPmsfu9dAWywh5KGe6/oAP6/qcXIyok3
 KZyl3qQf4ENpaZPHwZPXCEkUvtuyHgNiszN+QXEadA3s19Ot4VGe9A3VGw+GNrSm
 JqFIq3acQAbKa5BYaqf7TQC02v2FI7//eqt6QHxTqbE6a7LGbTvLfX3HlJ2mnfqa
 1R6QHhM4y4OZDHbaMT2raHZ8WuLXzhehJzhP8Co7AHFOKwVKOb5XbcUr2RrukMU=
 =HkMd
 -----END PGP SIGNATURE-----

Merge tag 'v3.4-rc6' into next/cleanup

Linux 3.4-rc6

Resolve conflict where an u5500 file had a bugfix go in, but was
deleted in the branch staged for next merge window.

Signed-off-by: Olof Johansson <olof@lixom.net>
2012-05-09 02:31:01 -07:00
NeilBrown c30540d78e mfd: twl: define all feature flags in one place.
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 <neilb@suse.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-09 10:04:23 +01:00
Mark Brown ceb57d27e2 mfd: Convert wm8994 to module_i2c_driver()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-07 11:32:09 +02:00
Mark Brown cc7a727941 mfd: Read CUST_ID from the wm8994 device
Read CUST_ID from the device and log it for diagnostics.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-07 11:32:08 +02:00
Mark Brown b7b142d9fc mfd: Convert wm8350 physical I/O to regmap API
The driver still uses a custom cache implementation but the underlying
physical I/O is now done using the regmap API, saving some code and
avoiding allocating enormous scratch arrays on the stack.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-07 11:32:08 +02:00
Mark Brown ce7e4e1122 mfd: Fix wm831x register range passing for recent ARM updates
The removal of mach/io.h from most ARM platforms also set the range of
valid IO ports to be empty for most platforms when previously any 32
bit integer had been valid. This makes it impossible to add IO resources
as the added range is smaller than that of the root resource for IO ports.

Since we're not really using IO memory at all fix this by defining our
own root resource outside the normal tree and make that the parent of
all IO resources. This also ensures we won't conflict with read IO ports
if we ever run on a platform which happens to use them.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-07 11:32:08 +02:00
Mark Brown 63745d4068 mfd: Fix tps65910 section annotations
A warning was being generated by the reference from tps65910_i2c_probe()
to tps65910_sleepinit() since the latter was annotated as __init but the
former was unannotated. Since these functions can only be called during
device init make them both __devinit, and while we're at it also annotate
tps65910_i2c_remove() __devexit for symmetry.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-07 11:32:08 +02:00
Mark Brown b6c9eeef4e mfd: Don't use I2C-specific suspend and resume operations for tps65090
The legacy suspend operations have been deprecated and printing warnings
on boot for over a year now.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-07 11:32:07 +02:00
Mark Brown 1ca5513af7 mfd: Fix tps65090 ifdefs for suspend mode
CONFIG_PM also covers runtime only PM.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-07 11:32:07 +02:00
Thierry Reding 62f6b08793 tps6586x: Add device tree support
This commit adds device tree support for the TPS6586x regulator.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-04 13:25:16 +01:00
Linus Walleij 72fb92200d mfd/ab5500: delete AB5500 support
This platform has been obsoleted and was only available inside of
ST-Ericsson, no users of this code are left in the world. This
deletes the core U5500 support entirely in the same manner as the
obsoleted U8500 silicon was previously deleted.

Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Rabin Vincent <rabin.vincent@stericsson.com>
Cc: Jonas Aberg <jonas.aberg@stericsson.com>
Cc: Per Forlin <per.forlin@stericsson.com>
Cc: Ulf Hansson <ulf.hansson@stericsson.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2012-05-02 00:39:55 +02:00
Linus Walleij dece3709b7 mfd/db5500-prcmu: delete DB5500 PRCMU support
This platform has been obsoleted and was only available inside of
ST-Ericsson, no users of this code are left in the world. This
deletes the core U5500 support entirely in the same manner as the
obsoleted U8500 silicon was previously deleted.

Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Cc: Rabin Vincent <rabin.vincent@stericsson.com>
Cc: Jonas Aberg <jonas.aberg@stericsson.com>
Cc: Per Forlin <per.forlin@stericsson.com>
Cc: Ulf Hansson <ulf.hansson@stericsson.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2012-05-02 00:39:51 +02:00
Rickard Andersson 6ef9418c9e mfd: Add parameter to disable ab8500 battery management
This patch makes it possible to disable battery management
via a module boot parameter. When 'ab8500-core.no_bm=1' then
ab8500_btemp, ab8500_chargalg, ab8500_charger and ab8500_fg will
not be probed. This boot parameter is used for scripted testing
of the system.

Signed-off-by: Rickard Andersson <rickard.andersson@stericsson.com>
Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 13:33:53 +02:00
Jonas Aaberg 112a80d29b mfd: Deny ab8500 suspend if i2c transfer is ongoing
If we are in the middle of an I2C transfer we need to deny suspend
of the AB8500 core. Implement an atomic reference counter for the
I2C operations to make sure we don't do this.

Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Reviewed-by: Mattias Wallin <mattias.wallin@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 13:33:18 +02:00
Rabin Vincent 7e82d6ff5d mfd: Handle the ab8500 irq for suspend/resume
Ensure that the AB interrupt is only handled at a time when
all core drivers are resumed. Ensure that the AB interrupt
is marked as a wakeup interrupt.

Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com>
Reviewed-by: Mattias Wallin <mattias.wallin@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 13:33:04 +02:00
Virupax Sadashivpetimath 44f72e5338 mfd: Add new resources on ab8500 AB8505 and AB9540
The AB8505 and AB9540 has extended support for micro USB
resistance detection, used for detecting chargers. Let's
register resources for this resource. Let's also split off the
separate codec device for AB9540.

Signed-off-by: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 13:32:46 +02:00
Marc Reilly df3df6469f mfd: Add mc13xxx i2c driver
Adds support for mc13xxx family ICs connected via i2c.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Acked-by: Oskar Schirmer <oskar@scara.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:35:41 +02:00
Marc Reilly a0c7c1d48e mfd: Move the mc13xxx-core spi specific code into a separate module
All spi specific code is moved into a new module. The mc13xxx struct
moves to a new local include file by necessity.

A new config choice selects the SPI bus type support and by default is
value of SPI_MASTER to remain compatible with existing configs.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:35:40 +02:00
Marc Reilly 91b5e74118 mfd: Use regmap for the mc13xxx-core register access
This change converts the mc13xxx core to use regmap rather than direct
spi r/w.
The spidev member of mc13xxx struct becomes redundant and is removed.
Extra debugging aids are added to mc13xxx_reg_rmw.
Mutex init is moved to before regmap init.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:35:40 +02:00
Marc Reilly 5006fe546a mfd: Prepare for separating spi and i2c mc13xxx-core backends
This patch abstracts the bus specific operations from the driver core.
Generic init and cleanup is consolidated into mc13xxx_common_*.
spi specific functions are renamed to reflect such.
(The irq member of the mc13xxx struct is no longer redundant, it's used
to store the irq for cleanup time).

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:35:40 +02:00
Russ Dill 4c394bb168 mfd: Fix build breakage in omap-usb-host.c
'ARM: OMAP3: USB: Fix the EHCI ULPI PHY reset issue' removes the include for
linux/gpio.h from omap-usb-host.c. This include indirectly includes plat/cpu.h
which is required by omap-usb-host.c. Fix the build breakage by including
it directly.

Acked-by: Keshava Munegowda <keshava_mgowda@ti.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:00:24 +02:00
Samuel Ortiz 12693f6c1f mfd: No need to check for the GPIO offset from asic3_gpio_to_irq
The gpiolib code will only call our gpio_to_irq ops for our registered
GPIO range.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:00:23 +02:00
Laxman Dewangan 201cf05281 mfd: Add support for tps65910 device sleep
Adding support for device sleep through the external input control
signal "SLEEP".
Changing the SLEEP signal state can switch the device into SLEEP and
ACTIVE state.
Also adding sleep configuration for different resources so that they
should be keep on during sleep state of device.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:00:23 +02:00
Ying-Chun Liu (PaulLiu) 58d114b669 mfd: Add device-tree support for da9502 i2c driver
This patch adds device-tree support for dialog MFD and the binding
documentations.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Ashish Jangam <ashish.jangam@kpitcummins.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:00:23 +02:00
Pasi Savanainen 465c29d384 mfd: Convert Intel MSIC driver to use devm_* interfaces.
The devm_* functions eliminate the need for manual resource releasing
and simplify error handling. Resources allocated by devm_* are freed
automatically on driver detach.

Signed-off-by: Pasi Savanainen <ext-pasi.m.savanainen@gmail.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:00:23 +02:00
Paul Parsons 2fe372fc2a mfd: Avoid unbalanced asic3 irq wakeup enables/disables
The mfd/asic3 driver does not currently define a irq_set_wake() handler.
Consequently any attempt to configure the 3 ASIC3 GPIO buttons - RECORD,
CALENDAR, HOME - as wakeup sources results in Unbalanced IRQ warnings
when the system is woken from sleep mode:

WARNING: at kernel/irq/manage.c:520 irq_set_irq_wake+0xc4/0xf8()
Unbalanced IRQ 342 wake disable
...
WARNING: at kernel/irq/manage.c:520 irq_set_irq_wake+0xc4/0xf8()
Unbalanced IRQ 337 wake disable
...
WARNING: at kernel/irq/manage.c:520 irq_set_irq_wake+0xc4/0xf8()
Unbalanced IRQ 339 wake disable
...

This patch adds a irq_set_wake() handler to the mfd/asic3 driver.

Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:00:22 +02:00
Lars-Peter Clausen 1baf665b81 mfd: Remove redundant spi driver bus initialization
In ancient times it was necessary to manually initialize the bus field of an
spi_driver to spi_bus_type. These days this is done in spi_driver_register() so
we can drop the manual assignment.

The patch was generated using the following coccinelle semantic patch:
// <smpl>
@@
identifier _driver;
@@
struct spi_driver _driver = {
    .driver = {
-           .bus = &spi_bus_type,
    },
};
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:00:22 +02:00
Paul Parsons 4f304245bb mfd: Set asic3 DS1WM clock_rate
The mfd/asic3 driver does not set the ds1wm_driver_data clock_rate field
before passing the structure to the DS1WM w1 busmaster driver.
This was not noticed before commit 26a6afb, because ds1wm_find_divisor()
unintentionally returned the correct divisor when a zero clock_rate was
passed in. However after that commit DS1WM fails a zero clock_rate:

ds1wm ds1wm: no suitable divisor for 0Hz clock

This patch sets the ds1wm_driver_data clock_rate field.

Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Acked-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:00:22 +02:00
Laxman Dewangan e1277f45d8 mfd: Add rc5t583's gpio in mfd device list
Adding the gpio of RC583 in the list of rc583 mfd devices
to register the gpio driver of RC5T583.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:00:22 +02:00
Paul Parsons f22a9c6fd5 mfd: Add PCMCIA/CF support to asic3
This patch is part of a set which adds PCMCIA/CF support for the hx4700.
This patch adds asic3_set_register() calls to:
1. Enable the PCMCIA/CF in asic3_probe().
2. Disable the PCMCIA/CF in asic3_remove().

Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Acked-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:00:22 +02:00
Mark Brown 18996db262 mfd: Cache wm8994 chip revision
There's no need to mark the chip revision registers as volatile, it won't
change at runtime so we can cache it from the device at startup.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:00:21 +02:00
Axel Lin 38a36f5a6a mfd: Use module_pci_driver
This patch converts the drivers in drivers/mfd/* to use module_pci_driver()
macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Andres Salomon <dilinger@queued.net>
Cc: Ira W. Snyder <iws@ovro.caltech.edu>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Denis Turischev <denis@compulab.co.il>
Cc: Harald Welte <HaraldWelte@viatech.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-05-01 12:00:21 +02:00