profile/ivi/kernel-adaptation-intel-automotive.git
12 years agomfd: ab8500-core should depend on MFD_DB8500_PRCMU
Lee Jones [Wed, 23 May 2012 09:22:10 +0000 (10:22 +0100)]
mfd: ab8500-core should depend on MFD_DB8500_PRCMU

A recent move to eliminate excess historical baggage from ab8500 core
code resulting in errors when building with x86_64 allmodconfig:

In file included from drivers/mfd/ab8500-core.c:21:0:
include/linux/mfd/dbx500-prcmu.h:614:19: error: redefinition of 'prcmu_abb_read'
include/linux/mfd/db8500-prcmu.h:673:19: note: previous definition of 'prcmu_abb_read' was here
include/linux/mfd/dbx500-prcmu.h:619:19: error: redefinition of 'prcmu_abb_write'
include/linux/mfd/db8500-prcmu.h:678:19: note: previous definition of 'prcmu_abb_write' was here
include/linux/mfd/dbx500-prcmu.h:630:19: error: redefinition of 'prcmu_config_clkout'
include/linux/mfd/db8500-prcmu.h:643:19: note: previous definition of 'prcmu_config_clkout' was here
include/linux/mfd/dbx500-prcmu.h:692:20: error: redefinition of 'prcmu_ac_wake_req'
include/linux/mfd/db8500-prcmu.h:683:20: note: previous definition of 'prcmu_ac_wake_req' was here
include/linux/mfd/dbx500-prcmu.h:694:20: error: redefinition of 'prcmu_ac_sleep_req'
include/linux/mfd/db8500-prcmu.h:685:20: note: previous definition of 'prcmu_ac_sleep_req' was here

Problem:
When CONFIG_AB8500_CORE is set, building ab8500-core.c and
!(CONFIG_UX500_SOC_DB8500 | CONFIG_MFD_DB8500_PRCMU), both db8500-prcmu.h
and dbx500-prcmu.h take it upon themselves to _both_ create 'return 0'
inline functions for the following:

prcmu_abb_read()
prcmu_abb_write()
prcmu_config_clkout()
prcmu_ac_wake_req()
prcmu_ac_sleep_req()

Solution:
Depend on MFD_DB8500_PRCMU, which in turn depends on UX500_SOC_DB8500.

Reported-By: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agogpio: tps65910: dt: process gpio specific device node info
Laxman Dewangan [Fri, 18 May 2012 20:31:43 +0000 (02:01 +0530)]
gpio: tps65910: dt: process gpio specific device node info

Parse the gpio specific device node information locally.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove the parsing of dt info for tps65910 gpio
Laxman Dewangan [Fri, 18 May 2012 20:31:42 +0000 (02:01 +0530)]
mfd: Remove the parsing of dt info for tps65910 gpio

Remove the parsing of device node information for sub devices
from core file.
The sub devices will parse the information as per the sub-devices
specific information.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Save device node parsed platform data for tps65910 sub devices
Laxman Dewangan [Fri, 18 May 2012 20:31:41 +0000 (02:01 +0530)]
mfd: Save device node parsed platform data for tps65910 sub devices

Save the allocated memory to store the parsed device node information
to the global device structure so that sub devices can directly use this
pointer.
In this way, the sub devices does not require to re-allocate the
memory for storing the sub-devices specific device node information.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add r_select to lm3533 platform data
Johan Hovold [Fri, 18 May 2012 18:22:45 +0000 (20:22 +0200)]
mfd: Add r_select to lm3533 platform data

Add resistor-select parameter to the platform data.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agogpio: Add Intel Centerton support to gpio-sch
Seth Heasley [Tue, 22 May 2012 20:54:20 +0000 (22:54 +0200)]
gpio: Add Intel Centerton support to gpio-sch

This patch adds the Intel Centerton processor device ID for GPIO.
The device ID is defined in include/linux/pci_ids.h

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Emulate active low IRQs as well as active high IRQs for wm831x
Mark Brown [Fri, 18 May 2012 16:02:02 +0000 (17:02 +0100)]
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>
12 years agomfd: Mark two lm3533 zone registers as volatile
Johan Hovold [Fri, 18 May 2012 18:22:46 +0000 (20:22 +0200)]
mfd: Mark two lm3533 zone registers as volatile

Mark the two currently unused zone registers as volatile in regmap for
completeness.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix return type of lm533 attribute is_visible
Johan Hovold [Sun, 20 May 2012 13:16:10 +0000 (15:16 +0200)]
mfd: Fix return type of lm533 attribute is_visible

Since commit 587a1f1659 ("switch ->is_visible() to returning umode_t")
the return type of is_visible is umode_t rather than mode_t.

This silences a compiler warning on some architectures where these types
are not compatible.

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Enable Device Tree support in the ab8500-pwm driver
Lee Jones [Fri, 18 May 2012 08:39:12 +0000 (09:39 +0100)]
mfd: Enable Device Tree support in the ab8500-pwm driver

This patch ensures probing of the ab8500-pwm 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>
12 years agomfd: Enable Device Tree support in the ab8500-sysctrl driver
Lee Jones [Fri, 18 May 2012 08:39:10 +0000 (09:39 +0100)]
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>
12 years agomfd: Add support for Device Tree to twl6040
Peter Ujfalusi [Wed, 16 May 2012 11:11:58 +0000 (14:11 +0300)]
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>
12 years agomfd: Register the twl6040 child for the ASoC codec unconditionally
Peter Ujfalusi [Wed, 16 May 2012 11:11:57 +0000 (14:11 +0300)]
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>
12 years agomfd: Allocate twl6040 IRQ numbers dynamically
Peter Ujfalusi [Wed, 16 May 2012 11:11:56 +0000 (14:11 +0300)]
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>
12 years agomfd: twl6040 code cleanup in interrupt initialization part
Peter Ujfalusi [Wed, 16 May 2012 11:11:55 +0000 (14:11 +0300)]
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>
12 years agomfd: Enable ab8500-gpadc driver for Device Tree
Lee Jones [Thu, 17 May 2012 13:45:22 +0000 (14:45 +0100)]
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>
12 years agomfd: Prevent unassigned pointer from being used in ab8500-gpadc driver
Lee Jones [Thu, 17 May 2012 13:45:20 +0000 (14:45 +0100)]
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>
12 years agomfd: Enable ab8500-debug when Device Tree is enabled
Lee Jones [Thu, 17 May 2012 13:45:19 +0000 (14:45 +0100)]
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>
12 years agomfd: Enable Device Tree for ab8500-core driver
Lee Jones [Thu, 17 May 2012 13:45:13 +0000 (14:45 +0100)]
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>
12 years agomfd: Remove confusing ab8500-i2c file and merge into ab8500-core
Lee Jones [Sat, 19 May 2012 15:21:37 +0000 (17:21 +0200)]
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>
12 years agomfd: mc13xxx core should not be user visible
Mark Brown [Fri, 18 May 2012 11:01:19 +0000 (13:01 +0200)]
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>
12 years agomfd: Fix double free in wm8350 error path
Johan Hovold [Tue, 15 May 2012 17:45:40 +0000 (19:45 +0200)]
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>
12 years agomfd: Convert lm3533 to use devres
Johan Hovold [Tue, 15 May 2012 17:24:53 +0000 (19:24 +0200)]
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>
12 years agomfd: Add ADC support to the DA9052/53 core
Ashish Jangam [Fri, 18 May 2012 10:19:18 +0000 (12:19 +0200)]
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>
12 years agomfd: Add tps65910-irq devicetree init and irqdomain support
Rhyland Klein [Fri, 18 May 2012 09:52:19 +0000 (11:52 +0200)]
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>
12 years agomfd: Make anatop register accessor more flexible and rename meaningfully
Richard Zhao [Sun, 13 May 2012 01:18:02 +0000 (09:18 +0800)]
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>
12 years agomfd: wm8400 needs to depend on I2C=y
Mark Brown [Wed, 16 May 2012 08:05:54 +0000 (09:05 +0100)]
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>
12 years agomfd: Convert wm831x to irq_domain
Mark Brown [Mon, 14 May 2012 21:14:24 +0000 (23:14 +0200)]
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>
12 years agomfd: Don't try to flag IRQ 0 as a wm831x wake source
Mark Brown [Sun, 13 May 2012 20:53:45 +0000 (21:53 +0100)]
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>
12 years agomfd: Add MAX77693 irq handler
Chanwoo Choi [Mon, 14 May 2012 20:54:20 +0000 (22:54 +0200)]
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>
12 years agomfd: Add MAX77693 driver
Chanwoo Choi [Mon, 14 May 2012 20:50:39 +0000 (22:50 +0200)]
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>
12 years agomfd: Export wm8400_block_read()
Mark Brown [Mon, 14 May 2012 09:13:16 +0000 (10:13 +0100)]
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>
12 years agomfd: Don't support non-modular wm8400 build
Mark Brown [Mon, 14 May 2012 09:13:15 +0000 (10:13 +0100)]
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>
12 years agomfd: Silence an lm3533 gcc warning
Dan Carpenter [Sat, 12 May 2012 11:01:04 +0000 (14:01 +0300)]
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>
12 years agogpio: Convert tps65910 to a platform driver
Laxman Dewangan [Fri, 11 May 2012 16:18:27 +0000 (21:48 +0530)]
gpio: Convert tps65910 to a platform driver

Make the gpio-tps65910 as platform driver and register
this from tps65910 core driver as mfd sub device.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Convert pcf50633-core to use devm_* APIs
Axel Lin [Fri, 11 May 2012 01:31:29 +0000 (09:31 +0800)]
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>
12 years agomfd: Convert da9052 to use devm_* APIs
Axel Lin [Fri, 11 May 2012 01:29:51 +0000 (09:29 +0800)]
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>
12 years agomfd: Change tunnelcreek watchdog name on the lpc_sch subdevices array
Wim Van Sebroeck [Thu, 10 May 2012 18:54:32 +0000 (20:54 +0200)]
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>
12 years agomfd: Fix lm3533 regmap_update_bits() call
Axel Lin [Thu, 10 May 2012 15:35:02 +0000 (23:35 +0800)]
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>
12 years agomfd: Use SI-units for the lm3533 max-current interface
Johan Hovold [Thu, 10 May 2012 17:18:29 +0000 (19:18 +0200)]
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>
12 years agomfd: Remove unused max-current lm3533 function
Johan Hovold [Thu, 10 May 2012 17:18:28 +0000 (19:18 +0200)]
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>
12 years agomfd: Remove lm3533 boost attributes
Johan Hovold [Thu, 10 May 2012 12:11:29 +0000 (14:11 +0200)]
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>
12 years agomfd: Add boost frequency and ovp to lm3533 platform data
Johan Hovold [Thu, 10 May 2012 12:11:28 +0000 (14:11 +0200)]
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>
12 years agomfd: Remove wm8400 custom cache implementation
Mark Brown [Wed, 9 May 2012 21:53:48 +0000 (22:53 +0100)]
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>
12 years agomfd: Staticise non-exported tps65217_update_bits()
Mark Brown [Wed, 9 May 2012 20:18:05 +0000 (21:18 +0100)]
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>
12 years agomfd: Fix tps65910 build failure
Samuel Ortiz [Fri, 11 May 2012 13:10:28 +0000 (15:10 +0200)]
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>
12 years agomfd: Register tps65910 gpios as an mfd device
Laxman Dewangan [Fri, 11 May 2012 13:07:44 +0000 (15:07 +0200)]
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>
12 years agomfd: Convert all tps65910 allocation to devm_*
Laxman Dewangan [Fri, 11 May 2012 10:36:57 +0000 (12:36 +0200)]
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>
12 years agomfd: Cache tps65910 register when we need it
Laxman Dewangan [Wed, 9 May 2012 13:10:54 +0000 (18:40 +0530)]
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>
12 years agomfd: Define all twl-regulator feature flags in one place
NeilBrown [Tue, 8 May 2012 19:43:59 +0000 (05:43 +1000)]
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>
12 years agomfd: Add tps65910 device-tree support
Rhyland Klein [Fri, 11 May 2012 09:36:26 +0000 (11:36 +0200)]
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>
12 years agomfd: Add tps65910 device tree bindings documentation
Rhyland Klein [Tue, 8 May 2012 18:42:39 +0000 (11:42 -0700)]
mfd: Add tps65910 device tree bindings documentation

Add device tree bindings for TI's tps65910 pmic.

Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Commonize tps65910 regmap access through header
Rhyland Klein [Tue, 8 May 2012 18:42:38 +0000 (11:42 -0700)]
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>
12 years agomfd: Support of hierachical interrupt for ab8500
Michel JAOUEN [Mon, 7 May 2012 13:02:03 +0000 (15:02 +0200)]
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>
12 years agomfd: Add regulator support for twl6040 VIO, V2V1 supplies
Peter Ujfalusi [Wed, 2 May 2012 13:54:42 +0000 (16:54 +0300)]
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>
12 years agomfd: enable wakeup on twl4030 IRQ.
NeilBrown [Wed, 25 Apr 2012 03:05:24 +0000 (13:05 +1000)]
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>
12 years agomfd: Convert twl6040-core to devm_regmap_init_i2c()
Axel Lin [Wed, 25 Apr 2012 02:09:46 +0000 (10:09 +0800)]
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>
12 years agomfd: Convert tps65217 to devm_regmap_init_i2c()
Axel Lin [Wed, 25 Apr 2012 02:06:40 +0000 (10:06 +0800)]
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>
12 years agomfd: Convert tps65090 to devm_regmap_init_i2c()
Axel Lin [Wed, 25 Apr 2012 02:04:58 +0000 (10:04 +0800)]
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>
12 years agomfd: Convert s5m-core to devm_regmap_init_i2c()
Axel Lin [Wed, 25 Apr 2012 02:03:44 +0000 (10:03 +0800)]
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>
12 years agomfd: Convert rc5t583 to devm_regmap_init_i2c()
Axel Lin [Wed, 25 Apr 2012 02:01:55 +0000 (10:01 +0800)]
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>
12 years agomfd: Return proper error if tps65090 regmap_init_i2c fails
Axel Lin [Wed, 25 Apr 2012 01:30:36 +0000 (09:30 +0800)]
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>
12 years agomfd: Allow for const stmpe keyboard data
Linus Walleij [Mon, 23 Apr 2012 12:28:44 +0000 (14:28 +0200)]
mfd: Allow for const stmpe keyboard data

Since it's not like we will re-arrange the keys at run-time, it
seems proper to allow the keymap data to be const. This solves
a compilation warning in ux500.

Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agowatchdog: Convert iTCO_wdt driver to mfd model
Aaron Sierra [Fri, 20 Apr 2012 19:14:11 +0000 (14:14 -0500)]
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>
12 years agomfd: Add LM3533 lighting-power core driver
Johan Hovold [Thu, 3 May 2012 10:26:36 +0000 (12:26 +0200)]
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>
12 years agomfd: Add support for db8500-prcmu regulator supply for nmk-i2c.4
Lee Jones [Fri, 4 May 2012 18:23:20 +0000 (19:23 +0100)]
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>
12 years agomfd: Enable Device Tree support for the db8500-prcmu
Lee Jones [Wed, 9 May 2012 15:19:25 +0000 (17:19 +0200)]
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>
12 years agomfd: Register db8500-prcmu as a platform driver instead of only probing
Lee Jones [Thu, 19 Apr 2012 20:36:41 +0000 (21:36 +0100)]
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>
12 years agomfd: Fix of_match_node() da9052 arguments
Olof Johansson [Sat, 5 May 2012 23:02:48 +0000 (16:02 -0700)]
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>
12 years agolpc_sch: Add Intel Centerton Multifunction Device support
Seth Heasley [Tue, 17 Apr 2012 21:09:22 +0000 (14:09 -0700)]
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>
12 years agopci_ids: Add Intel Centerton Legacy Block DeviceID
Seth Heasley [Mon, 23 Apr 2012 16:23:56 +0000 (09:23 -0700)]
pci_ids: Add Intel Centerton Legacy Block DeviceID

This patch adds the Integrated Legacy Block DeviceID for the Centerton CPU.  It will be used in the GPIO and Multifunction Devices driver.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agogpio: Add STA2X11 GPIO block
Alessandro Rubini [Thu, 12 Apr 2012 08:48:55 +0000 (10:48 +0200)]
gpio: Add STA2X11 GPIO block

This introduces 128 gpio bits (for each PCI device installed) with
working interrupt support.

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>
12 years agomfd: Add driver for STA2X11 MFD block
Alessandro Rubini [Thu, 12 Apr 2012 08:48:44 +0000 (10:48 +0200)]
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>
12 years agomfd: Convert wm8994 to module_i2c_driver()
Mark Brown [Mon, 7 May 2012 09:03:23 +0000 (10:03 +0100)]
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>
12 years agomfd: Read CUST_ID from the wm8994 device
Mark Brown [Mon, 7 May 2012 09:03:22 +0000 (10:03 +0100)]
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>
12 years agomfd: Convert wm8350 physical I/O to regmap API
Mark Brown [Mon, 7 May 2012 09:03:21 +0000 (10:03 +0100)]
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>
12 years agomfd: Fix wm831x register range passing for recent ARM updates
Mark Brown [Mon, 7 May 2012 09:03:20 +0000 (10:03 +0100)]
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>
12 years agomfd: Fix tps65910 section annotations
Mark Brown [Mon, 7 May 2012 09:03:19 +0000 (10:03 +0100)]
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>
12 years agomfd: Don't use I2C-specific suspend and resume operations for tps65090
Mark Brown [Mon, 7 May 2012 09:03:18 +0000 (10:03 +0100)]
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>
12 years agomfd: Fix tps65090 ifdefs for suspend mode
Mark Brown [Mon, 7 May 2012 09:03:17 +0000 (10:03 +0100)]
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>
12 years agomfd: Add parameter to disable ab8500 battery management
Rickard Andersson [Tue, 17 Apr 2012 07:30:57 +0000 (09:30 +0200)]
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>
12 years agomfd: Deny ab8500 suspend if i2c transfer is ongoing
Jonas Aaberg [Tue, 17 Apr 2012 07:30:33 +0000 (09:30 +0200)]
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>
12 years agomfd: Handle the ab8500 irq for suspend/resume
Rabin Vincent [Tue, 17 Apr 2012 07:30:24 +0000 (09:30 +0200)]
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>
12 years agomfd: Add new resources on ab8500 AB8505 and AB9540
Virupax Sadashivpetimath [Tue, 17 Apr 2012 07:30:14 +0000 (09:30 +0200)]
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>
12 years agomfd: Add mc13xxx i2c driver
Marc Reilly [Sun, 1 Apr 2012 06:41:39 +0000 (16:41 +1000)]
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>
12 years agomfd: Move the mc13xxx-core spi specific code into a separate module
Marc Reilly [Sun, 1 Apr 2012 06:41:38 +0000 (16:41 +1000)]
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>
12 years agomfd: Use regmap for the mc13xxx-core register access
Marc Reilly [Sun, 1 Apr 2012 06:41:37 +0000 (16:41 +1000)]
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>
12 years agomfd: Prepare for separating spi and i2c mc13xxx-core backends
Marc Reilly [Tue, 1 May 2012 10:26:46 +0000 (12:26 +0200)]
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>
12 years agomfd: Fix build breakage in omap-usb-host.c
Russ Dill [Sun, 22 Apr 2012 08:48:18 +0000 (01:48 -0700)]
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>
12 years agomfd: No need to check for the GPIO offset from asic3_gpio_to_irq
Samuel Ortiz [Mon, 16 Apr 2012 19:28:29 +0000 (21:28 +0200)]
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>
12 years agomfd: Add support for tps65910 device sleep
Laxman Dewangan [Wed, 18 Apr 2012 10:13:51 +0000 (12:13 +0200)]
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>
12 years agomfd: Add device-tree support for da9502 i2c driver
Ying-Chun Liu (PaulLiu) [Sun, 15 Apr 2012 16:01:50 +0000 (00:01 +0800)]
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>
12 years agomfd: Convert Intel MSIC driver to use devm_* interfaces.
Pasi Savanainen [Thu, 12 Apr 2012 09:40:37 +0000 (12:40 +0300)]
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>
12 years agomfd: Avoid unbalanced asic3 irq wakeup enables/disables
Paul Parsons [Tue, 10 Apr 2012 23:35:34 +0000 (00:35 +0100)]
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>
12 years agomfd: Remove redundant spi driver bus initialization
Lars-Peter Clausen [Tue, 10 Apr 2012 20:51:28 +0000 (22:51 +0200)]
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>
12 years agomfd: Set asic3 DS1WM clock_rate
Paul Parsons [Mon, 9 Apr 2012 12:18:31 +0000 (13:18 +0100)]
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>
12 years agomfd: Add rc5t583's gpio in mfd device list
Laxman Dewangan [Mon, 9 Apr 2012 08:25:55 +0000 (13:55 +0530)]
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>
12 years agomfd: Add PCMCIA/CF support to asic3
Paul Parsons [Thu, 5 Apr 2012 16:45:04 +0000 (17:45 +0100)]
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>
12 years agomfd: Cache wm8994 chip revision
Mark Brown [Thu, 5 Apr 2012 14:16:56 +0000 (15:16 +0100)]
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>
12 years agomfd: Use module_pci_driver
Axel Lin [Tue, 3 Apr 2012 01:09:19 +0000 (09:09 +0800)]
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>