platform/kernel/linux-amlogic.git
12 years agogpio/twl: Add DT support to gpio-twl4030 driver
Benoit Cousson [Wed, 29 Feb 2012 21:51:32 +0000 (22:51 +0100)]
gpio/twl: Add DT support to gpio-twl4030 driver

Add the DT support for the I2C GPIO expander inside the twl4030.

Note: The pdata parameters still have to be properly adapted using
dedicated bindings.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agogpio/twl: Allocate irq_desc dynamically for SPARSE_IRQ support
Benoit Cousson [Wed, 29 Feb 2012 21:48:32 +0000 (22:48 +0100)]
gpio/twl: Allocate irq_desc dynamically for SPARSE_IRQ support

Do not use the board pdata for irq_base, but allocate them dynamically
to allow a proper support of SPARSE_IRQ.

Fix an unneeded line wrap.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Detach twl6040 from the pmic mfd driver
Peter Ujfalusi [Wed, 4 Jan 2012 12:58:33 +0000 (14:58 +0200)]
mfd: Detach twl6040 from the pmic mfd driver

On OMAP4 platform audio has separate IC, it is no longer part
of the pmic chip.
Prevent twl-core to claim the 0x4b address, which belongs to
the twl6040 audio IC.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Replace twl-* pr_ macros by the dev_ equivalent and do various cleanups
Benoit Cousson [Fri, 2 Mar 2012 10:11:26 +0000 (11:11 +0100)]
mfd: Replace twl-* pr_ macros by the dev_ equivalent and do various cleanups

Since a structure device is available now, use the dev_ macros instead
of the pr_ ones.

Clean some badly formatted comments.
Remove some unused variables.
Move some variable to the place they belong.
Clean some badly wrapped lines.
Align variable definition
Add missing braces in if-then-else block.
Add blank line for better readability.
Move stuff here and there...

Conflicts:

drivers/mfd/twl-core.c

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Micro-optimization on twl4030 IRQ handler
Felipe Balbi [Wed, 22 Feb 2012 12:53:59 +0000 (14:53 +0200)]
mfd: Micro-optimization on twl4030 IRQ handler

__ffs() will be far faster than the for loop used.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Make twl4030 SIH SPARSE_IRQ capable
Benoit Cousson [Wed, 29 Feb 2012 21:38:06 +0000 (22:38 +0100)]
mfd: Make twl4030 SIH SPARSE_IRQ capable

twl4030 is using a two level irq controllers infrastruture.
So far, only the first level was using dynamic irq_desc allocation
to be able to have irq_domain support for device tree.
There is a need to allocate separate irq_descs for the SIH too to
avoid hacking the first level with interrupts from the second level.

Add an irq_base parameter to allow the caller to provide the base from
pdata or from dynamic allocation.

Affect TWL4030_NR_IRQS to the twl-core IRQs only.

Moreover that will allow the extraction of the of_node pointer for further
Device Tree conversion.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Move twl-core IRQ allocation into twl[4030|6030]-irq files
Benoit Cousson [Wed, 29 Feb 2012 18:40:31 +0000 (19:40 +0100)]
mfd: Move twl-core IRQ allocation into twl[4030|6030]-irq files

During DT adaptation, the irq_alloc_desc was added into twl-core, but
due to the rather different and weird IRQ management required by the twl4030,
it is much better to have a different approach for it.
The issue is that twl4030 uses a two level IRQ mechanism but handles all the
PWR interrupts as part of the twl-core interrupt range. It ends up with a
range of 16 interrupts total for CORE and PWR.

The other twl4030 functionalities already have a dedicated driver and thus
their IRQs and irqdomain can and should be defined localy.

twl6030 is using a single level IRQ controller and thus does not require any
trick.

Move the irq_alloc_desc and irq_domain_add_legacy in twl4030-irq and
twl6030-irq.

Allocate together CORE and PWR IRQs for twl4030-irq.

Conflicts:

        drivers/mfd/twl-core.c

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove references already defineid in header file from twl-core
Benoit Cousson [Wed, 29 Feb 2012 18:28:14 +0000 (19:28 +0100)]
mfd: Remove references already defineid in header file from twl-core

The twl-core exported functions are already declared in twl-core.h

Include the header file instead or re-declaring the functions.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove unneeded header from twl-core
Felipe Balbi [Wed, 22 Feb 2012 12:39:09 +0000 (14:39 +0200)]
mfd: Remove unneeded header from twl-core

This driver doesn't really need <plat/cpu.h>, so remove it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Make twl-core not depend on pdata->irq_base/end
Felipe Balbi [Wed, 22 Feb 2012 12:32:16 +0000 (14:32 +0200)]
mfd: Make twl-core not depend on pdata->irq_base/end

With sparse IRQs the driver shouldn't depend at all on
any IRQ values coming from board-file.

Remove every occurences of pdata->irq_base/end.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoARM: OMAP2+: board-omap4-*: Do not use anymore TWL6030_IRQ_BASE in board files
Benoit Cousson [Fri, 2 Mar 2012 15:20:01 +0000 (16:20 +0100)]
ARM: OMAP2+: board-omap4-*: Do not use anymore TWL6030_IRQ_BASE in board files

With the introduction of dynamically allocated IRQ in the twl6030 driver,
the board files can no longer rely of static IRQ defines like before.

Retrieve the value dynamically allocated from the mmc -> twl6030 init
callback.

Note: The Panda board does not seems to use the card detect IRQ.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Return twl6030_mmc_card_detect IRQ for board setup
Benoit Cousson [Fri, 2 Mar 2012 15:15:22 +0000 (16:15 +0100)]
mfd: Return twl6030_mmc_card_detect IRQ for board setup

Card detect IRQ from the TWL6030 used to be provided to the MMC
controller code using a statically allocated IRQ scheme:

  card_detect_irq = TWL6030_IRQ_BASE + MMCDETECT_INTR_OFFSET;

This is no longer valid in a SPARSE_IRQ context since there is no more
pre-defined TWL6030_IRQ_BASE.

Return the proper card detect IRQ value in the twl6030_mmc_card_detect_config
that will be called from the MMC controller.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoRevert "mfd: Add platform data for MAX8997 haptic driver"
Samuel Ortiz [Wed, 21 Mar 2012 20:38:59 +0000 (21:38 +0100)]
Revert "mfd: Add platform data for MAX8997 haptic driver"

This reverts commit 02b09703e7a411f80e5ec037b3abf14061a61933.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add support for TPS65090
Venu Byravarasu [Fri, 16 Mar 2012 05:40:19 +0000 (11:10 +0530)]
mfd: Add support for TPS65090

TPS65090 is a Texas Instrument PMIC. It contains 3 Step-Down converters, 2
always on LDO's and  7 current limited load switches.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add some da9052-i2c section annotations
Dmitry Torokhov [Sat, 17 Mar 2012 23:01:09 +0000 (16:01 -0700)]
mfd: Add some da9052-i2c section annotations

da9052_i2c_remove() can and should be marked as __devexit.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Build rtc5t583 only if I2C config is selected to y.
Laxman Dewangan [Mon, 19 Mar 2012 06:14:55 +0000 (11:44 +0530)]
mfd: Build rtc5t583 only if I2C config is selected to y.

Fixing build error reported by Stephen Rothwell:

drivers/built-in.o: In function `rc5t583_i2c_init':
rc5t583.c:(.init.text+0xb3db): undefined reference to `i2c_register_driver'
drivers/built-in.o: In function `rc5t583_i2c_probe':
rc5t583.c:(.devinit.text+0x8fa0): undefined reference to `regmap_init_i2c'
drivers/built-in.o: In function `rc5t583_i2c_exit':
rc5t583.c:(.exit.text+0x708): undefined reference to `i2c_del_driver'

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add anatop mfd driver
Ying-Chun Liu (PaulLiu) [Fri, 16 Mar 2012 20:12:32 +0000 (21:12 +0100)]
mfd: Add anatop mfd driver

Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Venu Byravarasu <vbyravarasu@nvidia.com>
Cc: Peter Korsgaard <jacmet@sunsite.dk>
Cc: Rob Lee <rob.lee@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix compilation error in tps65910.h
Venu Byravarasu [Fri, 16 Mar 2012 07:28:37 +0000 (12:58 +0530)]
mfd: Fix compilation error in tps65910.h

'struct gpio_chip' is declared in include/asm-generic/gpio.h
which is included by include/linux/gpio.h.
However without including gpio.h, TPS65910.h declares
a member of this type as part of 'struct tps65910' declaration.

This causes compilation error, if gpio.h is not included
before including tps65910.h, in source files.

Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add 8420 variant to db8500-prcmu
Bengt Jonsson [Thu, 15 Mar 2012 18:50:51 +0000 (19:50 +0100)]
mfd: Add 8420 variant to db8500-prcmu

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add 8520 PRCMU variant to db8500-prcmu
Bengt Jonsson [Thu, 15 Mar 2012 18:50:40 +0000 (19:50 +0100)]
mfd: Add 8520 PRCMU variant to db8500-prcmu

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Reviewed-by: Mattias Nilssson <mattias.i.nilsson@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: Remove obsolete hwacc implementation for db8500-prmcu
Mattias Nilsson [Thu, 15 Mar 2012 18:50:26 +0000 (19:50 +0100)]
mfd: Remove obsolete hwacc implementation for db8500-prmcu

This patch removes the obsolete hwacc implementation in the
DB8500 PRCMU driver.

Signed-off-by: Mattias Nilsson <mattias.i.nilsson@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: Use DIV_ROUND_CLOSEST for sm501 clock
Axel Lin [Mon, 12 Mar 2012 02:12:34 +0000 (10:12 +0800)]
mfd: Use DIV_ROUND_CLOSEST for sm501 clock

Use DIV_ROUND_CLOSEST to replace sm501fb_round_div function.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add support for RICOH PMIC RC5T583
Laxman Dewangan [Tue, 28 Feb 2012 13:05:17 +0000 (18:35 +0530)]
mfd: Add support for RICOH PMIC RC5T583

Ricoh power management IC  RC5T583 contains is multi
functional device having multiple sub devices inside this.
This device has multiple dcdc/ldo regulators, gpios, interrupt
controllers, on-key, RTCs, ADCs.
This device have 4 DCDCs, 8 LDOs, 8 GPIOs, 6 ADCs, 3 RTCs etc.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Make use of the ab8500 firmware read-modify-write service
Mattias Nilsson [Thu, 8 Mar 2012 13:02:20 +0000 (14:02 +0100)]
mfd: Make use of the ab8500 firmware read-modify-write service

This patch updates the AB8500 driver to make use of the I2C
read-modify-write service in the PRCMU firmware.

Signed-off-by: Mattias Nilsson <mattias.i.nilsson@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 a prcmu_abb_write_masked routine to db8500-prcmu
Mattias Nilsson [Thu, 8 Mar 2012 13:02:05 +0000 (14:02 +0100)]
mfd: Add a prcmu_abb_write_masked routine to db8500-prcmu

This patch adds driver support for the I2C read-modify-write
service in the U8500 PRCMU firmware.

Signed-off-by: Mattias Nilsson <mattias.i.nilsson@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: Support for the AB8500 AB8505 variant
Bengt Jonsson [Thu, 8 Mar 2012 13:01:57 +0000 (14:01 +0100)]
mfd: Support for the AB8500 AB8505 variant

This builds upon the changes done to support AB9540 so as
also to support the AB8505 derivative of the AB8500
circuit.

Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Don't use mutex_lock_interruptible in ab8500-core
Rabin Vincent [Thu, 8 Mar 2012 13:01:46 +0000 (14:01 +0100)]
mfd: Don't use mutex_lock_interruptible in ab8500-core

This disadvantage of having it interruptible is that it would
appear to work OK in most situations, but in the rare case
that this call does fail, it can lead to misconfiguration
of the AB, such as a regulator not being turned off and
leading to a platform power consumption increase.

There's no real benefit to having this interruptible.

Make it a plain mutex_lock. The non-interruptability matches
other low-level I/O functions such as SPI and I2C.

Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoARM: S3C64XX: Hook up supply for WM8994 LDOs on Littlemill
Mark Brown [Thu, 8 Mar 2012 11:55:07 +0000 (11:55 +0000)]
ARM: S3C64XX: Hook up supply for WM8994 LDOs on Littlemill

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove unused LDO supply field from WM8994 pdata
Mark Brown [Fri, 16 Mar 2012 18:36:29 +0000 (19:36 +0100)]
mfd: Remove unused LDO supply field from WM8994 pdata

It's causing confusion with the regulator level field of the same name
and serves no useful function.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Use correct variable name for tps65910 regmap config
Laxman Dewangan [Wed, 7 Mar 2012 13:16:05 +0000 (18:46 +0530)]
mfd: Use correct variable name for tps65910 regmap config

This was the copy-paste issue in reg cache support code where
variable name for regmap config was not really starting from
the device name, it was starting from some other device name.
Fixing this so that variable name contains actual device name.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add platform data for MAX8997 haptic driver
Chanwoo Choi [Wed, 7 Mar 2012 08:02:51 +0000 (17:02 +0900)]
mfd: Add platform data for MAX8997 haptic driver

MAX8997 device does not support haptic function of it.
This patch adds platform data for for MAX8997 haptic driver.

Signed-off-by: Donggeun Kim <dg77.kim@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: wm8994: Fix register default for WM1811 AntiPOP2
Mark Brown [Mon, 5 Mar 2012 23:42:06 +0000 (23:42 +0000)]
mfd: wm8994: Fix register default for WM1811 AntiPOP2

Should be all bits clear.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: wm8994: Remove defaults for volatile registers
Mark Brown [Mon, 5 Mar 2012 23:40:14 +0000 (23:40 +0000)]
mfd: wm8994: Remove defaults for volatile registers

Some volatile registers accidentally had defaults added, though there were
no harmful side effects other than increased memory consumption.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix pm8606 build failure
Samuel Ortiz [Tue, 6 Mar 2012 07:06:14 +0000 (08:06 +0100)]
mfd: Fix pm8606 build failure

Reported by Andrew Morton <akpm@linux-foundation.org>, with
i386 allmodconfig:

ERROR: "pm8606_osc_disable" [drivers/video/backlight/88pm860x_bl.ko] undefined!
ERROR: "pm8606_osc_enable" [drivers/video/backlight/88pm860x_bl.ko] undefined!
ERROR: "pm8606_osc_disable" [drivers/leds/leds-88pm860x.ko] undefined!
ERROR: "pm8606_osc_enable" [drivers/leds/leds-88pm860x.ko] undefined!

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix a typo in MFD_MAX8997 Kconfig entry
Axel Lin [Thu, 1 Mar 2012 01:31:25 +0000 (09:31 +0800)]
mfd: Fix a typo in MFD_MAX8997 Kconfig entry

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd : Check if the other db8500 core is in WFI
Daniel Lezcano [Tue, 28 Feb 2012 21:46:09 +0000 (22:46 +0100)]
mfd : Check if the other db8500 core is in WFI

This patch allows to check if the other core is in WFI
mode. It is the last check the idle routine has to do before
entering into the retention state.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd : Check if the db8500 prcmu has pending irq
Daniel Lezcano [Tue, 28 Feb 2012 21:46:08 +0000 (22:46 +0100)]
mfd : Check if the db8500 prcmu has pending irq

This patch allows to check if there are some pending irqs
on the prcmu.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd : Copy the db8500 gic setting to the prcmu
Daniel Lezcano [Tue, 28 Feb 2012 21:46:07 +0000 (22:46 +0100)]
mfd : Copy the db8500 gic setting to the prcmu

In the case we go to the retention mode, we decoupled the gic
in order to have the A9 core to reach a stable WFI state.
But we want the prcmu to wake up the A9 when the gic has a pending
irq which is done by copying the gic settings to the to the prcmu.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd : Check if there are pending irq on the db8500 gic
Daniel Lezcano [Tue, 28 Feb 2012 21:46:06 +0000 (22:46 +0100)]
mfd : Check if there are pending irq on the db8500 gic

This patch introduces a routine to check if there are some
irqs pending on the gic. Usually this check is not relevant because
it appears racy (an irq can arrive right after this check), but in
the ux500 it makes sense because the prcmu decouples the gic from
the A9 cores.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd : Cleanup duplicate db8500 definitions
Daniel Lezcano [Tue, 28 Feb 2012 21:46:05 +0000 (22:46 +0100)]
mfd : Cleanup duplicate db8500 definitions

I missed in my previous patch the A9_MASK_REQ[_MASK] were
already defined. Let's remove the duplicate definitions.

The PRCMU_GIC_DELAY macro could be removed as it is not
really useful here.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Return proper error if s5m-core regmap_init_i2c fails
Axel Lin [Tue, 28 Feb 2012 06:23:55 +0000 (14:23 +0800)]
mfd: Return proper error if s5m-core regmap_init_i2c fails

Also remove a redundant semicolon from return statement.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoled: Modified power control of pm860x led
Jett.Zhou [Tue, 28 Feb 2012 02:59:29 +0000 (10:59 +0800)]
led: Modified power control of pm860x led

Since several sub modules such as backlight, leds and vibrator depend
on the refernce group and internal oscillator in pm8606, so modified
the power control of led in pm8606 by unified interface.

Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agobacklight: Modified power control of pm860x backlight
Jett.Zhou [Tue, 28 Feb 2012 02:59:08 +0000 (10:59 +0800)]
backlight: Modified power control of pm860x backlight

Since several sub modules such as backlight, leds and vibrator depend
on the refernce group and internal oscillator in pm8606, so modified
the power control of backlight in pm8606 by unified interface.

Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Code cleanup for pm8606 sub-dev initialization
Jett.Zhou [Tue, 28 Feb 2012 02:58:42 +0000 (10:58 +0800)]
mfd: Code cleanup for pm8606 sub-dev initialization

Collect all the sub-devices of pm8606 initialization into
device_pm8606_init() for code clean up.

Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add power control interface for pm8606 chip
Jett.Zhou [Thu, 1 Mar 2012 10:59:19 +0000 (11:59 +0100)]
mfd: Add power control interface for pm8606 chip

The reference group and internal oscillator are shared by sub-devs
like led, backlight and vibrator in PM8606 chip. Now introduce a
voting mechanism to enable/disable it.

Add pm8606_osc_enable() and pm8606_osc_disable() interface and
related defines to support this. This interface will be called by
vibrator led and backlight driver.The refernce group and internal
oscillator are enabled only when at least one of it's clients holds
it on or disabled only all the clients don't use it any more based
on the above mechanism.

Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix wm831x-spi table id name typo in MODULE_DEVICE_TABLE macro
Hai Dong [Fri, 24 Feb 2012 22:03:00 +0000 (16:03 -0600)]
mfd: Fix wm831x-spi table id name typo in MODULE_DEVICE_TABLE macro

Signed-off-by: Hai Dong <hai.dong@polycom.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Include linux/mfd/pcf50633/mbc.h in pcf50633-irq.c
Axel Lin [Sat, 25 Feb 2012 03:37:53 +0000 (11:37 +0800)]
mfd: Include linux/mfd/pcf50633/mbc.h in pcf50633-irq.c

Include linux/mfd/pcf50633/mbc.h instead of duplicating the same defines.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Include linux/mfd/pcf50633/pmic.h in pcf50633-gpio.c
Axel Lin [Sat, 25 Feb 2012 03:36:54 +0000 (11:36 +0800)]
mfd: Include linux/mfd/pcf50633/pmic.h in pcf50633-gpio.c

Include linux/mfd/pcf50633/pmic.h instead of duplicating the same defines.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Correct readability of WM8994 DC servo 4E register
Mark Brown [Wed, 29 Feb 2012 15:37:59 +0000 (15:37 +0000)]
mfd: Correct readability of WM8994 DC servo 4E register

It should be marked as readable but wasn't, breaking DC servo operation.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Use regmap for tps65910 register access.
Laxman Dewangan [Tue, 21 Feb 2012 12:51:34 +0000 (18:21 +0530)]
mfd: Use regmap for tps65910 register access.

Using regmap apis for accessing the device registers and
using RBTREE caching mechanims for caching registers.

Enabling caching of the registers which is used for voltage
controls. By doing this, the modify_bits operation is faster as
it does not involve the i2c register read from device, just read
from cache. This results faster set voltage operation.

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: Add ability to wake the system for 88pm860x
Jett.Zhou [Mon, 27 Feb 2012 14:44:20 +0000 (15:44 +0100)]
mfd: Add ability to wake the system for 88pm860x

For 88pm860x pmic, it can wake the system from low power mode by irq,
its sub-devs like RTC and onkey can be enabled for this usage.

Signed-off-by: Jett.Zhou <jtzhou@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Make twl6030_irq_set_wake static
Nishanth Menon [Thu, 23 Feb 2012 02:03:59 +0000 (20:03 -0600)]
mfd: Make twl6030_irq_set_wake static

twl6030_irq_set_wake is not used anywhere else in the kernel
except as irq_chip.irq_set_wake. No reason for it to be exported.

Also fixes build warning:
drivers/mfd/twl6030-irq.c:230:5: warning: symbol 'twl6030_irq_set_wake' was not declared. Should it be static?

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Clear twl6030 IRQ status register only once
Nishanth Menon [Thu, 23 Feb 2012 02:03:45 +0000 (20:03 -0600)]
mfd: Clear twl6030 IRQ status register only once

TWL6030 family of PMIC use a shadow interrupt status register
while kernel processes the current interrupt event.
However, any write(0 or 1) to register INT_STS_A, INT_STS_B or
INT_STS_C clears all 3 interrupt status registers.

Since clear of the interrupt is done on 32k clk, depending on I2C
bus speed, we could in-adverently clear the status of a interrupt
status pending on shadow register in the current implementation.
This is due to the fact that multi-byte i2c write operation into
three seperate status register could result in multiple load
and clear of status and result in lost interrupts.

Instead, doing a single byte write to INT_STS_A register with 0x0
will clear all three interrupt status registers without the related
risk.

Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove unused io_lock mutex from da9052
Axel Lin [Wed, 22 Feb 2012 03:43:40 +0000 (11:43 +0800)]
mfd: Remove unused io_lock mutex from da9052

da9052 has been converted to use regmap API, so we can remove the unused
io_lock mutex.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Decouple/recouple gic from the ux500 PRCMU
Daniel Lezcano [Mon, 20 Feb 2012 11:30:26 +0000 (12:30 +0100)]
mfd: Decouple/recouple gic from the ux500 PRCMU

This patch allows to decouple and recouple the gic from the PRCMU.
This is needed to put the A9 core in retention mode with the cpuidle
driver.

It is based on top of the "DB8500 PRCMU update" patchset.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Rickard Andersson <rickard.andersson@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Initialize tps65912 irq platform data properly
Axel Lin [Sun, 19 Feb 2012 07:50:11 +0000 (15:50 +0800)]
mfd: Initialize tps65912 irq platform data properly

irq_base of the tps65912 irq platform data should be
initialized with the board provided irq_base data.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix ACPI conflict check
Jean Delvare [Sat, 18 Feb 2012 16:54:23 +0000 (17:54 +0100)]
mfd: Fix ACPI conflict check

The code is currently always checking the first resource of every
device only (several times.) This has been broken since the ACPI check
was added in February 2010 in commit
91fedede0338eb6203cdd618d8ece873fdb7c22c.

Fix the check to run on each resource individually, once.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@vger.kernel.org
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: wm8994: Add __devinit and __devexit annotations for probe and remove
Mark Brown [Fri, 17 Feb 2012 23:58:03 +0000 (15:58 -0800)]
mfd: wm8994: Add __devinit and __devexit annotations for probe and remove

Fixes warnings and needed for correctness.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Show correct device id for wm8400
Axel Lin [Thu, 16 Feb 2012 05:58:19 +0000 (13:58 +0800)]
mfd: Show correct device id for wm8400

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Move omap-usb-host usbhs init before allocing child dev
Govindraj.R [Wed, 15 Feb 2012 10:23:34 +0000 (15:53 +0530)]
mfd: Move omap-usb-host usbhs init before allocing child dev

There could be possible race condition where the host dev's
are alloced and added to platform dev just before usbhs_init.
Just move usbhs_init before adding child dev.

CC: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove omap-usb-host magic numbers for dev dma mask
Govindraj.R [Wed, 15 Feb 2012 06:57:50 +0000 (12:27 +0530)]
mfd: Remove omap-usb-host magic numbers for dev dma mask

Remove the hardcoded magic values for dma mask and use the dma
mask api/macro available.

Signed-off-by: Govindraj.R <govindraj.raja@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix typo for TPS65912
Axel Lin [Wed, 15 Feb 2012 08:05:24 +0000 (16:05 +0800)]
mfd: Fix typo for TPS65912

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Make pcf50633_write_block() return 0 on success
Axel Lin [Tue, 14 Feb 2012 03:30:31 +0000 (11:30 +0800)]
mfd: Make pcf50633_write_block() return 0 on success

The callers of pcf50633_write_block assume pcf50633_write_block return 0 on
success, thus make it return 0 instead of the number of registers written on
success.

Currently pcf50633_write_block is called in drivers/mfd/pcf50633-irq.c and
drivers/rtc/rtc-pcf50633.c.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix val_len parameters for s5m-core regmap_raw_write
Axel Lin [Tue, 14 Feb 2012 03:08:07 +0000 (11:08 +0800)]
mfd: Fix val_len parameters for s5m-core regmap_raw_write

The val_len parameters for regmap_raw_write should be "count * sizeof(u8)"
(or simply "count") instead of "count * sizeof(u16)".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix kcalloc parameters swapped
Axel Lin [Sun, 12 Feb 2012 09:43:22 +0000 (17:43 +0800)]
mfd: Fix kcalloc parameters swapped

The first parameter should be "number of elements" and the second parameter
should be "element size".

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Support AB9540 ab8500 variant
Linus Walleij [Mon, 20 Feb 2012 20:42:24 +0000 (21:42 +0100)]
mfd: Support AB9540 ab8500 variant

The AB9540 variant of the AB8500 is basically close enough
to use the same driver. This adds the new registers and
deviations for this new chip variant.

Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@stericsson.com>
Signed-off-by: Alex Macro <alex.macro@stericsson.com>
Signed-off-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: Parametrize ab8500 IRQ masks and registers
Linus Walleij [Mon, 20 Feb 2012 20:42:17 +0000 (21:42 +0100)]
mfd: Parametrize ab8500 IRQ masks and registers

This makes the AB8500 state struct contain the IRQ mask and
register offsets previously hard-coded so as to make room for
more AB8500 variants.

Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@stericsson.com>
Signed-off-by: Alex Macro <alex.macro@stericsson.com>
Signed-off-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 ab8500 version detection and enforcing
Linus Walleij [Mon, 20 Feb 2012 20:42:10 +0000 (21:42 +0100)]
mfd: Add ab8500 version detection and enforcing

There are currently four different versions of the AB8500
around: AB8500, AB8505, AB9540 and AB8540. Unfortunately:

- Some of the chips (AB8500, AB8505, AB9540) cannot read
  the AB8500_REV_REG register but return errors

- Some of them have the same ID value in the hardware
  register AB8500_REV_REV, for example the first versions
  of AB8505 and AB9540 have 0xFF in this register -
  just like the AB8500.

So we need to be able to enforce a certain version from
the platform. We do this by using the id of the platform
device that provides the read/write functions.

Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@stericsson.com>
Signed-off-by: Alex Macro <alex.macro@stericsson.com>
Signed-off-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: Fix ab8500 error path bug
Linus Walleij [Mon, 20 Feb 2012 20:42:03 +0000 (21:42 +0100)]
mfd: Fix ab8500 error path bug

We were not freeing the irq properly in the error path in
the AB8500 driver.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@stericsson.com>
Signed-off-by: Alex Macro <alex.macro@stericsson.com>
Signed-off-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: Test for jack detection when deciding if wm8994 should suspend
Mark Brown [Mon, 20 Feb 2012 21:32:32 +0000 (21:32 +0000)]
mfd: Test for jack detection when deciding if wm8994 should suspend

The jack detection on WM1811 is often required during system suspend, add
it as another check when deciding if we should suspend.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: wm8994: We don't need to runtime resume by default
Mark Brown [Mon, 6 Feb 2012 18:47:37 +0000 (18:47 +0000)]
mfd: wm8994: We don't need to runtime resume by default

This is the default state that the runtime PM infrastructure expects so
instead just kick the runtime PM core to suspend us if we're not doing
anything (as is default).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: wm8994: Mark MICBIAS register as readable
Mark Brown [Mon, 6 Feb 2012 16:50:03 +0000 (16:50 +0000)]
mfd: wm8994: Mark MICBIAS register as readable

Omitted in the regmap conversion.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Trivial twl4030 code-style fixes
Felipe Contreras [Wed, 1 Feb 2012 01:02:48 +0000 (03:02 +0200)]
mfd: Trivial twl4030 code-style fixes

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add to_irq() member to asic3 gpio_chip structure
Paul Parsons [Tue, 31 Jan 2012 01:18:35 +0000 (01:18 +0000)]
mfd: Add to_irq() member to asic3 gpio_chip structure

The gpio_to_irq() macro is now defined as __gpio_to_irq() instead of IRQ_GPIO().
The __gpio_to_irq() function returns -ENXIO if the referenced gpio_chip
structure does not define a to_irq() member.
This is true of the asic3 gpio_chip structure, and thus calls to gpio_to_irq()
now fail (for example from the gpio-vbus module).
This patch defines the to_irq() member in the asic3 gpio_chip structure.

Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove unneeded version.h include from ab5500
Jesper Juhl [Mon, 30 Jan 2012 21:08:44 +0000 (22:08 +0100)]
mfd: Remove unneeded version.h include from ab5500

As 'make versioncheck' points out, there's no need for
drivers/mfd/ab5500-core.c to #include <linux/version.h>, so this patch
removes the unneeded include.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agogpio: Support no-irq stmpe mode
Chris Blair [Thu, 26 Jan 2012 21:17:15 +0000 (22:17 +0100)]
gpio: Support no-irq stmpe mode

Adds support for boards which have an STMPE GPIO device without the
interrupt pin connected. This means that no interrupt can be received
but the GPIO pins can still be driven and read.

Cc: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Viresh Kumar <viresh.kumar@st.com>
Tested-by: Michel Jaouen <michel.jaouen@stericsson.com>
Signed-off-by: Chris Blair <chris.blair@stericsson.com>
Acked-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add support for no-interrupt stmpe config
Chris Blair [Thu, 26 Jan 2012 21:17:03 +0000 (22:17 +0100)]
mfd: Add support for no-interrupt stmpe config

Adds support for boards which have an STMPE device without the
interrupt pin connected.

Acked-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Chris Blair <chris.blair@stericsson.com>
Tested-by: Michel Jaouen <michel.jaouen@stericsson.com>
Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add itps65910 wakeup support
Laxman Dewangan [Mon, 23 Jan 2012 07:46:15 +0000 (13:16 +0530)]
mfd: Add itps65910 wakeup support

Implementing irq_set_wake() so that device should able
to wakeup the system through different interrupt provided
by this device like gpios, onkey, rtc etc.

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: Add support for multiple s5m devices
Sangbeom Kim [Fri, 20 Jan 2012 07:09:12 +0000 (16:09 +0900)]
mfd: Add support for multiple s5m devices

There are many samsung mfd devices.
The s5m core driver try to support various samsung s5m series.
It will cover S5M8767A and S5M8763 and S5M8751.
This patch is enable to support various s5m series.

Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Convert s5m core driver to use devm_kzalloc()
Sangbeom Kim [Fri, 20 Jan 2012 07:09:11 +0000 (16:09 +0900)]
mfd: Convert s5m core driver to use devm_kzalloc()

Convert s5m core driver to use devm_kzalloc().

Signed-off-by: Sangbeom Kim <sbkim73@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Initialize tps65910 irq platform data properly
Laxman Dewangan [Wed, 18 Jan 2012 14:49:16 +0000 (20:19 +0530)]
mfd: Initialize tps65910 irq platform data properly

irq_base of the tps65910 irq platform data should be
initialized with the board provided irq_base data.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix s5m error handling for invalid device type
Jonghwan Choi [Mon, 20 Feb 2012 15:22:56 +0000 (16:22 +0100)]
mfd: Fix s5m error handling for invalid device type

If device type is not supported in driver, have to retun error.

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix possible s5m null pointer dereference
Jonghwan Choi [Mon, 16 Jan 2012 00:08:42 +0000 (09:08 +0900)]
mfd: Fix possible s5m null pointer dereference

This patch checks for pdata to using it.

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: wm8350 variable dereferenced before check
Jonghwan Choi [Mon, 20 Feb 2012 15:13:43 +0000 (16:13 +0100)]
mfd: wm8350 variable dereferenced before check

Remove "wm8350->irq_base = pdata->irq_base" to avoid
null pointer exception and wm8350->irq_base got from
irq_alloc_descs().

Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add initial db8500 prcmu register access api
Mattias Nilsson [Fri, 13 Jan 2012 15:21:00 +0000 (16:21 +0100)]
mfd: Add initial db8500 prcmu register access api

This patch adds an initial PRCMU register access API, which
for now should only be used for a very limited set of registers.

The idea about this API is that we split the PRCMU driver in
one part that deals with interaction with the PRCMU firmware
and one part that simply provide write accessors in the PRCMU
register range. The latter are just a collection of registers
exposed in the PRCMU register range for various purposes and
not related to the PRCMU firmware.

Currently we support some limited GPIO, SPI and UART settings
through this API.

Signed-off-by: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove check for db8500 firmware bug
Jonas Aaberg [Fri, 13 Jan 2012 15:20:51 +0000 (16:20 +0100)]
mfd: Remove check for db8500 firmware bug

In prcmu firmware version 3.4.4 the issue with longer
intervalls than 131 s was fixed, we don't expect the
issue to creep back up.

Signed-off-by: Jonas Aaberg <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: db8500 OPP and sleep handling update
Mattias Nilsson [Fri, 13 Jan 2012 15:20:43 +0000 (16:20 +0100)]
mfd: db8500 OPP and sleep handling update

This updates the operating point handling code by:

- Supporting the DDR OPP retention state.
- Supporting another low operating point named
  APE_50_PARTLY_25_OPP
- Adding an interface to figure out if the sleep state change
  was properly achieved.

Signed-off-by: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Spawned db8500 regulators update
Bengt Jonsson [Fri, 13 Jan 2012 15:20:36 +0000 (16:20 +0100)]
mfd: Spawned db8500 regulators update

As drivers have progressed and got some more review we have
consequently moved things around:

- Some device drivers have changed name and some were wrong
  from the beginning.
- We removed the dependency from some domains to the VAPE
  domain -  SIA MMDSP, SIA PIPE, SVA MMDSP and SVA PIPE power
  domains are handled outside the framework while ESRAM12
  and ESRAM34 are actually handled inside the PRCMU.

Reviewed-by: Rickard Andersson <rickard.andersson@stericsson.com>
Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com>
Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: db8500 clock handling update
Mattias Nilsson [Fri, 13 Jan 2012 15:20:28 +0000 (16:20 +0100)]
mfd: db8500 clock handling update

This updates the clock handling in the DB8500 PRCMU driver with
the latest findings and API changes related to changes in the
backing firmware in the PRCMU.

- Add the necessary interfaces to get the frequencies of the
  clocks and set the rate of some of the clocks.
- Add support for controlling the clocks PLLSOC0, PLLDSI,
  DSI0, DSI1 and DSI escape clocks (DSInESCCLK).
- Correct the PLLSDI enable/disable sequence by using the
  DSIPLL_CLAMPI bit.

After this we will have the interfaces and code to implement the
U8500 clock framework properly.

Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com>
Signed-off-by: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Update abstract dbx500 interface
Mattias Nilsson [Fri, 13 Jan 2012 15:20:20 +0000 (16:20 +0100)]
mfd: Update abstract dbx500 interface

This prefixes a number of accessor functions with db8500_* since
they are DB8500-specific and we need to move to this naming
scheme.

We also replace numerous instances of machine_is() with cpu_is()
which covers the right type of ASICs rather than entire machines
i.e. boards.

Signed-off-by: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Function for obtaining the db8500 prcmu firmware version
Mattias Nilsson [Fri, 13 Jan 2012 15:20:10 +0000 (16:20 +0100)]
mfd: Function for obtaining the db8500 prcmu firmware version

This patch exports a function that can be used to tell which
version of the DB8500 PRCMU firmware is available, and revamps the
firmware detection code a bit.

Reviewed-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com>
Signed-off-by: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove db8500-prcmu U8400 legacy
Daniel Willerud [Fri, 13 Jan 2012 15:20:03 +0000 (16:20 +0100)]
mfd: Remove db8500-prcmu U8400 legacy

This removes the U8400 legacy from PRCMU and cpufreq drivers.
This platform has no current in-kernel users.

Signed-off-by: Daniel Willerud <daniel.willerud@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix section mismatch warning for da9052-spi
Axel Lin [Wed, 11 Jan 2012 09:27:16 +0000 (17:27 +0800)]
mfd: Fix section mismatch warning for da9052-spi

Add __devinit annotation for da9052_spi_probe to fix below build warning:

WARNING: drivers/built-in.o(.text+0x349b4): Section mismatch in reference from the function da9052_spi_probe() to the function .devinit.text:da9052_device_init()
The function da9052_spi_probe() references
the function __devinit da9052_device_init().
This is often because da9052_spi_probe lacks a __devinit
annotation or the annotation of da9052_device_init is wrong.

Also add __devexit annotation for da9052_spi_remove because we have
__devexit_p around it in the remove callback.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add pdata to set mc13783-ts conversion delay
Michael Thalmeier [Mon, 20 Feb 2012 11:18:13 +0000 (12:18 +0100)]
mfd: Add pdata to set mc13783-ts conversion delay

MC13783 can be programmed to wait some clock cycles between the
touchscreen polarization and the resistance conversion. This is
needed to adjust for touchscreens with high capacitance between
plates.

Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add missing regmap_exit to free a previously allocated da9052 register map
Axel Lin [Tue, 10 Jan 2012 07:09:56 +0000 (15:09 +0800)]
mfd: Add missing regmap_exit to free a previously allocated da9052 register map

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add new mfd device for TPS65217
AnilKumar Ch [Wed, 11 Jan 2012 10:41:41 +0000 (16:11 +0530)]
mfd: Add new mfd device for TPS65217

The TPS65217 chip is a power management IC for Portable Navigation Systems
and Tablet Computing devices. It contains the following components:

- Regulators
- White LED
- USB battery charger

This patch adds support for tps65217 mfd device. At this time only
the regulator functionality is made available.

Signed-off-by: AnilKumar Ch <anilkumar@ti.com>
Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: twl-core: Don't specify regulator consumers by struct device
Mark Brown [Fri, 3 Feb 2012 11:05:37 +0000 (11:05 +0000)]
mfd: twl-core: Don't specify regulator consumers by struct device

This has been deprecated for considerable time now and support has been
removed from the regulator API. dev_name should be used instead.

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 agoLinux 3.3-rc4
Linus Torvalds [Sat, 18 Feb 2012 23:53:33 +0000 (15:53 -0800)]
Linux 3.3-rc4

12 years agoMerge tag 'fixes-3.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Linus Torvalds [Sat, 18 Feb 2012 23:40:00 +0000 (15:40 -0800)]
Merge tag 'fixes-3.3-rc4' of git://git./linux/kernel/git/arm/arm-soc

These are the bug fixes that have accumulated since 3.3-rc3 in arm-soc.
The majority of them are regression fixes for stuff that broke during
the merge 3.3 window.

The notable ones are:

* The at91 ata drivers both broke because of an earlier cleanup patch that
  some other patches were based on. Jean-Christophe decided to remove
  the legacy at91_ide driver and fix the new-style at91-pata driver while
  keeping the cleanup patch. I almost rejected the patches for being too
  late and too big but in the end decided to accept them because they
  fix a regression.

* A patch fixing build breakage from the sysdev-to-device conversion
  colliding with other changes touches a number of mach-s3c files.

b0654037 "ARM: orion: Fix Orion5x GPIO regression from MPP cleanup"
  is a mechanical change that unfortunately touches a lot of lines
  that should up in the diffstat.

* tag 'fixes-3.3-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (28 commits)
  ARM: at91: drop ide driver in favor of the pata one
  pata/at91: use newly introduced SMC accessors
  ARM: at91: add accessor to manage SMC
  ARM: at91:rtc/rtc-at91sam9: ioremap register bank
  ARM: at91: USB AT91 gadget registration for module
  ep93xx: fix build of vision_ep93xx.c
  ARM: OMAP2xxx: PM: fix OMAP2xxx-specific UART idle bug in v3.3
  ARM: orion: Fix USB phy for orion5x.
  ARM: orion: Fix Orion5x GPIO regression from MPP cleanup
  ARM: EXYNOS: Add cpu-offset property in gic device tree node
  ARM: EXYNOS: Bring exynos4-dt up to date
  ARM: OMAP3: cm-t35: fix section mismatch warning
  ARM: OMAP2: Fix the OMAP2 only build break seen with 2011+ ARM tool-chains
  ARM: tegra: paz00: fix wrong UART port on mini-pcie plug
  ARM: tegra: paz00: fix wrong SD1 power gpio
  i2c: tegra: Add devexit_p() for remove
  ARM: EXYNOS: Correct M-5MOLS sensor clock frequency on Universal C210 board
  ARM: EXYNOS: Correct framebuffer window size on Nuri board
  ARM: SAMSUNG: Fix missing api-change from subsys_interface change
  ARM: EXYNOS: Fix "warning: initialization from incompatible pointer type"
  ...

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Sat, 18 Feb 2012 23:38:12 +0000 (15:38 -0800)]
Merge git://git./linux/kernel/git/davem/net

1) VETH_INFO_PEER netlink attribute needs to have it's size validated,
   from Thomas Graf.

2) 'poll' module option of bnx2x driver crashes the machine, just remove
   it.  From Michal Schmidt.

3) ks8851_mll driver reads the irq number from two places, but only
   initializes one of them, oops.  Use only one location and fix this
   problem, from Jan Weitzel.

4) Fix buffer overrun and unicast sterring bugs in mellanox mlx4 driver,
   from Eugenia Emantayev.

5) Swapped kcalloc() args in RxRPC and mlx4, from Axel Lin.

6) PHY MDIO device name regression fixes from Florian Fainelli.

7) If the wake event IRQ line is different from the netdevice one, we
   have to properly route it to the stmmac interrupt handler.  From
   Francesco Virlinzi.

8) Fix rwlock lock initialization ordering bug in mac80211, from
   Mohammed Shafi Shajakhan.

9) TCP lost_cnt can get out of sync, and in fact go negative, in certain
   circumstances.  Fix the way we specify what sequence range to operate
   on in tcp_sacktag_one() to fix this bug.  From Neal Cardwell.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (27 commits)
  net/ethernet: ks8851_mll fix irq handling
  veth: Enforce minimum size of VETH_INFO_PEER
  stmmac: update the driver version to Feb 2012 (v2)
  stmmac: move hw init in the probe (v2)
  stmmac: request_irq when use an ext wake irq line (v2)
  stmmac: do not discard frame on dribbling bit assert
  ipheth: Add iPhone 4S
  mlx4: add unicast steering entries to resource_tracker
  mlx4: fix QP tree trashing
  mlx4: fix buffer overrun
  3c59x: shorten timer period for slave devices
  netpoll: netpoll_poll_dev() should access dev->flags
  RxRPC: Fix kcalloc parameters swapped
  bnx2x: remove the 'poll' module option
  tcp: fix tcp_shifted_skb() adjustment of lost_cnt_hint for FACK
  ks8851: Fix NOHZ local_softirq_pending 08 warning
  bnx2x: fix bnx2x_storm_stats_update() on big endian
  ixp4xx-eth: fix PHY name to match MDIO bus name
  octeon: fix PHY name to match MDIO bus name
  fec: fix PHY name to match fixed MDIO bus name
  ...