pandora-kernel.git
12 years agomfd: Add missing <linux/io.h> include to intel_msic
Mika Westerberg [Fri, 21 Oct 2011 08:56:26 +0000 (11:56 +0300)]
mfd: Add missing <linux/io.h> include to intel_msic

Without this header we might get following compilation errors:

drivers/mfd/intel_msic.c:303:2: error: implicit declaration of function 'readb'
drivers/mfd/intel_msic.c:433:2: error: implicit declaration of function 'ioremap_nocache'
drivers/mfd/intel_msic.c:433:17: warning: assignment makes pointer from integer without a cast
drivers/mfd/intel_msic.c:455:2: error: implicit declaration of function 'iounmap'

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agox86, mrst: add platform support for MSIC MFD driver
Mika Westerberg [Tue, 18 Oct 2011 09:41:22 +0000 (12:41 +0300)]
x86, mrst: add platform support for MSIC MFD driver

The MSIC MFD driver creates platform devices for MSIC device drivers so we
don't need to create them in platform code anymore.

This patch adds a new runtime check which determines whether we are running
on a Medfield platform and enables the MSIC MFD driver accordingly.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Expose TurnOnStatus in ab8500 sysfs
Andrew Lynn [Tue, 11 Oct 2011 08:49:47 +0000 (10:49 +0200)]
mfd: Expose TurnOnStatus in ab8500 sysfs

Expose TurnOnStatus (Power key, RTC alarm, Vbus detect, etc) in
sysfs. This magic value can be read by system users to determine
what caused the platform to turn on last (this) time.

Signed-off-by: Andrew Lynn <andrew.lynn@stericsson.com>
Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Reviewed-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: Remove support for early drop ab8500 chip
Mattias Wallin [Tue, 11 Oct 2011 08:49:39 +0000 (10:49 +0200)]
mfd: Remove support for early drop ab8500 chip

This patch removes the early drop version of ab8500 which have
the really bad version nr 0x0. This chip should not be found in
the wild and only exist as ST-Ericsson scrap equipment.

Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>
Reviewed-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: Add support for ab8500 v3.3
Mattias Wallin [Tue, 11 Oct 2011 08:49:32 +0000 (10:49 +0200)]
mfd: Add support for ab8500 v3.3

This patch adds support for ab8500 cut 3, MetalFix 3 or v3.3.

Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>
Reviewed-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: Add ab8500 interrupt disable hook
Virupax Sadashivpetimath [Tue, 11 Oct 2011 08:49:17 +0000 (10:49 +0200)]
mfd: Add ab8500 interrupt disable hook

Add the missing interrupt disable hook in the irq_chip
callbacks for ab8500.

Signed-off-by: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>
Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Convert db8500-prcmu panic() into pr_crit()
Linus Walleij [Mon, 10 Oct 2011 11:04:44 +0000 (13:04 +0200)]
mfd: Convert db8500-prcmu panic() into pr_crit()

panic() is too heavy for this, indeed the PRCMU is critical for
the system but not to the point that we should stop everything,
if we can still get a prompt or so.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Refactor db8500-prcmu request_clock() function
Linus Walleij [Mon, 10 Oct 2011 10:14:14 +0000 (12:14 +0200)]
mfd: Refactor db8500-prcmu request_clock() function

This refactors the mfd/dbx500-prcmu drivers to use a switch()
statement rather than nested if/else-construction.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Rename db8500-prcmu init function
Linus Walleij [Wed, 5 Oct 2011 16:50:47 +0000 (18:50 +0200)]
mfd: Rename db8500-prcmu init function

This renames the PRCMU clock force initialization function
to have a less generic name.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix db5500-prcmu defines
Linus Walleij [Fri, 12 Aug 2011 08:29:10 +0000 (10:29 +0200)]
mfd: Fix db5500-prcmu defines

This fixes two erroneous defines for the PLLs and adds new
defines for the reset pin controls.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: db8500-prcmu voltage domain consumers additions
Bengt Jonsson [Fri, 12 Aug 2011 08:29:02 +0000 (10:29 +0200)]
mfd: db8500-prcmu voltage domain consumers additions

This rectifies the device name of the MCDE voltage domain
regulator consumer and adds a number of other consumers to
the voltage domains.

Cc: Liam Girdwood <lrg@ti.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.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-prcmu reset code retrieval
Sebastian Rasmussen [Fri, 12 Aug 2011 08:28:53 +0000 (10:28 +0200)]
mfd: db8500-prcmu reset code retrieval

This implements the reset code retrieval function so we can
ipso facto get to know how the system was reset.

Signed-off-by: Sebastian Rasmussen <sebastian.rasmussen@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: db8500-prcmu tweak for modem wakeup
Mattias Nilsson [Fri, 12 Aug 2011 08:28:43 +0000 (10:28 +0200)]
mfd: db8500-prcmu tweak for modem wakeup

This is a tweak for the case where the modem goes to sleep while
emitting the AC_WAKE_ACK anyway. Also print the modem errors as
critical, since they jeopardize the entire platform when they
occur.

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: Add db8500-pcmu watchdog accessor functions for watchdog
Jonas Aberg [Fri, 12 Aug 2011 08:28:33 +0000 (10:28 +0200)]
mfd: Add db8500-pcmu watchdog accessor functions for watchdog

This implements the watchdog accessor functions for the DB8500
PRCMU, making it possible to implement the watchdog driver.

Signed-off-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: hwacc power state db8500-prcmu accessor
Bengt Jonsson [Fri, 12 Aug 2011 08:28:25 +0000 (10:28 +0200)]
mfd: hwacc power state db8500-prcmu accessor

This implements the accessor function for hardware accelerator
power state settings.

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 db8500-prcmu accessors for PLL and SGA clock
Mattias Nilsson [Fri, 12 Aug 2011 08:28:18 +0000 (10:28 +0200)]
mfd: Add db8500-prcmu accessors for PLL and SGA clock

This extends the DB8500 PRCMU driver with accessor calls for the
PRCMU PLL and SGA clocks.

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: Move to the new db500 PRCMU API
Mattias Nilsson [Fri, 12 Aug 2011 08:28:10 +0000 (10:28 +0200)]
mfd: Move to the new db500 PRCMU API

Now that we have a shared API between the DB8500 and DB5500
PRCMU's, switch to using this neutral API instead. We delete the
parts of db8500-prcmu.h that is now PRCMU-neutral, and calls will
be diverted to respective driver. Common registers are in
dbx500-prcmu-regs.h and common accessors and defines in
<linux/mfd/dbx500-prcmu.h> This way we get a a lot more
abstraction and code reuse.

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: Create a common interface for dbx500 PRCMU drivers
Mattias Nilsson [Fri, 12 Aug 2011 08:28:02 +0000 (10:28 +0200)]
mfd: Create a common interface for dbx500 PRCMU drivers

This adds a header file that contains the set of functions and
definitions that will be shared between the DB8500 and DB5500
PRCMU drivers.

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: Initialize DB8500 PRCMU regs
Mattias Nilsson [Fri, 12 Aug 2011 08:27:50 +0000 (10:27 +0200)]
mfd: Initialize DB8500 PRCMU regs

Some clocks may be force enabled when we probe the
driver, but they need to be turned off by default so
we have a known state. We call this the register
initialization function if we need more stuff in
there in the future.

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: Extend DB8500 PRCMU mailbox defs
Mattias Nilsson [Fri, 12 Aug 2011 08:27:41 +0000 (10:27 +0200)]
mfd: Extend DB8500 PRCMU mailbox defs

We have a few more mailboxes and fixed messages in the
DB8500 PRCMU, update to match the latest specification.

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: Refactor DB8500 PRCMU reg access
Mattias Nilsson [Fri, 12 Aug 2011 08:27:20 +0000 (10:27 +0200)]
mfd: Refactor DB8500 PRCMU reg access

Instead of carrying around the __PRCMU_BASE in every read or
write to the PRCMU registers, move it out to the register
definition file and define registers along with their base
offset so that the code gets easier to read.

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: Fix aat2870 build failure for x86_64
Jin Park [Tue, 4 Oct 2011 10:35:07 +0000 (12:35 +0200)]
mfd: Fix aat2870 build failure for x86_64

Without this fix, we get:

error: call to ‘copy_from_user_overflow’ declared with attribute error:
copy_from_user() buffer size is not provably correct
make[3]: *** [drivers/mfd/aat2870-core.o] Error 1

And this was triggered by commit da417bacc9143b934f1a480a25d0fb2bb648a820

Signed-off-by: Jin Park <jinyoungp@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Disable twl6030 IRQ during suspend
Todd Poynor [Mon, 26 Sep 2011 23:44:24 +0000 (16:44 -0700)]
mfd: Disable twl6030 IRQ during suspend

Module IRQs may still be disabled by DPM at the time the TWL6030
ISR runs, causing handle_simple_irq() to silently do nothing.
This may result in missing TWL RTC alarm wakeups, for example,
since the RTC child module ISR is not called to ack the IRQ.

Disable the TWL6030 IRQ during suspend, enable it at DPM resume
time, at which time the child module IRQs will be re-enabled.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix twl6030 lockdep recursion warning on setting wake IRQs
Todd Poynor [Tue, 4 Oct 2011 09:52:29 +0000 (11:52 +0200)]
mfd: Fix twl6030 lockdep recursion warning on setting wake IRQs

LOCKDEP explicitly sets all irq_desc locks as a single lock-class,
causing "possible recursive locking detected" when the TWL RTC
driver calls through enable_irq_wake to twl6030_irq_set_wake,
which recursively calls irq_set_irq_wake.  Although the
irq_desc and lock are different, LOCKDEP treats these as
equivalent, presumably due to problems that can be incurred
when locking more than one irq_desc, so best to avoid this.

Suspend/resume actions implemented as PM notifiers to avoid
touch the TWL core for this.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoARM: imx/mx31moboard: use mc13xxx structs instead of removed mc13783 structs
Uwe Kleine-König [Mon, 26 Sep 2011 06:50:55 +0000 (08:50 +0200)]
ARM: imx/mx31moboard: use mc13xxx structs instead of removed mc13783 structs

This is needed with patch

mfd: Remove mc13783 API functions and symbols

(currently cde41c030 in next)

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix a sparse warning about mc13xxx_chipname not being declared
Uwe Kleine-König [Fri, 23 Sep 2011 19:51:42 +0000 (21:51 +0200)]
mfd: Fix a sparse warning about mc13xxx_chipname not being declared

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Delete ab3550 driver
Linus Walleij [Mon, 26 Sep 2011 09:45:30 +0000 (11:45 +0200)]
mfd: Delete ab3550 driver

The AB3550 never passed the prototype stage. Instead it was used
as a precursor to AB5500 for testing basic building blocks used
in that chip, since they had large similarities. Since AB3550 will
not see the light of day in product form and since the prototypes
are no longer used, let's delete the driver and any references to
it.

Cc: 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: Break out ab5500 debugfs code
Linus Walleij [Thu, 22 Sep 2011 06:22:33 +0000 (08:22 +0200)]
mfd: Break out ab5500 debugfs code

This breaks the debugfs portions of the AB5500 driver into its own
file. Split off a _raw function to access registers since we don't
want to expose a generically named function globally. Move all
required data structures to a shared ab5500-core.h file.

Cc: 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 agomach-ux500: ab5500 platform code added
Mattias Wallin [Thu, 22 Sep 2011 06:22:27 +0000 (08:22 +0200)]
mach-ux500: ab5500 platform code added

This patch adds the platform part needed to get the
ab5500-core driver started.

Signed-off-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: ab5500 chip register access
Mattias Wallin [Thu, 22 Sep 2011 06:22:18 +0000 (08:22 +0200)]
mfd: ab5500 chip register access

The analog baseband chip ab5500 is a multi functional chip
containing regulators, charging, gpio, USB and accessory detect.
It also contain various multimedia functionalities like digital
encoder and audio codec.
The core driver added with this patch provides register access via
i2c via PRCMU. Event handling implemented as irq_chip will come in
future patches since it depends on PRCMU functionality not yet
implemented.

Signed-off-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: Do not leak init_data in tps65912_device_init()
Jesper Juhl [Tue, 20 Sep 2011 21:13:06 +0000 (14:13 -0700)]
mfd: Do not leak init_data in tps65912_device_init()

We neglect to free init_data on successful exit.  I also moved two
assignments to just before they are needed.  This avoids doing them in
case we hit an earlier error exit from the function.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: Margarita Olaya Cabrera <magi@slimlogic.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix ab3100 initconst section
Andi Kleen [Mon, 26 Sep 2011 08:47:05 +0000 (10:47 +0200)]
mfd: Fix ab3100 initconst section

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agox86, mrst: Some drivers need to known when an SCU is available
Alan Cox [Wed, 7 Sep 2011 13:06:51 +0000 (16:06 +0300)]
x86, mrst: Some drivers need to known when an SCU is available

Add a notifier so that drivers can hook into SCU availability in order to
take actions post initialisation when/if the SCU becomes available.

In the ideal world we wouldn't need this and we could avoid any init
dependancies of this form, but in practice we can't do it for some cases.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add Intel MSIC driver
Mika Westerberg [Wed, 21 Sep 2011 11:03:07 +0000 (13:03 +0200)]
mfd: Add Intel MSIC driver

Add support for Intel MSIC chip found on Intel Medfield platforms. This
chip embeds several subdevices: audio, ADC, GPIO, power button, etc. The
driver creates platform device for each subdevice.

We also provide an MSIC register access API which should replace the more
generic SCU IPC interface currently used. Existing drivers can choose
whether they convert to this new API or stick with the SCU IPC interface.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Make jz4740_adc_driver static
Lars-Peter Clausen [Mon, 19 Sep 2011 14:19:09 +0000 (16:19 +0200)]
mfd: Make jz4740_adc_driver static

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoregulator: Finish mc13783 conversion to the mc13xxx API
Samuel Ortiz [Mon, 19 Sep 2011 09:33:17 +0000 (11:33 +0200)]
regulator: Finish mc13783 conversion to the mc13xxx API

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoleds: Finish mc13783 conversion to the mc13xxx API
Samuel Ortiz [Sun, 18 Sep 2011 17:12:34 +0000 (19:12 +0200)]
leds: Finish mc13783 conversion to the mc13xxx API

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Simulate active high IRQs with wm831x
Mark Brown [Fri, 16 Sep 2011 12:21:47 +0000 (13:21 +0100)]
mfd: Simulate active high IRQs with wm831x

In order to ease system integration provide a simulation of active high
IRQs on the GPIOs by polling the GPIO status when an IRQ is generated.

This isn't ideal on several fronts and will miss initially active IRQs in
the current implementation but it should work well for most cases.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoARM: imx/mx31moboard: Add mc13783 power button support
Philippe Rétornaz [Fri, 22 Jul 2011 14:17:12 +0000 (16:17 +0200)]
ARM: imx/mx31moboard: Add mc13783 power button support

Add the power-on button on mx31moboard using MC13783 PMIC.

Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoinput: Add power button support for mc13783
Philippe Rétornaz [Sun, 18 Sep 2011 16:10:53 +0000 (18:10 +0200)]
input: Add power button support for mc13783

This adds support for the power-on buttons of MC13783 PMIC.

Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove unused mc13xxx defines
Philippe Rétornaz [Sun, 18 Sep 2011 15:57:35 +0000 (17:57 +0200)]
mfd: Remove unused mc13xxx defines

Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoARM: imx+mc13xxx: remove obsolete leds and regulators flags
Philippe Rétornaz [Sun, 18 Sep 2011 15:52:33 +0000 (17:52 +0200)]
ARM: imx+mc13xxx: remove obsolete leds and regulators flags

Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Implicitly register mc13xxx led subdevice
Philippe Rétornaz [Fri, 22 Jul 2011 14:17:08 +0000 (16:17 +0200)]
mfd: Implicitly register mc13xxx led subdevice

A led subdevice is registered now iff the corresponding platform data is
available. Without platform data the device isn't usable so this is a
sound check.

Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Unconditionally register mc13xxx regulator subdevice
Philippe Rétornaz [Fri, 22 Jul 2011 14:17:07 +0000 (16:17 +0200)]
mfd: Unconditionally register mc13xxx regulator subdevice

Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove IRQF_DISABLED flag from twl4030-irq
Samuel Ortiz [Thu, 15 Sep 2011 19:56:08 +0000 (21:56 +0200)]
mfd: Remove IRQF_DISABLED flag from twl4030-irq

IRQF_DISABLED is a NOOP and is scheduled for removal.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove IRQF_DISABLED
Yong Zhang [Thu, 15 Sep 2011 19:52:09 +0000 (21:52 +0200)]
mfd: Remove IRQF_DISABLED

This flag is a NOOP and can be removed now.

Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Set twl6030 irq_wake infrastructure up
Santosh Shilimkar [Tue, 6 Sep 2011 15:59:30 +0000 (21:29 +0530)]
mfd: Set twl6030 irq_wake infrastructure up

TWL6030 devices have an interrupt line which is connected to
application processor like OMAP. These devices support multiple features
such as MMC card detect, USB cable detect, RTC interrupt, etc. that must
wake up the application processor.

With this change, TWL6030 client drivers can make use of
irq_wake() if the wakeup is desirable on it's irq events.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Support software initiated shutdown of WM831x PMICs
Mark Brown [Thu, 15 Sep 2011 16:54:53 +0000 (18:54 +0200)]
mfd: Support software initiated shutdown of WM831x PMICs

In systems where there is no hardware signal from the processor to the
PMIC to initiate the final power off sequence we must initiate the
shutdown with a register write to the PMIC. Support such systems in the
driver. Since this may prevent a full shutdown of the system platform
data is used to enable the feature.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix twl4030 dependencies for audio codec
Thomas Weber [Mon, 5 Sep 2011 09:26:33 +0000 (11:26 +0200)]
mfd: Fix twl4030 dependencies for audio codec

The codec for Devkit8000 (TWL4030)  was not detected except
when build with CONFIG_SND_SOC_ALL_CODECS.

twl-core.c still uses the CONFIG_TWL4030_CODEC for
twl_has_codec().

In commit 57fe7251f5bfc4332f24479376de48a1e8ca6211
the CONFIG_TWL4030_CODEC was renamed
into CONFIG_MFD_TWL4030_AUDIO, thatswhy the codec
was not detected.

This patch renames the CONFIG_ TWL4030_CODEC into
CONFIG_MFD_TWL4030_AUDIO in twl-core.c.

Signed-off-by: Thomas Weber <weber@corscience.de>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: remove CONFIG_MFD_SUPPORT
Arnd Bergmann [Fri, 2 Sep 2011 14:43:36 +0000 (16:43 +0200)]
mfd: remove CONFIG_MFD_SUPPORT

We currently have two symbols to control compilation the MFD subsystem,
MFD_SUPPORT and MFD_CORE. The MFD_SUPPORT is actually not required
at all, it only hides the submenu when not set, with the effect that
Kconfig warns about missing dependencies when another driver selects
an MFD driver while MFD_SUPPORT is disabled. Turning the MFD submenu
back from menuconfig into a plain menu simplifies the Kconfig syntax
for those kinds of users and avoids the surprise when the menu
suddenly appears because another driver was enabled that selects this
symbol.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
12 years agomfd: Remove mc13783 API functions and symbols
Uwe Kleine-König [Wed, 24 Aug 2011 13:28:25 +0000 (15:28 +0200)]
mfd: Remove mc13783 API functions and symbols

Now that all in-tree users are fixed to use the more general mc13xxx API
the obsolete stuff can go away.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agohwmon: Convert mc13783-adc to mc13xxx API
Uwe Kleine-König [Wed, 24 Aug 2011 13:28:24 +0000 (15:28 +0200)]
hwmon: Convert mc13783-adc to mc13xxx API

The mc13783_... functions are going to be removed, so switch to the
more generic API.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoARM: imx: use mc13xxx constants instead of mc13783
Uwe Kleine-König [Wed, 24 Aug 2011 13:28:23 +0000 (15:28 +0200)]
ARM: imx: use mc13xxx constants instead of mc13783

The latter constants are going to be removed in favour of the former

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoinput: Convert mc13783-ts to mc13xxx API
Uwe Kleine-König [Wed, 24 Aug 2011 13:28:22 +0000 (15:28 +0200)]
input: Convert mc13783-ts to mc13xxx API

This is the first step to also support the touch interface of the mc13892
pmic chip.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Provide a generic version of mc13xxx adc_do_conversion
Uwe Kleine-König [Wed, 24 Aug 2011 13:28:21 +0000 (15:28 +0200)]
mfd: Provide a generic version of mc13xxx adc_do_conversion

This is needed to convert the touch driver away from using struct mc13783.

Note this patch drops MC13783_ADC0_ADREFMODE. This is unused and doesn't
exist on mc13892.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoleds: Convert mc13783 driver to mc13xxx MFD
David Jander [Wed, 24 Aug 2011 13:28:20 +0000 (15:28 +0200)]
leds: Convert mc13783 driver to mc13xxx MFD

mc13xxx is the more general API and most of the mc13783_... functions
are going to die.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Select REGMAP_I2C from WM8400
Mark Brown [Tue, 23 Aug 2011 17:56:19 +0000 (18:56 +0100)]
mfd: Select REGMAP_I2C from WM8400

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Set twl4030-irq irq nested flag
Felipe Balbi [Thu, 30 Jun 2011 09:51:09 +0000 (12:51 +0300)]
mfd: Set twl4030-irq irq nested flag

Threads from twl4030's children will be called
nested in the context of the demultiplexing
handler on twl4030-irq.c.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Drop twl4030-irq's edge_work
Felipe Balbi [Thu, 30 Jun 2011 09:51:08 +0000 (12:51 +0300)]
mfd: Drop twl4030-irq's edge_work

... and do all the synchronization with the
hardware during bus_sync_unlock. We can now
remove all the workqueues.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Drop twl4030-irq's mask_work
Felipe Balbi [Thu, 30 Jun 2011 09:51:07 +0000 (12:51 +0300)]
mfd: Drop twl4030-irq's mask_work

... we can do the synchronization with the
hardware when calling bus_sync_unlock as
we're supposed to. While at that, also make
variable names uniform on all functions.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Drop the twl4030-irq kthread
Felipe Balbi [Thu, 30 Jun 2011 09:51:06 +0000 (12:51 +0300)]
mfd: Drop the twl4030-irq kthread

... and use threaded IRQ infrastructure. Later
patches will come dropping both workqueues and
setting the nested thread flag.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Implement bus_lock/bus_sync_unlock twl4030-irq methods
Felipe Balbi [Thu, 30 Jun 2011 09:51:05 +0000 (12:51 +0300)]
mfd: Implement bus_lock/bus_sync_unlock twl4030-irq methods

For doing that, drop the locking and change that
to a mutex.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove twl4030-irq trailing whitespaces
Felipe Balbi [Thu, 30 Jun 2011 09:51:04 +0000 (12:51 +0300)]
mfd: Remove twl4030-irq trailing whitespaces

trivial patch, no functional changes.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Wake-up from Suspend MAX8997 support
MyungJoo Ham [Fri, 19 Aug 2011 05:39:40 +0000 (14:39 +0900)]
mfd: Wake-up from Suspend MAX8997 support

- Support wake-up from suspend-to-ram.
- Handle pending interrupt after a resume.
- If pdata->wakeup is enabled, by default, the device is assumed to be
capable of wakeup (the interrupt pin is connected to a wakeup-source GPIO)
and may wakeup the system (MAX8997 has a power button input pin).

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add more checks for WM8994 being active during suspend
Mark Brown [Sat, 13 Aug 2011 05:37:48 +0000 (14:37 +0900)]
mfd: Add more checks for WM8994 being active during suspend

Enhancements to the WM8994 audio driver and new features on more modern
devices in the series mean that we can no longer rely on VMID being active
as an indication that the device is active. Add further checks for digital
paths and microphone detection.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoarm: BeagleBoard: add support for the twl4030-madc
Kyle Manna [Fri, 12 Aug 2011 03:33:15 +0000 (22:33 -0500)]
arm: BeagleBoard: add support for the twl4030-madc

Signed-off-by: Kyle Manna <kyle@kylemanna.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Turn on the twl4030-madc MADC clock
Kyle Manna [Fri, 12 Aug 2011 03:33:13 +0000 (22:33 -0500)]
mfd: Turn on the twl4030-madc MADC clock

Without turning the MADC clock on, no MADC conversions occur.

$ cat /sys/class/hwmon/hwmon0/device/in8_input
[   53.428436] twl4030_madc twl4030_madc: conversion timeout!
cat: read error: Resource temporarily unavailable

Signed-off-by: Kyle Manna <kyle@kylemanna.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Allow WM8994 LDO enable pulls to be disabled
Mark Brown [Mon, 22 Aug 2011 13:43:55 +0000 (15:43 +0200)]
mfd: Allow WM8994 LDO enable pulls to be disabled

In systems where the LDO enables are always driven (for example, being
connected to an always on supply rail or a GPIO which is driven by the
CPU even in suspend) then we can disable the pull downs on the LDO for
a small power savings.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Make sure to request twl6030 IRQ before using the irq_num
Axel Lin [Thu, 11 Aug 2011 07:21:00 +0000 (15:21 +0800)]
mfd: Make sure to request twl6030 IRQ before using the irq_num

I was trying to fix the error handling part because in the case of
request_irq failure, it should call kthread_stop instead of free_irq.
But it seems more reasonable to do request_irq before calling kthread_run.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Refactor ab8500 GPADC API, add raw access
Karl Komierowski [Wed, 10 Aug 2011 13:09:43 +0000 (15:09 +0200)]
mfd: Refactor ab8500 GPADC API, add raw access

Refactor the GPADC interface to avoid bugs in calling code:

- ab8500_gpadc_[convert|read_raw|ad_to_voltage] clarifies
  each functions use case, *convert wraps *read_raw, and we
  can access raw ADC values properly.
- Renamed gpadc function arguments from "input" to "channel" to
  clarify use, so we don't get confused again.

Signed-off-by: Kalle Komierowski <kalle.komierowski@stericsson.com>
Reviewed-by: Mattias Wallin <mattias.wallin@stericsson.com>
Reviewed-by: John Beckett <john.beckett@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Clean timberdale error handling code up
Julia Lawall [Wed, 10 Aug 2011 08:47:16 +0000 (10:47 +0200)]
mfd: Clean timberdale error handling code up

In the first three cases, ioremap has been called, so iounmap is needed.  A
new label for this is introduced, to differentiate it from err_msix, which
is the first point at which msix_entries actually needs to be freed.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add missing #ifdef around tc3589x PM block
Linus Walleij [Tue, 9 Aug 2011 18:37:17 +0000 (20:37 +0200)]
mfd: Add missing #ifdef around tc3589x PM block

The CONFIG_PM code was unconditionally compiled in despite
the dev_pm_ops only being included into the driver struct
if used. Fix this by adding the missing #ifdef.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Define asic3 gpio_chip label
Paul Parsons [Tue, 9 Aug 2011 16:27:50 +0000 (16:27 +0000)]
mfd: Define asic3 gpio_chip label

Defined the gpio_chip label in the mfd/asic3 driver for diagnostics.

Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Make asic3_clk_enable() a void function
Paul Parsons [Tue, 9 Aug 2011 16:27:43 +0000 (16:27 +0000)]
mfd: Make asic3_clk_enable() a void function

The return value of asic3_clk_enable() was neither used nor useful. So let's
make it a void function, and thereby match asic3_clk_disable().

Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Add asic3 based LED suspend/resume handlers
Paul Parsons [Tue, 9 Aug 2011 16:27:33 +0000 (16:27 +0000)]
mfd: Add asic3 based LED suspend/resume handlers

Added led suspend/resume handlers to the leds/leds-asic3 and mfd/asic3 drivers.
On suspend the leds will be turned off and their clocks disabled. On resume the
reverse.

Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix asic3 based SD card resume after suspend
Paul Parsons [Tue, 9 Aug 2011 16:27:24 +0000 (16:27 +0000)]
mfd: Fix asic3 based SD card resume after suspend

The mfd/asic3 driver did not define the suspend/resume handlers for the mmc cell
driver. Consequently the mmc driver did not resume properly after returning from
suspend, making sd cards unusable and preventing suspend from being entered a
second time. This patch adds the suspend/resume handlers, fixing the problem.

Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Remove spurious newlines from wm831x-irq.c
Mark Brown [Tue, 9 Aug 2011 05:05:29 +0000 (14:05 +0900)]
mfd: Remove spurious newlines from wm831x-irq.c

More annoying than usual as they're in the middle of a function.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Convert pcf50633 to use new register map API
Mark Brown [Mon, 8 Aug 2011 08:04:40 +0000 (17:04 +0900)]
mfd: Convert pcf50633 to use new register map API

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Tested-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agomfd: Fix section mismatch warning in ab3550-core
Wanlong Gao [Thu, 4 Aug 2011 04:32:31 +0000 (12:32 +0800)]
mfd: Fix section mismatch warning in ab3550-core

This patch fixes:
WARNING: drivers/mfd/built-in.o(.data+0x9998): Section mismatch in reference from the variable ab3550_driver to the function .init.text:ab3550_probe()
The variable ab3550_driver references
the function __init ab3550_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoLinux 3.1 v3.1
Linus Torvalds [Mon, 24 Oct 2011 07:10:05 +0000 (09:10 +0200)]
Linux 3.1

12 years agoMerge git://git.infradead.org/iommu-2.6
Linus Torvalds [Mon, 24 Oct 2011 05:08:24 +0000 (07:08 +0200)]
Merge git://git.infradead.org/iommu-2.6

* git://git.infradead.org/iommu-2.6:
  intel-iommu: fix superpage support in pfn_to_dma_pte()
  intel-iommu: set iommu_superpage on VM domains to lowest common denominator
  intel-iommu: fix return value of iommu_unmap() API
  MAINTAINERS: Update VT-d entry for drivers/pci -> drivers/iommu move
  intel-iommu: Export a flag indicating that the IOMMU is used for iGFX.
  intel-iommu: Workaround IOTLB hang on Ironlake GPU
  intel-iommu: Fix AB-BA lockdep report

12 years agoMerge branch 'for-linus' of http://people.redhat.com/agk/git/linux-dm
Linus Torvalds [Mon, 24 Oct 2011 05:05:38 +0000 (07:05 +0200)]
Merge branch 'for-linus' of people.redhat.com/agk/git/linux-dm

* 'for-linus' of http://people.redhat.com/agk/git/linux-dm:
  dm kcopyd: fix job_pool leak

12 years agox86: Fix S4 regression
Takashi Iwai [Sun, 23 Oct 2011 21:19:12 +0000 (23:19 +0200)]
x86: Fix S4 regression

Commit 4b239f458 ("x86-64, mm: Put early page table high") causes a S4
regression since 2.6.39, namely the machine reboots occasionally at S4
resume.  It doesn't happen always, overall rate is about 1/20.  But,
like other bugs, once when this happens, it continues to happen.

This patch fixes the problem by essentially reverting the memory
assignment in the older way.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: Yinghai Lu <yinghai.lu@oracle.com>
[ We'll hopefully find the real fix, but that's too late for 3.1 now ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agodm kcopyd: fix job_pool leak
Alasdair G Kergon [Sun, 23 Oct 2011 19:55:17 +0000 (20:55 +0100)]
dm kcopyd: fix job_pool leak

Fix memory leak introduced by commit a6e50b409d3f9e0833e69c3c9cca822e8fa4adbb
(dm snapshot: skip reading origin when overwriting complete chunk).

When allocating a set of jobs from kc->job_pool, job->master_job must be
set (to point to itself) so that the mempool item gets freed when the
master_job completes.

master_job was introduced by commit c6ea41fbbe08f270a8edef99dc369faf809d1bd6
(dm kcopyd: preallocate sub jobs to avoid deadlock)

Reported-by: Michael Leun <ml@newton.leun.net>
Cc: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
12 years agoMerge branch 'samsung-fixes-4' of git://github.com/kgene/linux-samsung
Linus Torvalds [Sun, 23 Oct 2011 07:44:40 +0000 (10:44 +0300)]
Merge branch 'samsung-fixes-4' of git://github.com/kgene/linux-samsung

* 'samsung-fixes-4' of git://github.com/kgene/linux-samsung:
  ARM: S3C24XX: Fix s3c24xx build errors if !CONFIG_PM
  ARM: S5P: fix offset calculation on gpio-interrupt

12 years agoMerge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
Linus Torvalds [Sun, 23 Oct 2011 07:43:31 +0000 (10:43 +0300)]
Merge branch 'hwmon-for-linus' of git://git./linux/kernel/git/groeck/linux-staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (w83627ehf) Fix negative 8-bit temperature values

12 years agoARM: S3C24XX: Fix s3c24xx build errors if !CONFIG_PM
Domenico Andreoli [Fri, 21 Oct 2011 19:00:53 +0000 (04:00 +0900)]
ARM: S3C24XX: Fix s3c24xx build errors if !CONFIG_PM

v2:
- register_syscore_ops(&s3c24xx_irq_syscore_ops) does not need to be
  conditionally compiled out, it is already optimized out on !CONFIG_PM
- fix also s3c2412 and s3c2416 affected by the same build issue

v1:
s3c2440.c fails to build if !CONFIG_PM because in such case
s3c2410_pm_syscore_ops is not defined. Same error should happen also
in s3c2410.c and s3c2442.c

Signed-off-by: Domenico Andreoli <cavokz@gmail.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
12 years agoMerge git://github.com/herbertx/crypto
Linus Torvalds [Fri, 21 Oct 2011 14:02:18 +0000 (17:02 +0300)]
Merge git://github.com/herbertx/crypto

* git://github.com/herbertx/crypto:
  crypto: ghash - Avoid null pointer dereference if no key is set

12 years agoMerge branch 'fix/hda' of git://github.com/tiwai/sound
Linus Torvalds [Fri, 21 Oct 2011 14:01:21 +0000 (17:01 +0300)]
Merge branch 'fix/hda' of git://github.com/tiwai/sound

* 'fix/hda' of git://github.com/tiwai/sound:
  ALSA: HDA: conexant support for Lenovo T520/W520
  ALSA: hda - Add position_fix quirk for Dell Inspiron 1010

12 years agocrypto: ghash - Avoid null pointer dereference if no key is set
Nick Bowler [Thu, 20 Oct 2011 12:16:55 +0000 (14:16 +0200)]
crypto: ghash - Avoid null pointer dereference if no key is set

The ghash_update function passes a pointer to gf128mul_4k_lle which will
be NULL if ghash_setkey is not called or if the most recent call to
ghash_setkey failed to allocate memory.  This causes an oops.  Fix this
up by returning an error code in the null case.

This is trivially triggered from unprivileged userspace through the
AF_ALG interface by simply writing to the socket without setting a key.

The ghash_final function has a similar issue, but triggering it requires
a memory allocation failure in ghash_setkey _after_ at least one
successful call to ghash_update.

  BUG: unable to handle kernel NULL pointer dereference at 00000670
  IP: [<d88c92d4>] gf128mul_4k_lle+0x23/0x60 [gf128mul]
  *pde = 00000000
  Oops: 0000 [#1] PREEMPT SMP
  Modules linked in: ghash_generic gf128mul algif_hash af_alg nfs lockd nfs_acl sunrpc bridge ipv6 stp llc

  Pid: 1502, comm: hashatron Tainted: G        W   3.1.0-rc9-00085-ge9308cf #32 Bochs Bochs
  EIP: 0060:[<d88c92d4>] EFLAGS: 00000202 CPU: 0
  EIP is at gf128mul_4k_lle+0x23/0x60 [gf128mul]
  EAX: d69db1f0 EBX: d6b8ddac ECX: 00000004 EDX: 00000000
  ESI: 00000670 EDI: d6b8ddac EBP: d6b8ddc8 ESP: d6b8dda4
   DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
  Process hashatron (pid: 1502, ti=d6b8c000 task=d6810000 task.ti=d6b8c000)
  Stack:
   00000000 d69db1f0 00000163 00000000 d6b8ddc8 c101a520 d69db1f0 d52aa000
   00000ff0 d6b8dde8 d88d310f d6b8a3f8 d52aa000 00001000 d88d502c d6b8ddfc
   00001000 d6b8ddf4 c11676ed d69db1e8 d6b8de24 c11679ad d52aa000 00000000
  Call Trace:
   [<c101a520>] ? kmap_atomic_prot+0x37/0xa6
   [<d88d310f>] ghash_update+0x85/0xbe [ghash_generic]
   [<c11676ed>] crypto_shash_update+0x18/0x1b
   [<c11679ad>] shash_ahash_update+0x22/0x36
   [<c11679cc>] shash_async_update+0xb/0xd
   [<d88ce0ba>] hash_sendpage+0xba/0xf2 [algif_hash]
   [<c121b24c>] kernel_sendpage+0x39/0x4e
   [<d88ce000>] ? 0xd88cdfff
   [<c121b298>] sock_sendpage+0x37/0x3e
   [<c121b261>] ? kernel_sendpage+0x4e/0x4e
   [<c10b4dbc>] pipe_to_sendpage+0x56/0x61
   [<c10b4e1f>] splice_from_pipe_feed+0x58/0xcd
   [<c10b4d66>] ? splice_from_pipe_begin+0x10/0x10
   [<c10b51f5>] __splice_from_pipe+0x36/0x55
   [<c10b4d66>] ? splice_from_pipe_begin+0x10/0x10
   [<c10b6383>] splice_from_pipe+0x51/0x64
   [<c10b63c2>] ? default_file_splice_write+0x2c/0x2c
   [<c10b63d5>] generic_splice_sendpage+0x13/0x15
   [<c10b4d66>] ? splice_from_pipe_begin+0x10/0x10
   [<c10b527f>] do_splice_from+0x5d/0x67
   [<c10b6865>] sys_splice+0x2bf/0x363
   [<c129373b>] ? sysenter_exit+0xf/0x16
   [<c104dc1e>] ? trace_hardirqs_on_caller+0x10e/0x13f
   [<c129370c>] sysenter_do_call+0x12/0x32
  Code: 83 c4 0c 5b 5e 5f c9 c3 55 b9 04 00 00 00 89 e5 57 8d 7d e4 56 53 8d 5d e4 83 ec 18 89 45 e0 89 55 dc 0f b6 70 0f c1 e6 04 01 d6 <f3> a5 be 0f 00 00 00 4e 89 d8 e8 48 ff ff ff 8b 45 e0 89 da 0f
  EIP: [<d88c92d4>] gf128mul_4k_lle+0x23/0x60 [gf128mul] SS:ESP 0068:d6b8dda4
  CR2: 0000000000000670
  ---[ end trace 4eaa2a86a8e2da24 ]---
  note: hashatron[1502] exited with preempt_count 1
  BUG: scheduling while atomic: hashatron/1502/0x10000002
  INFO: lockdep is turned off.
  [...]

Signed-off-by: Nick Bowler <nbowler@elliptictech.com>
Cc: stable@kernel.org [2.6.37+]
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
12 years agoARM: S5P: fix offset calculation on gpio-interrupt
Marek Szyprowski [Fri, 21 Oct 2011 09:04:54 +0000 (18:04 +0900)]
ARM: S5P: fix offset calculation on gpio-interrupt

Offsets of the irq controller registers were calculated
correctly only for first GPIO bank. This patch fixes
calculation of the register offsets for all GPIO banks.

Reported-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Linus Torvalds [Thu, 20 Oct 2011 19:16:28 +0000 (22:16 +0300)]
Merge git://git./linux/kernel/git/davem/sparc

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc: Add alignment flag to PCI expansion resources
  sparc: Avoid calling sigprocmask()
  sparc: Use set_current_blocked()
  sparc32,leon: SRMMU MMU Table probe fix

12 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Linus Torvalds [Thu, 20 Oct 2011 19:15:20 +0000 (22:15 +0300)]
Merge git://git./linux/kernel/git/davem/net

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
  fib_rules: fix unresolved_rules counting
  r8169: fix wrong eee setting for rlt8111evl
  r8169: fix driver shutdown WoL regression.
  ehea: Change maintainer to me
  pptp: pptp_rcv_core() misses pskb_may_pull() call
  tproxy: copy transparent flag when creating a time wait
  pptp: fix skb leak in pptp_xmit()
  bonding: use local function pointer of bond->recv_probe in bond_handle_frame
  smsc911x: Add support for SMSC LAN89218
  tg3: negate USE_PHYLIB flag check
  netconsole: enable netconsole can make net_device refcnt incorrent
  bluetooth: Properly clone LSM attributes to newly created child connections
  l2tp: fix a potential skb leak in l2tp_xmit_skb()
  bridge: fix hang on removal of bridge via netlink
  x25: Prevent skb overreads when checking call user data
  x25: Handle undersized/fragmented skbs
  x25: Validate incoming call user data lengths
  udplite: fast-path computation of checksum coverage
  IPVS netns shutdown/startup dead-lock
  netfilter: nf_conntrack: fix event flooding in GRE protocol tracker

12 years agohwmon: (w83627ehf) Fix negative 8-bit temperature values
Jean Delvare [Thu, 20 Oct 2011 07:06:45 +0000 (03:06 -0400)]
hwmon: (w83627ehf) Fix negative 8-bit temperature values

Since 8-bit temperature values are now handled in 16-bit struct
members, values have to be cast to s8 for negative temperatures to be
properly handled. This is broken since kernel version 2.6.39
(commit bce26c58df86599c9570cee83eac58bdaae760e4.)

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: stable@kernel.org # 2.6.39+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
12 years agomm: fix race between mremap and removing migration entry
Hugh Dickins [Wed, 19 Oct 2011 19:50:35 +0000 (12:50 -0700)]
mm: fix race between mremap and removing migration entry

I don't usually pay much attention to the stale "? " addresses in
stack backtraces, but this lucky report from Pawel Sikora hints that
mremap's move_ptes() has inadequate locking against page migration.

 3.0 BUG_ON(!PageLocked(p)) in migration_entry_to_page():
 kernel BUG at include/linux/swapops.h:105!
 RIP: 0010:[<ffffffff81127b76>]  [<ffffffff81127b76>]
                       migration_entry_wait+0x156/0x160
  [<ffffffff811016a1>] handle_pte_fault+0xae1/0xaf0
  [<ffffffff810feee2>] ? __pte_alloc+0x42/0x120
  [<ffffffff8112c26b>] ? do_huge_pmd_anonymous_page+0xab/0x310
  [<ffffffff81102a31>] handle_mm_fault+0x181/0x310
  [<ffffffff81106097>] ? vma_adjust+0x537/0x570
  [<ffffffff81424bed>] do_page_fault+0x11d/0x4e0
  [<ffffffff81109a05>] ? do_mremap+0x2d5/0x570
  [<ffffffff81421d5f>] page_fault+0x1f/0x30

mremap's down_write of mmap_sem, together with i_mmap_mutex or lock,
and pagetable locks, were good enough before page migration (with its
requirement that every migration entry be found) came in, and enough
while migration always held mmap_sem; but not enough nowadays, when
there's memory hotremove and compaction.

The danger is that move_ptes() lets a migration entry dodge around
behind remove_migration_pte()'s back, so it's in the old location when
looking at the new, then in the new location when looking at the old.

Either mremap's move_ptes() must additionally take anon_vma lock(), or
migration's remove_migration_pte() must stop peeking for is_swap_entry()
before it takes pagetable lock.

Consensus chooses the latter: we prefer to add overhead to migration
than to mremapping, which gets used by JVMs and by exec stack setup.

Reported-and-tested-by: Paweł Sikora <pluto@agmk.net>
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Andrea Arcangeli <aarcange@redhat.com>
Acked-by: Mel Gorman <mgorman@suse.de>
Cc: stable@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
12 years agosparc: Add alignment flag to PCI expansion resources
Kjetil Oftedal [Wed, 19 Oct 2011 23:20:50 +0000 (16:20 -0700)]
sparc: Add alignment flag to PCI expansion resources

Currently no type of alignment is specified for PCI expansion roms while
parsing the openfirmware tree. This causes calls to pci_map_rom() to fail.
IORESOURCE_SIZEALIGN is the default alignment used for rom resouces in
pci/probe.c, and has been verified to work with various cards on a ultra 10.

Signed-off-By: Kjetil Oftedal <oftedal@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agofib_rules: fix unresolved_rules counting
Yan, Zheng [Mon, 17 Oct 2011 15:20:28 +0000 (15:20 +0000)]
fib_rules: fix unresolved_rules counting

we should decrease ops->unresolved_rules when deleting a unresolved rule.

Signed-off-by: Zheng Yan <zheng.z.yan@intel.com>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agor8169: fix wrong eee setting for rlt8111evl
hayeswang [Thu, 13 Oct 2011 20:14:37 +0000 (20:14 +0000)]
r8169: fix wrong eee setting for rlt8111evl

Correct the wrong parameter for setting EEE for RTL8111E-VL.

Signed-off-by: Hayes Wang <hayeswang@realtek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agor8169: fix driver shutdown WoL regression.
françois romieu [Fri, 14 Oct 2011 00:57:45 +0000 (00:57 +0000)]
r8169: fix driver shutdown WoL regression.

Due to commit 92fc43b4159b518f5baae57301f26d770b0834c9 ("r8169: modify the
flow of the hw reset."), rtl8169_hw_reset stomps during driver shutdown on
RxConfig bits which are needed for WOL on some versions of the hardware.

As these bits were formerly set from the r81{0x, 68}_pll_power_down methods,
factor them out for use in the driver shutdown (rtl_shutdown) handler.

I favored __rtl8169_get_wol() -hardware state indication- over
RTL_FEATURE_WOL as the latter has become a good candidate for removal.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes <hayeswang@realtek.com>
Tested-by: Marc Ballarin <ballarin.marc@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
12 years agoehea: Change maintainer to me
Thadeu Lima de Souza Cascardo [Thu, 13 Oct 2011 09:56:19 +0000 (09:56 +0000)]
ehea: Change maintainer to me

Breno Leitao has passed the maintainership to me.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Cc: Breno Leitao <leitao@linux.vnet.ibm.com>
Acked-by: Breno Leitão <leitao@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>