pandora-kernel.git
14 years agoMerge branch 'next-i2c-mpc-v8' into next-i2c
Ben Dooks [Sun, 7 Mar 2010 22:29:13 +0000 (22:29 +0000)]
Merge branch 'next-i2c-mpc-v8' into next-i2c

14 years agoi2c: Add support for Xilinx XPS IIC Bus Interface
Richard Röjfors [Thu, 11 Feb 2010 09:42:00 +0000 (10:42 +0100)]
i2c: Add support for Xilinx XPS IIC Bus Interface

This patch adds support for the Xilinx XPS IIC Bus Interface.

The driver uses the dynamic mode, supporting to put several
I2C messages in the FIFO to reduce the number of interrupts.

It has the same feature as ocores, it can be passed a list
of devices that will be added when the bus is probed.

Signed-off-by: Richard Röjfors <richard.rojfors@pelagicore.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c: omap: Add support for 16-bit registers
Cory Maccarrone [Sun, 13 Dec 2009 01:54:02 +0000 (17:54 -0800)]
i2c: omap: Add support for 16-bit registers

The current i2c-omap driver is set up for 32-bit registers, which
corresponds to most OMAP devices.  However, OMAP730/850 based
devices use a 16-bit register size.

This change modifies the driver to perform a runtime CPU type check
to determine the register sizes, and uses a bit shift of either 1
or 2 bits to compute the proper register sizes for all registers.

Signed-off-by: Cory Maccarrone <darkstar6262@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-pnx: fix setting start/stop condition
Luotao Fu [Mon, 1 Mar 2010 12:24:24 +0000 (13:24 +0100)]
i2c-pnx: fix setting start/stop condition

The start/stop condtions are set in different places repetedly in the i2c-pnx
driver.  Beside in i2c_pnx_start and i2c_pnx_stop the start/stop bit are also
set during the transfer of a i2c message in the master_xmit/rcv calls. This is
wrong since we can't set the start/stop condition during the transaction of a
single message any way. As a matter of fact, the driver will sometimes set both
the start and the stop bits at one time. This can be easily reproduced by
sending a simple read request like e.g
struct i2c_msg msgs[] = {
{ addr, 0, 1, buf },
{ addr, I2C_M_RD, offset, buf }
};
While processing the first message the i2c_pnx_master_xmit will set both the
start_bit and the stop_bit, which will eventually confuse the slave.

Fixed by remove setting start/stop condition from the transmit routines.

Signed-off-by: Luotao Fu <l.fu@pengutronix.de>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agopowerpc: doc/dts-bindings: update doc of FSL I2C bindings
Wolfgang Grandegger [Wed, 17 Feb 2010 10:19:20 +0000 (11:19 +0100)]
powerpc: doc/dts-bindings: update doc of FSL I2C bindings

This patch adds the MPC5121 to the list of supported devices,
enhances the doc of the "clock-frequency" property and removes
the obsolete "cell-index", "device_type" and "fsl-i2c" property.
Furthermore an example for the MPC5121 has been added.

Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-mpc: add support for the MPC512x processors from Freescale
Wolfgang Grandegger [Wed, 17 Feb 2010 10:19:19 +0000 (11:19 +0100)]
i2c-mpc: add support for the MPC512x processors from Freescale

As I2C interrupts must  be enabled for the MPC512x by the setup function
as well, "fsl,preserve-clocking" is handled in a slighly different way.
Also, the old settings are now reported calling dev_dbg(). For the
MPC512x the clock setup function of the MPC52xx can be re-used.
Furthermore, the Kconfig help has been updated and corrected.

Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-mpc: rename "setclock" initialization functions to "setup"
Wolfgang Grandegger [Wed, 17 Feb 2010 10:19:18 +0000 (11:19 +0100)]
i2c-mpc: rename "setclock" initialization functions to "setup"

To prepare  support for the MPC512x processors from Freescale the
"setclock" initialization functions have been renamed to "setup"
because I2C interrupts must be enabled for the MPC512x by this
function as well.

Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c-mpc: use __devinit[data] for initialization functions and data
Wolfgang Grandegger [Wed, 17 Feb 2010 10:19:17 +0000 (11:19 +0100)]
i2c-mpc: use __devinit[data] for initialization functions and data

"__devinit[data]" has not yet been used for all initialization functions
and data. To avoid truncating lines, the struct "mpc_i2c_match_data" has
been renamed to "mpc_i2c_data", which is even the better name.

Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c/imx: don't add probe function to the driver struct
Uwe Kleine-König [Mon, 1 Feb 2010 14:57:25 +0000 (15:57 +0100)]
i2c/imx: don't add probe function to the driver struct

Having a pointer to the probe function is unnecessary when using
platform_driver_probe and yields a section mismatch warning after
removing the white list entry "*driver" for
{ .data$, .data.rel$ } -> { .init.* } mismatches in modpost.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agoi2c: Add support for Ux500/Nomadik I2C controller
srinidhi kasagar [Mon, 1 Feb 2010 14:14:54 +0000 (19:44 +0530)]
i2c: Add support for Ux500/Nomadik I2C controller

This adds support for ST-Ericsson's I2C block found
in Ux500 and Nomadik 8815 platforms.

Signed-off-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com>
Acked-by: Andrea Gallo <andrea.gallo@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Reviewed-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
14 years agomfd: Fix ucb1x00 build failure for collie_defconfig
Peter Huewe [Sat, 6 Mar 2010 13:36:38 +0000 (14:36 +0100)]
mfd: Fix ucb1x00 build failure for collie_defconfig

This patch fixes a build failure[1], by adding the missing semaphore.h include

References:
[1] http://kisskb.ellerman.id.au/kisskb/buildresult/2234322/

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Fix lpc_sch related depends/selects, fix build error
Randy Dunlap [Fri, 5 Mar 2010 17:43:06 +0000 (09:43 -0800)]
mfd: Fix lpc_sch related depends/selects, fix build error

LPC_SCH is selected by GPI_SCH and I2C_ISCH, even when PCI is not
enabled, but LPC_SCH depends on PCI, so make GPI_SCH and I2C_ISCH
also depend on PCI.

Those 2 selects also need to select what LPC_SCH selects,
since kconfig does not follow selects.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Denis Turischev <denis@compulab.co.il>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agogpio: Fix sch_gpio warning
Samuel Ortiz [Fri, 5 Mar 2010 16:14:01 +0000 (17:14 +0100)]
gpio: Fix sch_gpio warning

We need to check for gpiochip_remove() errors.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agogpio: add Intel SCH GPIO controller driver
Denis Turischev [Tue, 2 Mar 2010 09:48:55 +0000 (10:48 +0100)]
gpio: add Intel SCH GPIO controller driver

Signed-off-by: Denis Turischev <denis@compulab.co.il>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agoi2c: convert i2c-isch to platform_device
Denis Turischev [Mon, 1 Mar 2010 16:59:55 +0000 (18:59 +0200)]
i2c: convert i2c-isch to platform_device

Convert i2c-isch to platform_device for the lpc mfd core to add it at probe
time.

Signed-off-by: Denis Turischev <denis@compulab.co.il>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Use completion interrupt for WM831x AUXADC
Mark Brown [Tue, 23 Feb 2010 11:08:06 +0000 (11:08 +0000)]
mfd: Use completion interrupt for WM831x AUXADC

Use the completion interrupt generated by the device rather than
polling for conversions to complete. As a backup we still check
the status of the AUXADC if we don't get a completion, mostly for
systems that don't have the WM831x interrupt infrastructure hooked
up.

Also reduce the timeout for completion of conversions to 5ms from
the previous 10ms, the lower timeout should be sufficient.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Use completion interrupt for WM835x AUXADC
Mark Brown [Tue, 23 Feb 2010 11:08:05 +0000 (11:08 +0000)]
mfd: Use completion interrupt for WM835x AUXADC

Use the completion interrupt generated by the device rather than
polling for conversions to complete. As a backup we still check
the state of the AUXADC if we don't get a completion, mostly for
systems that don't have the WM8350 interrupt infrastructure hooked
up.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Introduce remove_script function for twl4030
Mike Turquette [Mon, 22 Feb 2010 17:16:30 +0000 (11:16 -0600)]
mfd: Introduce remove_script function for twl4030

New function twl4030_remove_script(u8 flags) takes a script type as
defined in twl.h and prevents any script already loaded in that position
from running.  This is accomplished by programming SEQ_ADD_* to 0x3f,
the END_OF_SCRIPT value, where SEQ_ADD_* is determined by flags.

(Future) users of this function include OMAP board files for machines
facing a race condition between sleep and warm reset.

Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd/mmc: SDHI Kconfig update
Magnus Damm [Mon, 22 Feb 2010 04:40:59 +0000 (13:40 +0900)]
mfd/mmc: SDHI Kconfig update

Enable the sh_mobile_sdhi mfd driver on SH-Mobile ARM
processors. While at it, make CONFIG_TMIO_MMC depend on
CONFIG_MFD_SH_MOBILE_SDHI.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: sh_mobile_sdhi MMC_CAP_MMC_HIGHSPEED support
Magnus Damm [Mon, 22 Feb 2010 04:37:09 +0000 (13:37 +0900)]
mfd: sh_mobile_sdhi MMC_CAP_MMC_HIGHSPEED support

Add MMC_CAP_MMC_HIGHSPEED support to the sh_mobile_sdhi
driver. Also, remove type cast and FIXME comment.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agogpiolib: Force wm831x GPIOs into GPIO mode when requested
Mark Brown [Wed, 17 Feb 2010 18:45:26 +0000 (18:45 +0000)]
gpiolib: Force wm831x GPIOs into GPIO mode when requested

This is the chip default but it's possible the bootloader or OTP
will have been configured to a different mode (eg, to provide
feedback during startup).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add WM831x revision B support
Mark Brown [Wed, 17 Feb 2010 18:45:25 +0000 (18:45 +0000)]
mfd: Add WM831x revision B support

Revision B of the WM831x devices changes the sense of the tristate
bit for GPIO configuration, inverting it to become an enable instead.
Take account of this in the gpiolib driver.

A current sink regulation status bit has also been added in revision B,
add a flag indicating if it's present but don't use it yet.

This revision also adds an interrupt on key up for the ON pin event
which the existing code is able to take advantage of.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agogpiolib: Correct debugfs display of WM831x GPIO inversion
Mark Brown [Wed, 17 Feb 2010 18:45:24 +0000 (18:45 +0000)]
gpiolib: Correct debugfs display of WM831x GPIO inversion

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agogpiolib: Actually set output state in wm831x_gpio_direction_output()
Mark Brown [Wed, 17 Feb 2010 18:04:35 +0000 (18:04 +0000)]
gpiolib: Actually set output state in wm831x_gpio_direction_output()

wm831x_gpio_direction_output() ignored the state passed into it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agotmio_mmc: Balance cell enable()/disable() calls
Magnus Damm [Wed, 17 Feb 2010 07:38:23 +0000 (16:38 +0900)]
tmio_mmc: Balance cell enable()/disable() calls

This patch adds cell->disable() calls to the tmio-mmc
probe() error handling and the remove() function.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agotmio_mmc: Remove const from platform data V3
Magnus Damm [Wed, 17 Feb 2010 07:38:14 +0000 (16:38 +0900)]
tmio_mmc: Remove const from platform data V3

Remove const from the tmio-mmc platform data hclk V3.
This change makes it possible to remove the type cast
from the sh_mobile_sdhi driver which is using the clock
framework to get the clock rate.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agotmio_mmc: Use 100ms mmc_detect_change() delay
Magnus Damm [Wed, 17 Feb 2010 07:38:04 +0000 (16:38 +0900)]
tmio_mmc: Use 100ms mmc_detect_change() delay

This patch changes the tmio_mmc driver to wait 100ms
before checking the card detect status. This type of
delay is quite common among mmc drivers, it seems that
most hardware platforms need to give the hardware some
time to settle before checking card availabilty.

Hotplug is half-broken without this patch on the sh7724
Ecovec board. Hot insertion seems ok but eject is never
detected without this patch.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agotmio_mmc: Add MMC_CAP_MMC_HIGHSPEED support V2
Yusuke Goda [Wed, 17 Feb 2010 07:37:55 +0000 (16:37 +0900)]
tmio_mmc: Add MMC_CAP_MMC_HIGHSPEED support V2

Enable MMC_CAP_XX support in the tmio_mmc driver if
pdata->capabilities is set.

Signed-off-by: Yusuke Goda <goda.yusuke@renesas.com>
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agotmio_mmc: Keep card-detect interrupts enabled
Guennadi Liakhovetski [Wed, 17 Feb 2010 07:37:45 +0000 (16:37 +0900)]
tmio_mmc: Keep card-detect interrupts enabled

On SuperH platforms the SDHI controller does not produce any command IRQs after
a completed IO. This leads to card-detect interrupts staying disabled. Do not
disable card-detect interrupts on DATA IRQs.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add twl6030 base addr for ID0, ID1, ID2
Balaji T K [Fri, 19 Feb 2010 11:39:38 +0000 (12:39 +0100)]
mfd: Add twl6030 base addr for ID0, ID1, ID2

Add base address for generic slave ID0, ID1, ID2
and introduced one more entry to align RTC module number between
twl4030 and twl6030

Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Disable TWL4030/5030 I2C1/I2C4 internal pull-ups
Moiz Sonasath [Wed, 17 Feb 2010 00:57:21 +0000 (18:57 -0600)]
mfd: Disable TWL4030/5030 I2C1/I2C4 internal pull-ups

This patch disables TWL4030/5030 I2C1 adn I2C4(SR) internal pull-up, to
use only the external HW resistor >=470 Ohm for the assured
functionality in HS mode.

While testing the I2C in High Speed mode, it was discovered that
without a proper pull-up resistor, there is data corruption during
multi-byte transfer. RTC(time_set) test case was used for testing.

From the analysis done, it was concluded that ideally we need a
pull-up of 1.6k Ohm(recomended) or atleast 470 Ohm or greater for
assured performance in HS mode.

Signed-off-by: Moiz Sonasath <m-sonasath@ti.com>
Signed-off-by: Allen Pais <allen.pais@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Introduce lpc_sch for Intel SCH LPC bridge
Denis Turischev [Fri, 19 Feb 2010 10:26:25 +0000 (11:26 +0100)]
mfd: Introduce lpc_sch for Intel SCH LPC bridge

Intel Poulsbo (SCH) chipset LPC bridge controller contains several
functions. Creating and MFD driver for the LPC bridge controller allows
simultaneous use of SMBus and GPIO interfaces on the SCH.

Signed-off-by: Denis Turischev <denis@compulab.co.il>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Check for ACPI conflicts
Samuel Ortiz [Fri, 19 Feb 2010 10:07:59 +0000 (11:07 +0100)]
mfd: Check for ACPI conflicts

For ACPI based systems, we should check for ACPI conflicts when adding the
platform devices. The test will always succeed for non ACPI platforms.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Fix twl_has_pwrbutton typo
Eduardo Valentin [Thu, 11 Feb 2010 12:47:09 +0000 (13:47 +0100)]
mfd: Fix twl_has_pwrbutton typo

Change the typo CONFIG_INPUT_TWL4030_PWBUTTON_MODULE in the
twl_has_pwrbutton definition to CONFIG_INPUT_TWL4030_PWRBUTTON_MODULE.

Signed-off-by: Eduardo Valentin <eduardo.valentin@nokia.com>
Signed-off-by: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agoinput: Support onkey in 88pm860x
Haojian Zhuang [Wed, 3 Feb 2010 20:40:59 +0000 (15:40 -0500)]
input: Support onkey in 88pm860x

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Use genirq in 88pm860x
Haojian Zhuang [Mon, 8 Feb 2010 10:02:00 +0000 (05:02 -0500)]
mfd: Use genirq in 88pm860x

Use genirq to simplify IRQ handling in 88pm860x. Remove the interface of
mask/free IRQs on 88pm860x. All these work is taken by genirq. Update the
touchscreen driver of 88pm860x since IRQ handling is changed.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Fix WM8994 error handling
Joonyoung Shim [Sun, 7 Feb 2010 01:16:14 +0000 (10:16 +0900)]
mfd: Fix WM8994 error handling

This patch fixes wrong goto statement for error handling on probe.

Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Use i2c_dummy in 88pm860x
Haojian Zhuang [Wed, 3 Feb 2010 20:38:12 +0000 (15:38 -0500)]
mfd: Use i2c_dummy in 88pm860x

Use i2c_dummy in 88pm860x driver to avoid using static in probe function.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Clean code in max8925
Haojian Zhuang [Wed, 3 Feb 2010 20:37:23 +0000 (15:37 -0500)]
mfd: Clean code in max8925

Remove unused definitions.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agopower_supply: Enable power supply of max8925
Haojian Zhuang [Mon, 25 Jan 2010 15:38:35 +0000 (10:38 -0500)]
power_supply: Enable power supply of max8925

MAX8925 is a PMIC that contains charger component

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agortc: Enable rtc in max8925
Haojian Zhuang [Mon, 25 Jan 2010 11:30:29 +0000 (06:30 -0500)]
rtc: Enable rtc in max8925

MAX8925 is a PMIC that contains RTC component.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Update irq handler in max8925
Haojian Zhuang [Fri, 5 Feb 2010 15:07:54 +0000 (16:07 +0100)]
mfd: Update irq handler in max8925

Update thread irq handler. Simply the interface of using thread irq.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Update i2c driver for max8925
Haojian Zhuang [Mon, 25 Jan 2010 11:26:34 +0000 (06:26 -0500)]
mfd: Update i2c driver for max8925

Update I2C driver in order to fit all of three I2C components in max8925.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Program twl4030 remap_sleep correctly
Mike Turquette [Fri, 5 Feb 2010 08:51:37 +0000 (09:51 +0100)]
mfd: Program twl4030 remap_sleep correctly

Variable remap was incorrectly referencing remap_off for the remap_sleep
case when configuring TWL4030 power scripts.

Signed-off-by: Mike Turquette <mturquette@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agogpiolib: Add WM8994 GPIO support
Mark Brown [Fri, 29 Jan 2010 18:20:30 +0000 (18:20 +0000)]
gpiolib: Add WM8994 GPIO support

The WM8994 has 11 GPIO lines.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add initial WM8994 support
Mark Brown [Fri, 29 Jan 2010 18:20:29 +0000 (18:20 +0000)]
mfd: Add initial WM8994 support

The WM8994 is a highly integrated ultra low power audio hub CODEC.
Since it includes on-board regulators and GPIOs it is represented
as a multi-function device, though the overwhelming majority of
the functionality is provided by the ASoC CODEC driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add WM8994 register definitions
Mark Brown [Fri, 29 Jan 2010 18:20:28 +0000 (18:20 +0000)]
mfd: Add WM8994 register definitions

As a separate patch due to the large size.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: htc-i2cpld depends on GPIOLIB
Randy Dunlap [Thu, 21 Jan 2010 03:55:34 +0000 (19:55 -0800)]
mfd: htc-i2cpld depends on GPIOLIB

htc-i2cpld should depend on GPIOLIB, otherwise there are many
build errors:

drivers/mfd/htc-i2cpld.c:50: error: field 'chip_out' has incomplete type
drivers/mfd/htc-i2cpld.c:54: error: field 'chip_in' has incomplete type
drivers/mfd/htc-i2cpld.c:243: warning: type defaults to 'int' in declaration of '__mptr'
drivers/mfd/htc-i2cpld.c:243: warning: initialization from incompatible pointer type
drivers/mfd/htc-i2cpld.c:278: warning: type defaults to 'int' in declaration of '__mptr'
drivers/mfd/htc-i2cpld.c:278: warning: initialization from incompatible pointer type
drivers/mfd/htc-i2cpld.c:282: warning: type defaults to 'int' in declaration of '__mptr'
drivers/mfd/htc-i2cpld.c:282: warning: initialization from incompatible pointer type
drivers/mfd/htc-i2cpld.c:315: error: dereferencing pointer to incomplete type
drivers/mfd/htc-i2cpld.c:322: warning: type defaults to 'int' in declaration of '__mptr'
drivers/mfd/htc-i2cpld.c:322: warning: initialization from incompatible pointer type
drivers/mfd/htc-i2cpld.c:467+: error: dereferencing pointer to incomplete type [19X]
drivers/mfd/htc-i2cpld.c:490: error: implicit declaration of function 'gpiochip_add'
drivers/mfd/htc-i2cpld.c:504: error: implicit declaration of function 'gpiochip_remove'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Remove leftover from discontinued TWL4030 battery patch
Christoph Egger [Fri, 15 Jan 2010 14:33:46 +0000 (15:33 +0100)]
mfd: Remove leftover from discontinued TWL4030 battery patch

The TWL4030_BCI_BATTERY config option originates from a patch to the
omap git tree. However inclusion in linux was seemingly rejected and
the functionality nears inclusion under a different name so this
removes the bits of the old version that made it into the mainline
kernel again.

Signed-off-by: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Fix debugfs code in AB3100 OTP driver
Linus Walleij [Sun, 17 Jan 2010 19:57:43 +0000 (20:57 +0100)]
mfd: Fix debugfs code in AB3100 OTP driver

This fixes the aged and unreachable debugfs code in the AB3100
OTP driver so that it's (A) reachable and (B) works. Bug detected
in parallell by Christoph Egger using VAMOS and Robert P. J. Day
by his kernel scanning script.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Cc: Christoph Egger <siccegge@stud.informatik.uni-erlangen.de>
Cc: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Use AB3100 MFD core IRQ for interrupt randomness
Linus Walleij [Tue, 19 Jan 2010 10:41:52 +0000 (11:41 +0100)]
mfd: Use AB3100 MFD core IRQ for interrupt randomness

This reintroduces the entropy sampling of the AB3100 IRQ as the
IRQF_SAMPLE_RANDOM is going out according to the feature removal
schedule. I'm trying to do this the right way then, so CC:ing some
random people for a quick review. We add entropy for interrupt
events in the AB3100 which are truly random in nature, like
external cables being connected, voltages on batteries dropping
below certain ranges, ADC triggers or overheating.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Cc: Robin Getz <rgetz@blackfin.uclinux.org>
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add HTCPLD driver
Cory Maccarrone [Tue, 19 Jan 2010 10:22:45 +0000 (11:22 +0100)]
mfd: Add HTCPLD driver

This change introduces a driver for the HTC PLD chip found
on some smartphones, such as the HTC Wizard and HTC Herald.
It works through the I2C bus and acts as a GPIO extender.
Specifically:

 * it can have several sub-devices, each with its own I2C
   address
 * Each sub-device provides 8 output and 8 input pins
 * The chip attaches to one GPIO to signal when any of the
   input GPIOs change -- at which point all chips must be
   scanned for changes

This driver implements the GPIOs throught the kernel's
GPIO and IRQ framework.  This allows any GPIO-servicing
drivers to operate on htcpld pins, such as the gpio-keys
and gpio-leds drivers.

Signed-off-by: Cory Maccarrone <darkstar6262@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agoregulator: Add max8925 support
Haojian Zhuang [Mon, 11 Jan 2010 12:10:08 +0000 (13:10 +0100)]
regulator: Add max8925 support

MAX8925 contains 3 Buck and 20 LDO regulator.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agobacklight: Enable max8925 backlight
Haojian Zhuang [Fri, 18 Dec 2009 15:01:45 +0000 (10:01 -0500)]
backlight: Enable max8925 backlight

Enable max8925 backlight sub device.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add subdevs in max8925
Haojian Zhuang [Fri, 8 Jan 2010 17:43:29 +0000 (12:43 -0500)]
mfd: Add subdevs in max8925

Add subdevs in MAX8925. MAX8925 includes regulator, backlight and touch
components.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Initial max8925 support
Haojian Zhuang [Fri, 8 Jan 2010 11:29:23 +0000 (12:29 +0100)]
mfd: Initial max8925 support

Basic Max8925 support, which is a power management IC from Maxim
Semiconductor.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agoregulator: Unsupport 88pm8607 A0 and A1
Haojian Zhuang [Thu, 10 Dec 2009 11:06:17 +0000 (06:06 -0500)]
regulator: Unsupport 88pm8607 A0 and A1

Remove the support 88PM8607 A0/A1 stepping. There's some register
definition changes in B0 stepping. It can make software more efficient.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agoinput: Enable touch on 88pm860x
Haojian Zhuang [Tue, 15 Dec 2009 21:06:17 +0000 (16:06 -0500)]
input: Enable touch on 88pm860x

Enable touchscreen driver for the 88pm860x multi function core.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agoled: Enable led in 88pm860x
Haojian Zhuang [Wed, 6 Jan 2010 22:10:09 +0000 (17:10 -0500)]
led: Enable led in 88pm860x

Enable led sub device in Marvell 88PM860x. Two LED arrays can be supported.
Each LED array can be used for R,G,B leds.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agobacklight: Enable backlight in 88pm860x
Haojian Zhuang [Mon, 9 Nov 2009 17:41:07 +0000 (12:41 -0500)]
backlight: Enable backlight in 88pm860x

At most, three backlight device can be supported in 88pm860x driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Append subdev into 88pm860x driver
Haojian Zhuang [Tue, 15 Dec 2009 21:04:36 +0000 (16:04 -0500)]
mfd: Append subdev into 88pm860x driver

Append backlight, led & touch subdevs into 88pm860x driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add irq support in 88pm860x
Haojian Zhuang [Tue, 15 Dec 2009 21:01:47 +0000 (16:01 -0500)]
mfd: Add irq support in 88pm860x

88PM860x is a complex PMIC device. It contains touch, charger, sound, rtc,
backlight, led, and so on.

Host communicates to 88PM860x by I2C bus. Use thread irq to support this
usage case.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Rename 88pm8607 to 88pm860x in mfd
Haojian Zhuang [Wed, 6 Jan 2010 22:07:13 +0000 (17:07 -0500)]
mfd: Rename 88pm8607 to 88pm860x in mfd

Rename 88PM8607 to 88PM860X in both Makefile and Kconfig under mfd directory.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Support 88pm8606 in 860x driver
Haojian Zhuang [Fri, 8 Jan 2010 11:01:24 +0000 (06:01 -0500)]
mfd: Support 88pm8606 in 860x driver

88PM8606 and 88PM8607 are two discrete chips used for power management.
Hardware designer can use them together or only one of them according to
requirement.

There's some logic tightly linked between these two chips. For example, USB
charger driver needs to access both chips by I2C interface.

Now share one driver to these two devices. Only one I2C client is identified
in platform init data. If another chip is also used, user should mark it in
companion_addr field of platform init data. Then driver could create another
I2C client for the companion chip.

All I2C operations are accessed by 860x-i2c driver. In order to support both
I2C client address, the read/write API is changed in below.

reg_read(client, offset)
reg_write(client, offset, data)

The benefit is that client drivers only need one kind of read/write API. I2C
and MFD driver can be shared in both 8606 and 8607.

Since API is changed, update API in 8607 regulator driver.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Split 88pm8607 driver
Haojian Zhuang [Wed, 6 Jan 2010 22:04:18 +0000 (17:04 -0500)]
mfd: Split 88pm8607 driver

Create 88pm8607-i2c driver to support all I2C operation of 88PM8607.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Convert AB3100 driver to threaded IRQ
Linus Walleij [Fri, 8 Jan 2010 09:44:16 +0000 (10:44 +0100)]
mfd: Convert AB3100 driver to threaded IRQ

This converts the AB3100 core MFD driver to use a threaded
interrupt handler instead of the explicit top/bottom-half
construction with a workqueue. This saves some code and make it
more similar to other modern MFD drivers.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agogpiolib: Add support for WM8350 GPIO controller
Mark Brown [Thu, 7 Jan 2010 16:10:08 +0000 (16:10 +0000)]
gpiolib: Add support for WM8350 GPIO controller

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Update WM8350 drivers for changed interrupt numbers
Mark Brown [Wed, 6 Jan 2010 19:24:25 +0000 (19:24 +0000)]
mfd: Update WM8350 drivers for changed interrupt numbers

The headphone detect and charger are using the IRQ numbers so need
to take account of irq_base with the genirq conversion. I obviously
picked the wrong system for initial testing.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Don't allow WM8350 to be built modular
Mark Brown [Tue, 5 Jan 2010 20:40:47 +0000 (20:40 +0000)]
mfd: Don't allow WM8350 to be built modular

The genirq implementation does not allow modules to implement irq_chips
so the conversion of WM8350 to genirq means we can no longer allow the
driver to be built as a module.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Convert WM8350 to genirq
Mark Brown [Tue, 5 Jan 2010 13:59:09 +0000 (13:59 +0000)]
mfd: Convert WM8350 to genirq

This gives us use of the diagnostic facilities genirq provides and
will allow implementation of interrupt support for the WM8350 GPIOs.
Stub functions are provided to ease the transition of the individual
drivers, probably after additional work to pass the IRQ numbers via
the struct devices.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agortc: Suppress duplicate enable/disable of WM8350 update interrupt
Mark Brown [Tue, 5 Jan 2010 13:59:08 +0000 (13:59 +0000)]
rtc: Suppress duplicate enable/disable of WM8350 update interrupt

Unlike the wm8350-custom code genirq nests enable and disable calls
so we can't just unconditionally mask or unmask the interrupt,
we need to remember the state we set and only mask or unmask when
there is a real change.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: rtc-linux@googlegroups.com
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add a data argument to the WM8350 IRQ free function
Mark Brown [Tue, 5 Jan 2010 13:59:07 +0000 (13:59 +0000)]
mfd: Add a data argument to the WM8350 IRQ free function

To better match genirq.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Correct use after free for t7l66xb
Julia Lawall [Tue, 22 Dec 2009 20:31:43 +0000 (21:31 +0100)]
mfd: Correct use after free for t7l66xb

The structure t7l66xb should not be freed before the subsequent references
to its fields in the arguments to clk_put.  Furthermore, this structure is
allocated near the beginning of the function, and a goto to the label
err_noirq appears after a successful allocation, so it would seem that the
kfree should be moved down below this label.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,e;
identifier f;
iterator I;
statement S;
@@

*kfree(x);
... when != &x
    when != x = e
    when != I(x,...) S
*x->f
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
14 years agomfd: Use resouce_size for tc6393xb
H Hartley Sweeten [Tue, 5 Jan 2010 19:01:16 +0000 (20:01 +0100)]
mfd: Use resouce_size for tc6393xb

Use resource_size() for ioremap.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Molton <ian@mnementh.co.uk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Use resource_size() for t7l66xb
H Hartley Sweeten [Tue, 5 Jan 2010 18:58:34 +0000 (19:58 +0100)]
mfd: Use resource_size() for t7l66xb

Use resource_size() for ioremap.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Molton <ian@mnementh.co.uk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Use resource_size() in sm501
H Hartley Sweeten [Tue, 5 Jan 2010 18:55:54 +0000 (19:55 +0100)]
mfd: Use resource_size() in sm501

The requested memory region is smaller than the actual ioremap().
Use resource_size() to get the correct size.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq
Linus Torvalds [Sun, 7 Mar 2010 20:52:38 +0000 (12:52 -0800)]
Merge branch 'next' of git://git./linux/kernel/git/davej/cpufreq

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq:
  [CPUFREQ] Fix cast warning in pcc driver.
  [CPUFREQ] Processor Clocking Control interface driver

14 years agoUSB: remove unused defintion of struct usb_device_status
Dmitry Torokhov [Sun, 7 Mar 2010 20:37:17 +0000 (12:37 -0800)]
USB: remove unused defintion of struct usb_device_status

The recent rework of /proc/bus/usb/devices polling support made
this structure unused so let's remove it.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoRevert "lib: build list_sort() only if needed"
Linus Torvalds [Sun, 7 Mar 2010 17:54:44 +0000 (09:54 -0800)]
Revert "lib: build list_sort() only if needed"

This reverts commit a069c266ae5fdfbf5b4aecf2c672413aa33b2504.

It turns ou that not only was it missing a case (XFS) that needed it,
but perhaps more importantly, people sometimes want to enable new
modules that they hadn't had enabled before, and if such a module uses
list_sort(), it can't easily be inserted any more.

So rather than add a "select LIST_SORT" to the XFS case, just leave it
compiled in.  It's not all _that_ big, after all, and the inconvenience
isn't worth it.

Requested-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Don Mullis <don.mullis@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Chinner <david@fromorbit.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years ago[WATCHDOG] drivers/watchdog/wdt.c:wdt_ioctl(): make `ident' non-static
Andrew Morton [Wed, 3 Mar 2010 19:57:40 +0000 (11:57 -0800)]
[WATCHDOG] drivers/watchdog/wdt.c:wdt_ioctl(): make `ident' non-static

Making this instance static exposes the code to SMP races, etc.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
14 years ago[WATCHDOG] change reboot_notifier to platform-shutdown method.
Wim Van Sebroeck [Sat, 26 Dec 2009 19:13:00 +0000 (19:13 +0000)]
[WATCHDOG] change reboot_notifier to platform-shutdown method.

Platform device drivers can use the .shutdown method to handle soft
shutdown's instead of reboot_notifier's.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
14 years ago[WATCHDOG] watchdog_info constify
Wim Van Sebroeck [Sat, 26 Dec 2009 18:55:22 +0000 (18:55 +0000)]
[WATCHDOG] watchdog_info constify

make the watchdog_info struct const where possible.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
14 years agoALSA: hda - Add ASRock mobo to MSI blacklist
Michele Ballabio [Sat, 6 Mar 2010 20:06:46 +0000 (21:06 +0100)]
ALSA: hda - Add ASRock mobo to MSI blacklist

This avoids a lockup at boot.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoMerge branch 'fix/hda' into topic/hda
Takashi Iwai [Sun, 7 Mar 2010 08:29:29 +0000 (09:29 +0100)]
Merge branch 'fix/hda' into topic/hda

14 years agovsprintf: move %pR resource printf_specs off the stack
Bjorn Helgaas [Fri, 5 Mar 2010 17:47:37 +0000 (10:47 -0700)]
vsprintf: move %pR resource printf_specs off the stack

This adds separate I/O and memory specs, so we don't have to change the
field width in a shared spec, which then lets us make all the specs const
and static, since they never change.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agovsprintf: clarify comments for printf_spec flags
Bjorn Helgaas [Fri, 5 Mar 2010 17:47:31 +0000 (10:47 -0700)]
vsprintf: clarify comments for printf_spec flags

Add clues about what the SMALL and SPECIAL flags do.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agovsprintf.c: Reduce sizeof struct printf_spec from 24 to 8 bytes
Joe Perches [Sun, 7 Mar 2010 01:10:14 +0000 (17:10 -0800)]
vsprintf.c: Reduce sizeof struct printf_spec from 24 to 8 bytes

Reducing the size of struct printf_spec is a good thing because multiple
instances are commonly passed on stack.

It's possible for type to be u8 and field_width to be s8, but this is
likely small enough for now.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agousbfs: fix deadlock on 'usbfs_mutex', clean up poll
Linus Torvalds [Sun, 7 Mar 2010 00:34:34 +0000 (16:34 -0800)]
usbfs: fix deadlock on 'usbfs_mutex', clean up poll

The caller of usbfs_conn_disc_event() in some cases (but not always)
already holds usbfs_mutex, so trying to protect the event counter with
that lock causes nasty deadlocks.

The problem was introduced by commit 554f76962d ("USB: Remove BKL from
poll()") when the BLK protection was turned into using the mutex instead.

So fix this by using an atomic variable instead.  And while we're at it,
get rid of the atrocious naming of said variable and the waitqueue it is
associated with.

This also cleans up the unnecessary locking in the poll routine, since
the whole point of how the pollwait table works is that you can just add
yourself to the waiting list, and then check the condition you're
waiting for afterwards - avoiding all races.

It also gets rid of the unnecessary dynamic allocation of the device
status that just contained a single word.  We should use f_version for
this, as Dmitry Torokhov points out.  That simplifies everything
further.

Reported-and-tested-by: Jeff Chua <jeff.chua.linux@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoparisc: use __ratelimit in unaligned.c
Akinobu Mita [Sun, 28 Feb 2010 10:58:15 +0000 (10:58 +0000)]
parisc: use __ratelimit in unaligned.c

Replace open-coded rate limiting logic with __ratelimit().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: Convert to read/update_persistent_clock
john stultz [Wed, 23 Dec 2009 04:14:03 +0000 (04:14 +0000)]
parisc: Convert to read/update_persistent_clock

This patch converts the parisc architecture to use the generic
read_persistent_clock and update_persistent_clock interfaces, reducing
the amount of arch specific code we have to maintain, and allowing for
further cleanups in the future.

I have not built or tested this patch, so help from arch maintainers
would be appreciated.

Signed-off-by: John Stultz <johnstul@us.ibm.com>
Acked-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: Simplify param.h by including <asm-generic/param.h>
Robert P. J. Day [Thu, 31 Dec 2009 20:43:55 +0000 (20:43 +0000)]
parisc: Simplify param.h by including <asm-generic/param.h>

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: drop unnecessary cast in __ldcw_align() macro
Helge Deller [Tue, 2 Feb 2010 19:06:23 +0000 (19:06 +0000)]
parisc: drop unnecessary cast in __ldcw_align() macro

__ldcw_align() can directly access the slock member of struct arch_spinlock_t
instead of using an ugly cast.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: add strict copy size checks (v2)
Helge Deller [Mon, 1 Feb 2010 19:56:33 +0000 (19:56 +0000)]
parisc: add strict copy size checks (v2)

Add CONFIG_DEBUG_STRICT_USER_COPY_CHECKS, copied from the x86
implementation. Tested with 32 and 64bit kernel.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: remove trailing space in messages
Frans Pop [Sat, 6 Feb 2010 17:47:14 +0000 (17:47 +0000)]
parisc: remove trailing space in messages

Signed-off-by: Frans Pop <elendil@planet.nl>
Cc: linux-parisc@vger.kernel.org
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: ditto sys_accept4
Kyle McMartin [Sat, 26 Dec 2009 17:19:17 +0000 (17:19 +0000)]
parisc: ditto sys_accept4

tested with test_accept4.c from de11defebf00007677fb7ee91d9b089b78786fbb

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoparisc: wire up sys_recvmmsg
Helge Deller [Tue, 22 Dec 2009 22:50:33 +0000 (22:50 +0000)]
parisc: wire up sys_recvmmsg

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/joern/logfs
Linus Torvalds [Sat, 6 Mar 2010 21:18:03 +0000 (13:18 -0800)]
Merge git://git./linux/kernel/git/joern/logfs

* git://git.kernel.org/pub/scm/linux/kernel/git/joern/logfs:
  [LogFS] Change magic number
  [LogFS] Remove h_version field
  [LogFS] Check feature flags
  [LogFS] Only write journal if dirty
  [LogFS] Fix bdev erases
  [LogFS] Silence gcc
  [LogFS] Prevent 64bit divisions in hash_index
  [LogFS] Plug memory leak on error paths
  [LogFS] Add MAINTAINERS entry
  [LogFS] add new flash file system

Fixed up trivial conflict in lib/Kconfig, and a semantic conflict in
fs/logfs/inode.c introduced by write_inode() being changed to use
writeback_control' by commit a9185b41a4f84971b930c519f0c63bd450c4810d
("pass writeback_control to ->write_inode")

14 years agoPM: Provide generic subsystem-level callbacks
Rafael J. Wysocki [Sat, 6 Mar 2010 20:28:37 +0000 (21:28 +0100)]
PM: Provide generic subsystem-level callbacks

There are subsystems whose power management callbacks only need to
invoke the callbacks provided by device drivers.  Still, their system
sleep PM callbacks should play well with the runtime PM callbacks,
so that devices suspended at run time can be left in that state for
a system sleep transition.

Provide a set of generic PM callbacks for such subsystems and
define convenience macros for populating dev_pm_ops structures.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
14 years agoPM / Runtime: Document power.runtime_auto and related functions
Rafael J. Wysocki [Sat, 6 Mar 2010 20:28:17 +0000 (21:28 +0100)]
PM / Runtime: Document power.runtime_auto and related functions

The power.runtime_auto device flag and the helper functions
pm_runtime_allow() and pm_runtime_forbid() used to modify it are a
part of the run-time power management framework and therefore they
should be described in Documentation/power/runtime_pm.txt.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm
Linus Torvalds [Sat, 6 Mar 2010 19:34:04 +0000 (11:34 -0800)]
Merge git://git./linux/kernel/git/agk/linux-2.6-dm

* git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm:
  dm raid1: fix deadlock when suspending failed device
  dm: eliminate some holes data structures
  dm ioctl: introduce flag indicating uevent was generated
  dm: free dm_io before bio_endio not after
  dm table: remove unused dm_get_device range parameters
  dm ioctl: only issue uevent on resume if state changed
  dm raid1: always return error if all legs fail
  dm mpath: refactor pg_init
  dm mpath: wait for pg_init completion when suspending
  dm mpath: hold io until all pg_inits completed
  dm mpath: avoid storing private suspended state
  dm: document when snapshot has finished merging
  dm table: remove dm_get from dm_table_get_md
  dm mpath: skip activate_path for failed paths
  dm mpath: pass struct pgpath to pg init done