firefly-linux-kernel-4.4.55.git
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
  ...

12 years agoMerge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap
Linus Torvalds [Sat, 18 Feb 2012 23:37:25 +0000 (15:37 -0800)]
Merge tag 'for-linus' of git://git./linux/kernel/git/broonie/regmap

Fixes a bootstrapping issue for some registers when a less commonly used
method for register cache initialisation is used.  Only affects a fairly
small proportion of users that both don't use explicit register defaults
and do use the cache.

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap:
  regmap: Fix cache defaults initialization from raw cache defaults

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

Fixes maximum filename length and filesystem type reporting in statfs() calls
and also fixes stale inode mode bits on eCryptfs inodes after a POSIX ACL was
set on the lower filesystem's inode.

* tag 'ecryptfs-3.3-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tyhicks/ecryptfs:
  ecryptfs: remove the second argument of k[un]map_atomic()
  eCryptfs: Copy up lower inode attrs after setting lower xattr
  eCryptfs: Improve statfs reporting

12 years agoMerge tag 'pinctrl' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux...
Linus Torvalds [Sat, 18 Feb 2012 23:27:40 +0000 (15:27 -0800)]
Merge tag 'pinctrl' of git://git./linux/kernel/git/linusw/linux-pinctrl

pinctrl fixes for v3.3

* tag 'pinctrl-for-torvalds-20120216' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
  pinctrl: restore pin naming

12 years agoMerge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Sat, 18 Feb 2012 23:26:37 +0000 (15:26 -0800)]
Merge branch 'merge' of git://git./linux/kernel/git/benh/powerpc

Here are a few more fixes for powerpc.  Some are regressions, the rest
is simple/obvious/nasty enough that I deemed it good to go now.

Here's also step one of deprecating legacy iSeries support: we are
removing it from the main defconfig.

Nobody seems to be using it anymore and the code is nasty to maintain,
(involves horrible hacks in various low level areas of the kernel) so we
plan to actually rip it out at some point.  For now let's just avoid
building it by default.  Stephen will proceed to do the actual removal
later (probably 3.4 or 3.5).

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
  powerpc/perf: power_pmu_start restores incorrect values, breaking frequency events
  powerpc/adb: Use set_current_state()
  powerpc: Disable interrupts early in Program Check
  powerpc: Remove legacy iSeries from ppc64_defconfig
  powerpc/fsl/pci: Fix PCIe fixup regression
  powerpc: Fix kernel log of oops/panic instruction dump

12 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci
Linus Torvalds [Sat, 18 Feb 2012 23:26:11 +0000 (15:26 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/jbarnes/pci

One regression fix for SR-IOV on PPC and a couple of misc fixes from
Yinghai.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci:
  PCI: Fix pci cardbus removal
  PCI: set pci sriov page size before reading SRIOV BAR
  PCI: workaround hard-wired bus number V2

12 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Sat, 18 Feb 2012 23:25:39 +0000 (15:25 -0800)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

3 radeon fixes, I have some exynos fixes to push later but I'll queue
them separately once I've looked them over a bit.

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
  drm/radeon/kms: fix MSI re-arm on rv370+
  drm/radeon/kms/atom: bios scratch reg handling updates
  drm/radeon/kms: drop lock in return path of radeon_fence_count_emitted.

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Linus Torvalds [Sat, 18 Feb 2012 23:24:05 +0000 (15:24 -0800)]
Merge git://git./linux/kernel/git/herbert/crypto-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: sha512 - use standard ror64()

12 years agoi387: re-introduce FPU state preloading at context switch time
Linus Torvalds [Sat, 18 Feb 2012 20:56:35 +0000 (12:56 -0800)]
i387: re-introduce FPU state preloading at context switch time

After all the FPU state cleanups and finally finding the problem that
caused all our FPU save/restore problems, this re-introduces the
preloading of FPU state that was removed in commit b3b0870ef3ff ("i387:
do not preload FPU state at task switch time").

However, instead of simply reverting the removal, this reimplements
preloading with several fixes, most notably

 - properly abstracted as a true FPU state switch, rather than as
   open-coded save and restore with various hacks.

   In particular, implementing it as a proper FPU state switch allows us
   to optimize the CR0.TS flag accesses: there is no reason to set the
   TS bit only to then almost immediately clear it again.  CR0 accesses
   are quite slow and expensive, don't flip the bit back and forth for
   no good reason.

 - Make sure that the same model works for both x86-32 and x86-64, so
   that there are no gratuitous differences between the two due to the
   way they save and restore segment state differently due to
   architectural differences that really don't matter to the FPU state.

 - Avoid exposing the "preload" state to the context switch routines,
   and in particular allow the concept of lazy state restore: if nothing
   else has used the FPU in the meantime, and the process is still on
   the same CPU, we can avoid restoring state from memory entirely, just
   re-expose the state that is still in the FPU unit.

   That optimized lazy restore isn't actually implemented here, but the
   infrastructure is set up for it.  Of course, older CPU's that use
   'fnsave' to save the state cannot take advantage of this, since the
   state saving also trashes the state.

In other words, there is now an actual _design_ to the FPU state saving,
rather than just random historical baggage.  Hopefully it's easier to
follow as a result.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoi387: move TS_USEDFPU flag from thread_info to task_struct
Linus Torvalds [Sat, 18 Feb 2012 05:48:54 +0000 (21:48 -0800)]
i387: move TS_USEDFPU flag from thread_info to task_struct

This moves the bit that indicates whether a thread has ownership of the
FPU from the TS_USEDFPU bit in thread_info->status to a word of its own
(called 'has_fpu') in task_struct->thread.has_fpu.

This fixes two independent bugs at the same time:

 - changing 'thread_info->status' from the scheduler causes nasty
   problems for the other users of that variable, since it is defined to
   be thread-synchronous (that's what the "TS_" part of the naming was
   supposed to indicate).

   So perfectly valid code could (and did) do

ti->status |= TS_RESTORE_SIGMASK;

   and the compiler was free to do that as separate load, or and store
   instructions.  Which can cause problems with preemption, since a task
   switch could happen in between, and change the TS_USEDFPU bit. The
   change to TS_USEDFPU would be overwritten by the final store.

   In practice, this seldom happened, though, because the 'status' field
   was seldom used more than once, so gcc would generally tend to
   generate code that used a read-modify-write instruction and thus
   happened to avoid this problem - RMW instructions are naturally low
   fat and preemption-safe.

 - On x86-32, the current_thread_info() pointer would, during interrupts
   and softirqs, point to a *copy* of the real thread_info, because
   x86-32 uses %esp to calculate the thread_info address, and thus the
   separate irq (and softirq) stacks would cause these kinds of odd
   thread_info copy aliases.

   This is normally not a problem, since interrupts aren't supposed to
   look at thread information anyway (what thread is running at
   interrupt time really isn't very well-defined), but it confused the
   heck out of irq_fpu_usable() and the code that tried to squirrel
   away the FPU state.

   (It also caused untold confusion for us poor kernel developers).

It also turns out that using 'task_struct' is actually much more natural
for most of the call sites that care about the FPU state, since they
tend to work with the task struct for other reasons anyway (ie
scheduling).  And the FPU data that we are going to save/restore is
found there too.

Thanks to Arjan Van De Ven <arjan@linux.intel.com> for pointing us to
the %esp issue.

Cc: Arjan van de Ven <arjan@linux.intel.com>
Reported-and-tested-by: Raphael Prevost <raphael@buro.asia>
Acked-and-tested-by: Suresh Siddha <suresh.b.siddha@intel.com>
Tested-by: Peter Anvin <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoi387: move AMD K7/K8 fpu fxsave/fxrstor workaround from save to restore
Linus Torvalds [Fri, 17 Feb 2012 03:11:15 +0000 (19:11 -0800)]
i387: move AMD K7/K8 fpu fxsave/fxrstor workaround from save to restore

The AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception is
pending.  In order to not leak FIP state from one process to another, we
need to do a floating point load after the fxsave of the old process,
and before the fxrstor of the new FPU state.  That resets the state to
the (uninteresting) kernel load, rather than some potentially sensitive
user information.

We used to do this directly after the FPU state save, but that is
actually very inconvenient, since it

 (a) corrupts what is potentially perfectly good FPU state that we might
     want to lazy avoid restoring later and

 (b) on x86-64 it resulted in a very annoying ordering constraint, where
     "__unlazy_fpu()" in the task switch needs to be delayed until after
     the DS segment has been reloaded just to get the new DS value.

Coupling it to the fxrstor instead of the fxsave automatically avoids
both of these issues, and also ensures that we only do it when actually
necessary (the FP state after a save may never actually get used).  It's
simply a much more natural place for the leaked state cleanup.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoi387: do not preload FPU state at task switch time
Linus Torvalds [Thu, 16 Feb 2012 23:45:23 +0000 (15:45 -0800)]
i387: do not preload FPU state at task switch time

Yes, taking the trap to re-load the FPU/MMX state is expensive, but so
is spending several days looking for a bug in the state save/restore
code.  And the preload code has some rather subtle interactions with
both paravirtualization support and segment state restore, so it's not
nearly as simple as it should be.

Also, now that we no longer necessarily depend on a single bit (ie
TS_USEDFPU) for keeping track of the state of the FPU, we migth be able
to do better.  If we are really switching between two processes that
keep touching the FP state, save/restore is inevitable, but in the case
of having one process that does most of the FPU usage, we may actually
be able to do much better than the preloading.

In particular, we may be able to keep track of which CPU the process ran
on last, and also per CPU keep track of which process' FP state that CPU
has.  For modern CPU's that don't destroy the FPU contents on save time,
that would allow us to do a lazy restore by just re-enabling the
existing FPU state - with no restore cost at all!

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agoecryptfs: remove the second argument of k[un]map_atomic()
Cong Wang [Fri, 10 Feb 2012 05:39:50 +0000 (13:39 +0800)]
ecryptfs: remove the second argument of k[un]map_atomic()

Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
12 years agoeCryptfs: Copy up lower inode attrs after setting lower xattr
Tyler Hicks [Tue, 7 Feb 2012 23:55:40 +0000 (17:55 -0600)]
eCryptfs: Copy up lower inode attrs after setting lower xattr

After passing through a ->setxattr() call, eCryptfs needs to copy the
inode attributes from the lower inode to the eCryptfs inode, as they
may have changed in the lower filesystem's ->setxattr() path.

One example is if an extended attribute containing a POSIX Access
Control List is being set. The new ACL may cause the lower filesystem to
modify the mode of the lower inode and the eCryptfs inode would need to
be updated to reflect the new mode.

https://launchpad.net/bugs/926292

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Sebastien Bacher <seb128@ubuntu.com>
Cc: John Johansen <john.johansen@canonical.com>
Cc: <stable@vger.kernel.org>
12 years agoeCryptfs: Improve statfs reporting
Tyler Hicks [Sat, 5 Nov 2011 17:45:08 +0000 (13:45 -0400)]
eCryptfs: Improve statfs reporting

statfs() calls on eCryptfs files returned the wrong filesystem type and,
when using filename encryption, the wrong maximum filename length.

If mount-wide filename encryption is enabled, the cipher block size and
the lower filesystem's max filename length will determine the max
eCryptfs filename length. Pre-tested, known good lengths are used when
the lower filesystem's namelen is 255 and a cipher with 8 or 16 byte
block sizes is used. In other, less common cases, we fall back to a safe
rounded-down estimate when determining the eCryptfs namelen.

https://launchpad.net/bugs/885744

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: John Johansen <john.johansen@canonical.com>