safe/jmp/linux-2.6
14 years agomd: support barrier requests on all personalities.
NeilBrown [Mon, 14 Dec 2009 01:49:49 +0000 (12:49 +1100)]
md: support barrier requests on all personalities.

Previously barriers were only supported on RAID1.  This is because
other levels requires synchronisation across all devices and so needed
a different approach.
Here is that approach.

When a barrier arrives, we send a zero-length barrier to every active
device.  When that completes - and if the original request was not
empty -  we submit the barrier request itself (with the barrier flag
cleared) and then submit a fresh load of zero length barriers.

The barrier request itself is asynchronous, but any subsequent
request will block until the barrier completes.

The reason for clearing the barrier flag is that a barrier request is
allowed to fail.  If we pass a non-empty barrier through a striping
raid level it is conceivable that part of it could succeed and part
could fail.  That would be way too hard to deal with.
So if the first run of zero length barriers succeed, we assume all is
sufficiently well that we send the request and ignore errors in the
second run of barriers.

RAID5 needs extra care as write requests may not have been submitted
to the underlying devices yet.  So we flush the stripe cache before
proceeding with the barrier.

Note that the second set of zero-length barriers are submitted
immediately after the original request is submitted.  Thus when
a personality finds mddev->barrier to be set during make_request,
it should not return from make_request until the corresponding
per-device request(s) have been queued.

That will be done in later patches.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Andre Noll <maan@systemlinux.org>
14 years agomd: don't reset curr_resync_completed after an interrupted resync
NeilBrown [Mon, 14 Dec 2009 01:49:49 +0000 (12:49 +1100)]
md: don't reset curr_resync_completed after an interrupted resync

If a resync/recovery/check/repair is interrupted for some reason, it
can be useful to know exactly where it got up to.
So in that case, do not clear curr_resync_completed.
Initialise it when starting a resync/recovery/... instead.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: adjust resync_min usefully when resync aborts.
NeilBrown [Mon, 14 Dec 2009 01:49:48 +0000 (12:49 +1100)]
md: adjust resync_min usefully when resync aborts.

When a 'check' or 'repair' finished we should clear resync_min
so that a future check/repair will cover the whole array (by default).
However if it is interrupted, we should update resync_min to
where we got up to, so that when the check/repair continues it
just does the remainder of the array.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: remove sparse warning:symbol XXX was not declared.
NeilBrown [Mon, 14 Dec 2009 01:49:47 +0000 (12:49 +1100)]
md: remove sparse warning:symbol XXX was not declared.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd/raid5: remove some sparse warnings.
NeilBrown [Mon, 14 Dec 2009 01:49:47 +0000 (12:49 +1100)]
md/raid5: remove some sparse warnings.

qd_idx is previously declared and given exactly the same value!

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd/bitmap: protect against bitmap removal while being updated.
NeilBrown [Mon, 14 Dec 2009 01:49:46 +0000 (12:49 +1100)]
md/bitmap: protect against bitmap removal while being updated.

A write intent bitmap can be removed from an array while the
array is active.
When this happens, all IO is suspended and flushed before the
bitmap is removed.
However it is possible that bitmap_daemon_work is still running to
clear old bits from the bitmap.  If it is, it can dereference the
bitmap after it has been freed.

So introduce a new mutex to protect bitmap_daemon_work and get it
before destroying a bitmap.

This is suitable for any current -stable kernel.

Signed-off-by: NeilBrown <neilb@suse.de>
Cc: stable@kernel.org
14 years agomfd: Add twl6030 regulator subdevices
Rajendra Nayak [Sun, 13 Dec 2009 21:29:47 +0000 (22:29 +0100)]
mfd: Add twl6030 regulator subdevices

This patch adds initial support for creating twl6030 PMIC
specific voltage regulators in the twl mfd driver.

Board specific regulator configurations will have to be passed from
respective board files.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agoregulator: Add support for twl6030 regulators
Rajendra Nayak [Sun, 13 Dec 2009 21:19:23 +0000 (22:19 +0100)]
regulator: Add support for twl6030 regulators

This patch updates the regulator driver to add support
for TWL6030 PMIC specific LDO regulators.
SMPS resources are not yet supported for TWL6030 and
also .set_mode and .get_status for LDO's are yet to
be implemented for TWL6030.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agortc: Add twl6030 RTC support
Balaji T K [Sun, 13 Dec 2009 21:16:31 +0000 (22:16 +0100)]
rtc: Add twl6030 RTC support

This patch adds support for RTC in phoenix TWL6030.
Register offset addresses have changed in TWL6030
rtc-twl.c will hence forth support all twl RTC (4030, 5030, 6030 ..)

Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add support for twl6030 irq framework
Balaji T K [Sun, 13 Dec 2009 23:25:31 +0000 (00:25 +0100)]
mfd: Add support for twl6030 irq framework

This patch adds support for phoenix interrupt framework. New iInterrupt
status register A, B, C are introduced in Phoenix and are cleared on write.
Due to the differences in interrupt handling with respect to TWL4030,
twl6030-irq.c is created for TWL6030 PMIC

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Rename twl4030_ routines in twl-regulator.c
Rajendra Nayak [Sun, 13 Dec 2009 20:36:49 +0000 (21:36 +0100)]
mfd: Rename twl4030_ routines in twl-regulator.c

This patch renames all twl4030_ functions to twl so that regulator driver
can be reused by Triton - TWL4030 and Phoenix - TWL6030.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Rename twl4030_ routines in rtc-twl.c
Balaji T K [Sun, 13 Dec 2009 20:30:48 +0000 (21:30 +0100)]
mfd: Rename twl4030_ routines in rtc-twl.c

This patch renames all twl4030_ functions to twl_ so that RTC driver can be
shared between Triton and Phoenix.

Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Nayak Rajendra <rnayak@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Rename all twl4030_i2c*
Balaji T K [Sun, 13 Dec 2009 20:23:33 +0000 (21:23 +0100)]
mfd: Rename all twl4030_i2c*

This patch renames function names like twl4030_i2c_write_u8,
twl4030_i2c_read_u8 to twl_i2c_write_u8, twl_i2c_read_u8
and also common variable in twl-core.c

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agoMerge branch 'master' into devel
Russell King [Sun, 13 Dec 2009 19:39:35 +0000 (19:39 +0000)]
Merge branch 'master' into devel

14 years agoARM: fix lh7a40x build
Russell King [Sat, 12 Dec 2009 16:27:25 +0000 (16:27 +0000)]
ARM: fix lh7a40x build

No idea if this platform actually uses cpufreq_get(), but it doesn't
have any cpufreq drivers.  That's not to say it doesn't use cpufreq_get()
in its drivers.  LH7a40x is unmaintained anyhow, and should probably
be killed off.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoARM: fix sa1100 build
Russell King [Sat, 12 Dec 2009 16:20:57 +0000 (16:20 +0000)]
ARM: fix sa1100 build

Fix:

arch/arm/mach-sa1100/generic.c:117: error: redefinition of 'cpufreq_get'
include/linux/cpufreq.h:299: error: previous definition of 'cpufreq_get' was here

cpufreq_get() is used on these platforms to tell drivers what the CPU
frequency is, and therefore the bus frequency - which is critical for
setting the PCMCIA and LCD timings.  Adding ifdefs to these drivers to
select cpufreq_get() or some other interface adds confusion.  Making
these drivers use some other interface for the normal paths and cpufreq
stuff for the cpufreq notifier is insane as well.

(Why x86 can't provide a version of cpufreq_get() which returns the
CPU frequency when CPUFREQ is disabled is beyond me, rather than
requiring a dummy zero-returning cpufreq_get().  Especially as they
do:

unsigned long khz = cpufreq_get(cpu);
if (!khz)
khz = tsc_khz;

In other words, if CPUFREQ is disabled, get it from tsc_khz - why
not provide a dummy cpufreq_get() which returns tsc_khz?)

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agomfd: Rename twl4030* driver files to enable re-use
Santosh Shilimkar [Sun, 13 Dec 2009 19:05:51 +0000 (20:05 +0100)]
mfd: Rename twl4030* driver files to enable re-use

The upcoming TWL6030 is companion chip for OMAP4 like the current TWL4030
for OMAP3. The common modules like RTC, Regulator creates opportunity
to re-use the most of the code from twl4030.

This patch renames few common drivers twl4030* files to twl* to enable
the code re-use.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agoMerge branch 'nfs-for-2.6.33'
Trond Myklebust [Sun, 13 Dec 2009 18:56:27 +0000 (13:56 -0500)]
Merge branch 'nfs-for-2.6.33'

14 years agomfd: Clarify twl4030 return value for read and write
Amit Kucheria [Fri, 11 Dec 2009 12:21:45 +0000 (13:21 +0100)]
mfd: Clarify twl4030 return value for read and write

We should be checking if all the messages were tranferred. If not, then we
should propagate the i2c core error code or EIO.
Currently we return success (0) even if none of messages were transferred
successfully.

Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add all twl4030 regulators to the twl4030 mfd driver
Juha Keski-Saari [Fri, 11 Dec 2009 10:12:15 +0000 (11:12 +0100)]
mfd: Add all twl4030 regulators to the twl4030 mfd driver

Add all twl4030 regulators to the twl4030 mfd driver and
twl4030_platform_data

Signed-off-by: Juha Keski-Saari <ext-juha.1.keski-saari@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Don't set mc13783 ADREFMODE for touch conversions
Uwe Kleine-König [Wed, 2 Dec 2009 18:54:31 +0000 (19:54 +0100)]
mfd: Don't set mc13783 ADREFMODE for touch conversions

Setting ADREFMODE is utter nonsense, but that's hard to read out of the
spec.  Strange enough it's possible to read x and y values even when
it's set.  When unset you can get values not only for the axes, but also
for contact resistance which allows the touch driver to report pressure
values.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Remove ezx-pcap defines for custom led gpio encoding
Antonio Ospite [Sun, 29 Nov 2009 12:36:10 +0000 (13:36 +0100)]
mfd: Remove ezx-pcap defines for custom led gpio encoding

We used these, in a first version of leds-pcap driver, in order to encode gpio
enabling and gpio inversion for a led inside the variable used for the gpio
number. In the new leds-pcap driver we rely on gpio_is_valid() to derive if a
led is gpio enabled and we have a dedicated flag to tell if the gpio value has
to be inverted.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Near complete mc13783 rewrite
Uwe Kleine-König [Sun, 29 Nov 2009 23:53:17 +0000 (00:53 +0100)]
mfd: Near complete mc13783 rewrite

This fixes several things while still providing the old API:

 - simplify and fix locking
 - better error handling
 - don't ack all irqs making it impossible to detect a reset of the
   rtc
 - use a timeout variant to wait for completion of ADC conversion
 - provide platform-data to regulator subdevice (This allows making
   struct mc13783 opaque for other drivers after the regulator driver is
   updated to use its platform_data.)
 - expose all interrupts
 - use threaded irq

After all users in mainline are converted to the new API, some things
(e.g. mc13783-private.h) can go away.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Remove build time warning for WM835x register default tables
Mark Brown [Tue, 24 Nov 2009 11:16:45 +0000 (11:16 +0000)]
mfd: Remove build time warning for WM835x register default tables

Systems using the WM835x need to choose which of the default register
settings are required on the system.  Currently there is a compile time
warning as well as a runtime error intended to flag up to users that
this is required but this also triggers for people building the driver
in order to obtain build coverage.

Remove the build warning, leaving only the runtime error, in order to
reduce noise for people doing generic kernel work.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Force I2C to be built in when building WM831x
Mark Brown [Tue, 24 Nov 2009 10:48:56 +0000 (10:48 +0000)]
mfd: Force I2C to be built in when building WM831x

This works around issues with allmodconfig where it won't propagate the
dependency from the WM831x core back to the I2C and MFD cores.  When
doing allmodconfig this causes WM831x to be omitted and ensures that in
normal builds the dependencies get shaken out.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Don't allow wm831x to be built as a module
Mark Brown [Mon, 23 Nov 2009 13:42:34 +0000 (13:42 +0000)]
mfd: Don't allow wm831x to be built as a module

The genirq infrastructure functions aren't currently exported,
preventing modular builds.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Fix incorrect error check for wm8350-core
Dan Carpenter [Sat, 21 Nov 2009 08:13:48 +0000 (10:13 +0200)]
mfd: Fix incorrect error check for wm8350-core

It was *pdev which was allocated not pdev.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Fix twl4030 warning
Alan Cox [Tue, 17 Nov 2009 15:48:47 +0000 (15:48 +0000)]
mfd: Fix twl4030 warning

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agogpiolib: Implement gpio_to_irq() for wm831x
Mark Brown [Mon, 16 Nov 2009 17:21:56 +0000 (17:21 +0000)]
gpiolib: Implement gpio_to_irq() for wm831x

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Remove default selection of AB4500
Linus Walleij [Thu, 12 Nov 2009 20:44:27 +0000 (21:44 +0100)]
mfd: Remove default selection of AB4500

This remove the default 'y' selection of AB4500, currently everyone
enabling the SPI subsystem will get a copy of this driver.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Move WM831x to generic IRQ
Mark Brown [Wed, 11 Nov 2009 16:10:22 +0000 (16:10 +0000)]
mfd: Move WM831x to generic IRQ

Replace the wm831x-local IRQ infrastructure with genirq, allowing access
to the diagnostic infrastructure of genirq and allowing us to implement
interrupt support for the GPIOs.  The switchover is done within the
wm831x specific IRQ API, further patches will convert the individual
drivers to use genirq directly.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Initial support for twl5031
Ilkka Koskinen [Tue, 10 Nov 2009 15:26:15 +0000 (17:26 +0200)]
mfd: Initial support for twl5031

TWL5031 introduces two new interrupts in PIH. Moreover, BCI
has changed remarkably and, thus, it's disabled when TWL5031
is in use.

Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Mask and unmask wm8350 IRQs on request and free
Mark Brown [Wed, 4 Nov 2009 16:10:52 +0000 (16:10 +0000)]
mfd: Mask and unmask wm8350 IRQs on request and free

Bring the WM8350 IRQ API more in line with the generic IRQ API by
masking and unmasking interrupts as they are requested and freed.
This is mostly just a case of deleting the mask and unmask calls
from the individual drivers.

The RTC driver is changed to mask the periodic IRQ after requesting
it rather than only unmasking the alarm IRQ. If the periodic IRQ
fires in the period where it is reqested then there will be a
spurious notification but there should be no serious consequences
from this.

The CODEC drive is changed to explicitly disable headphone jack
detection prior to requesting the IRQs. This will avoid the IRQ
firing with no jack set up.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Convert wm8350 IRQ handlers to irq_handler_t
Mark Brown [Wed, 4 Nov 2009 16:10:51 +0000 (16:10 +0000)]
mfd: Convert wm8350 IRQ handlers to irq_handler_t

This is done as simple code transformation, the semantics of the
IRQ API provided by the core are are still very different to those
of genirq (mainly with regard to masking).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: ezx-pcap: Don't pass pcap pointer as subdev drvdata.
Antonio Ospite [Tue, 3 Nov 2009 10:53:17 +0000 (11:53 +0100)]
mfd: ezx-pcap: Don't pass pcap pointer as subdev drvdata.

Abusing subdev drvdata is not needed anymore, as all pcap subdevs are now
retrieving the pcap pointer from their parent device.

This change removes a leftover coming from early versions of ezx-pcap and its
subdevs drivers.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Allow configuration of VDCDC2 for tps65010
Ben Dooks [Mon, 2 Nov 2009 16:52:30 +0000 (16:52 +0000)]
mfd: Allow configuration of VDCDC2 for tps65010

Add function to allow the configuation fo the VDCDC2 register by
external users, to allow changing of the standard and low-power
running modes.

This is needed, for example, for the Simtec IM2440D20 where we need
to use the low-power mode to shutdown the LDO/DCDC that are not needed
during suspend (saving substantial power) and the runtime use of the
low-power mode to change VCore.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Simtec Linux Team <linux@simtec.co.uk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Allow the board to choose any GPIO base for tps65010
Ben Dooks [Mon, 2 Nov 2009 16:52:20 +0000 (16:52 +0000)]
mfd: Allow the board to choose any GPIO base for tps65010

If the board does not care where the TPS turns up, then specifiying the
value -1 to get gpiolib to dynamically allocate the base for the chip
is valid.

Change the test to look for != 0, so that any boards specifying zero
will not end up with gpio that they didn't want.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Simtec Liunx Team <linux@simtec.co.uk>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Enable twl4030 32kHz oscillator low-power mode
Ilkka Koskinen [Thu, 22 Oct 2009 11:14:09 +0000 (14:14 +0300)]
mfd: Enable twl4030 32kHz oscillator low-power mode

Allows TWL's 32kHz oscillator to go in low-power mode when
main battery voltage is running low.

Signed-off-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Allow platforms to specify an IRQ base for WM8350
Mark Brown [Wed, 21 Oct 2009 18:11:34 +0000 (19:11 +0100)]
mfd: Allow platforms to specify an IRQ base for WM8350

This is currently unused by the wm8350 drivers but getting it merged
now will reduce merge issues in the future when implementing wm8350
genirq support.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Fix more undefined twl4030-power resconfig value checks
Amit Kucheria [Wed, 21 Oct 2009 11:49:22 +0000 (14:49 +0300)]
mfd: Fix more undefined twl4030-power resconfig value checks

Based on Aaro's previous fix, this needs to be fixed for the newly added
remap_off and remap_sleep resources as well.

The code tries to skip values initialized with -1, but since the values
are unsigned the comparison is always true.

The patch eliminates the following compiler warnings:

drivers/mfd/twl4030-power.c: In function 'twl4030_configure_resource':
drivers/mfd/twl4030-power.c:338: warning: comparison is always true due to
limited range of data type

Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Optimised twl4030-power power scripts for the rx51
Amit Kucheria [Mon, 19 Oct 2009 12:11:08 +0000 (15:11 +0300)]
mfd: Optimised twl4030-power power scripts for the rx51

The power scripts optimisation was mainly done by:
Tero Kristo <tero.kristo@nokia.com> and
Arnaud Mandy <ext-arnaud.2.mandy@nokia.com>

I'm only refactoring and testing it against the mainline kernel.

Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
Cc: Tero Kristo <tero.kristo@nokia.com>
Cc: linux-omap@vger.kernel.org
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Cleanup pcf50633_probe error handling
Lars-Peter Clausen [Wed, 7 Oct 2009 22:24:54 +0000 (00:24 +0200)]
mfd: Cleanup pcf50633_probe error handling

Currently the child devices were not freed if the irq could not be requested.
This patch restructures the function, that in case of an error all previously
allocated resources are freed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Staticise __adp5520_ack_bits()
Mark Brown [Mon, 19 Oct 2009 14:46:22 +0000 (15:46 +0100)]
mfd: Staticise __adp5520_ack_bits()

The function is not exported as the __ indicates. __

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: fix undefined twl4030-power resconfig value checks
Aaro Koskinen [Mon, 19 Oct 2009 19:24:02 +0000 (21:24 +0200)]
mfd: fix undefined twl4030-power resconfig value checks

The code tries to skip values initialized with -1, but since the values
are unsigned the comparison is always true.

The patch eliminates the following compiler warnings:

drivers/mfd/twl4030-power.c: In function 'twl4030_configure_resource':
drivers/mfd/twl4030-power.c:338: warning: comparison is always true due to
limited range of data type
drivers/mfd/twl4030-power.c:358: warning: comparison is always true due to
limited range of data type
drivers/mfd/twl4030-power.c:363: warning: comparison is always true due to
limited range of data type

Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add support for remapping twl4030-power power states
Amit Kucheria [Mon, 19 Oct 2009 12:11:00 +0000 (15:11 +0300)]
mfd: Add support for remapping twl4030-power power states

The <RESOURCE>_REMAP register allows configuration of the <RESOURCE> in case
of a sleep or off transition.

Allow this property of resources to be configured (through twl4030_resconfig)
and add code to parse these values to program the registers accordingly.

Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add comments for the twl4030-power register and bit layout
Amit Kucheria [Mon, 19 Oct 2009 12:10:48 +0000 (15:10 +0300)]
mfd: Add comments for the twl4030-power register and bit layout

Describe how the resource registers are laid out and the various bit-fields in
them.

Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: twl4030-power: Rename DEVGROUP to DEV_GRP
Amit Kucheria [Mon, 19 Oct 2009 12:10:44 +0000 (15:10 +0300)]
mfd: twl4030-power: Rename DEVGROUP to DEV_GRP

Stick to the names used in the reference manual

Signed-off-by: Amit Kucheria <amit.kucheria@verdurent.com>
Cc: linux-omap@vger.kernel.org
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Fix pcf50633-regulator drvdata usage
Lars-Peter Clausen [Tue, 13 Oct 2009 22:12:36 +0000 (02:12 +0400)]
mfd: Fix pcf50633-regulator drvdata usage

Currently the pcf50633-regulator driver data is set to the pcf50633 core
structure, but the pcf50633-regulator remove handler assumes that it is set to
the regulator device. This patch fixes the issue by accessing the pcf506533
core structure through its parent device and setting the driver data to the
regulator device.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Use platform_device_add_data to set pcf50633 regulator platform data
Lars-Peter Clausen [Tue, 13 Oct 2009 22:12:35 +0000 (02:12 +0400)]
mfd: Use platform_device_add_data to set pcf50633 regulator platform data

Platform devices allocated with platform_device_alloc should use
platform_device_add_data to set the platform data, because kfree will be called
on the platform_data when the device is released.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Fix memleak in pcf50633_client_dev_register
Lars-Peter Clausen [Tue, 13 Oct 2009 22:12:33 +0000 (02:12 +0400)]
mfd: Fix memleak in pcf50633_client_dev_register

Since platform_device_add_data copies the passed data, the allocated
subdev_pdata is never freed. A simple fix would be to either free subdev_pdata
or put it onto the stack. But since the pcf50633 child devices can rely on
beeing children of the pcf50633 core device it's much more elegant to get access
to pcf50633 core structure through that link. This allows to get completly rid
of pcf5033_subdev_pdata.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Move pcf50633 messages to appropriate log levels
Arnaud Patard [Tue, 13 Oct 2009 22:12:32 +0000 (02:12 +0400)]
mfd: Move pcf50633 messages to appropriate log levels

IRQs masking/unmasking should be less verbose.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Make pcf50633 suspend/resume belong to i2c_driver
Lars-Peter Clausen [Tue, 13 Oct 2009 22:12:31 +0000 (02:12 +0400)]
mfd: Make pcf50633 suspend/resume belong to i2c_driver

When not using the i2c suspend/resume callbacks the i2c client resumed
before the i2c master.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Disable unnecessary pcf50633 shutdown on lowsys
Paul Fertser [Tue, 13 Oct 2009 22:12:30 +0000 (02:12 +0400)]
mfd: Disable unnecessary pcf50633 shutdown on lowsys

On gta02 hardware revision A5 it can actually bring the system down
during normal operating conditions so we disable it.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Convert WM835x IRQ handling to use a data table
Mark Brown [Mon, 12 Oct 2009 15:15:10 +0000 (16:15 +0100)]
mfd: Convert WM835x IRQ handling to use a data table

Rather than open coding individual IRQs in each function which
manipulates them store data for IRQs in a table which is then
referenced in the users.

This is a substantial code shrink and should be a performance win in
cases where only a single IRQ goes off at once since instead of
reading four of the second level IRQ registers for each interrupt
we read only the sub-registers which have had an interrupt flagged.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Split wm8350 IRQ code into a separate file
Mark Brown [Mon, 12 Oct 2009 15:15:09 +0000 (16:15 +0100)]
mfd: Split wm8350 IRQ code into a separate file

In preparation for refactoring - it's over 700 lines of well-isolated
code and having it in a file by itself makes things more managable.

While we're at it make sure that we clean up the IRQ if we fail after
acquiring it on init.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agoinput/keyboard: new driver for ADP5520 MFD PMICs
Michael Hennerich [Sat, 10 Oct 2009 17:54:02 +0000 (13:54 -0400)]
input/keyboard: new driver for ADP5520 MFD PMICs

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add ADP5520/ADP5501 driver
Michael Hennerich [Mon, 12 Oct 2009 15:22:38 +0000 (17:22 +0200)]
mfd: Add ADP5520/ADP5501 driver

Base driver for Analog Devices ADP5520/ADP5501 MFD PMICs

Subdevs:
LCD Backlight   : drivers/video/backlight/adp5520_bl.c
LEDs            : drivers/led/leds-adp5520.c
GPIO            : drivers/gpio/adp5520-gpio.c (ADP5520 only)
Keys            : drivers/input/keyboard/adp5520-keys.c (ADP5520 only)

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agogpio: adp5520: rename common defines and typos
Michael Hennerich [Sat, 10 Oct 2009 17:54:03 +0000 (13:54 -0400)]
gpio: adp5520: rename common defines and typos

The common adp5520 mfd defines were namespaced to avoid collisions, so
update the define used in this driver accordingly.  The structs were also
renamed to fix a spelling typo.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agobacklight: adp5520: rename common defines and typos
Michael Hennerich [Sat, 10 Oct 2009 17:54:04 +0000 (13:54 -0400)]
backlight: adp5520: rename common defines and typos

The common adp5520 mfd defines were namespaced to avoid collisions, so
update the define used in this driver accordingly.  The structs were also
renamed to fix a spelling typo.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Fix 88PM8607 I2C dependency
Haojian Zhuang [Mon, 12 Oct 2009 13:17:54 +0000 (15:17 +0200)]
mfd: Fix 88PM8607 I2C dependency

88PM8607 depends on I2C and MFD_CORE. Since 88PM8607 is built-in
kernel, it also requires that I2C and MFD_CORE are built-in
kernel also.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Move asic3_remove to .devexit.text
Uwe Kleine-König [Thu, 1 Oct 2009 08:28:05 +0000 (10:28 +0200)]
mfd: Move asic3_remove to .devexit.text

The function asic3_remove is used only wrapped by __devexit_p so define
it using __devexit.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add support for WM8320 PMICs
Mark Brown [Thu, 1 Oct 2009 14:41:07 +0000 (15:41 +0100)]
mfd: Add support for WM8320 PMICs

The WM8320 is an integrated power management subsystem providing
voltage regulators, RTC, watchdog and other functionality. The
WM8320 is derived from the WM831x and therefore shares most of
the driver code with the WM831x.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agogpiolib: Make WM831x GPIO count dynamic
Mark Brown [Thu, 1 Oct 2009 14:41:05 +0000 (15:41 +0100)]
gpiolib: Make WM831x GPIO count dynamic

This supports future devices with fewer GPIOs.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Refactor WM831x chip identification
Mark Brown [Thu, 1 Oct 2009 14:41:04 +0000 (15:41 +0100)]
mfd: Refactor WM831x chip identification

Better support future device revisions by moving some of the output
around and making the chip ID enumeration be the value expected in
the ID register.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Don't abuse i2c_client.name
Jean Delvare [Fri, 25 Sep 2009 12:15:59 +0000 (14:15 +0200)]
mfd: Don't abuse i2c_client.name

The name field of struct i2c_client is for i2c-core's use, it should
never be changed by the drivers themselves.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Fix ab4500 compilation warnings
Samuel Ortiz [Mon, 12 Oct 2009 15:17:19 +0000 (17:17 +0200)]
mfd: Fix ab4500 compilation warnings

When building the driver as a module, module_exit was missing, and
subsys_initcall_sync() is not defined.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: add AB4500 driver
Srinidhi Kasagar [Mon, 12 Oct 2009 15:11:52 +0000 (17:11 +0200)]
mfd: add AB4500 driver

This adds core driver support for AB4500 mixed signal
multimedia & power management chip. This connects to U8500
on the SSP (pl022) and exports read/write functions for
the device to get access to this chip. This also registers
the client devices and sets the parent.

Signed-off-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com>
Acked-by: Andrea Gallo <andrea.gallo@stericsson.com>
Reviewed-by: Mark Brown <broonie@sirena.org.uk>
Reviewed-by: Jean-Christophe <plagnioj@jcrosoft.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agomfd: Add 88PM8607 driver
Haojian Zhuang [Thu, 17 Sep 2009 12:54:03 +0000 (08:54 -0400)]
mfd: Add 88PM8607 driver

This adds a core driver for 88PM8607 found in Marvell DKB development
platform. This driver is a proxy for all accesses to 88PM8607
sub-drivers which will be merged on top of this one, RTC, regulators,
battery and so on.

This chip is manufactured by Marvell.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
14 years agoMerge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa...
Russell King [Sun, 13 Dec 2009 16:35:09 +0000 (16:35 +0000)]
Merge branch 'devel' of git://git./linux/kernel/git/ycmiao/pxa-linux-2.6 into devel

14 years agoARM: fix clps711x, footbridge, integrator, ixp2000, ixp2300 and s3c build bug
Russell King [Sat, 12 Dec 2009 14:53:08 +0000 (14:53 +0000)]
ARM: fix clps711x, footbridge, integrator, ixp2000, ixp2300 and s3c build bug

Anders Grafström reports that footbridge fails to build after 1c4a4f4.
Fix this by adding the necessary definitions for __pfn_to_bus and
__bus_to_pfn.

Reported-by: Anders Grafström <anders.grafstrom@netinsight.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoARM: VFP: fix vfp thread init bug and document vfp notifier entry conditions
Russell King [Sat, 12 Dec 2009 14:47:40 +0000 (14:47 +0000)]
ARM: VFP: fix vfp thread init bug and document vfp notifier entry conditions

When the VFP notifier is called for flush_thread(), we may be
preemptible, meaning we might migrate to another CPU, which means
referencing the current CPU number without some form of locking is
invalid, and can cause data corruption.

For the most cases, this isn't a problem since atomic notifiers are run
under rcu lock, which for most configurations results in preemption
being disabled - except when the preemptable tree-based rcu
implementation is selected.

Let's make it safe anyway.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoARM: pxa: fix now incorrect reference of skt->irq by using skt->socket.pci_irq
Eric Miao [Wed, 9 Dec 2009 10:54:05 +0000 (18:54 +0800)]
ARM: pxa: fix now incorrect reference of skt->irq by using skt->socket.pci_irq

commit 66024db removes all other references of skt->irq by using
skt->socket.pci_irq, while leaving these two missed. Get them fixed.

Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years ago[ARM] pxa/zeus: default configuration for Arcom Zeus SBC.
Marc Zyngier [Sat, 14 Nov 2009 12:48:10 +0000 (13:48 +0100)]
[ARM] pxa/zeus: default configuration for Arcom Zeus SBC.

Signed-off-by: Marc Zyngier <maz@misterjones.org>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
14 years ago[ARM] pxa/zeus: make Viper pcmcia support more generic to support Zeus
Marc Zyngier [Sat, 14 Nov 2009 12:39:13 +0000 (13:39 +0100)]
[ARM] pxa/zeus: make Viper pcmcia support more generic to support Zeus

The Arcom Zeus CF slot requires the same kind of support as the Viper.
To avoid code duplication, introduce a platform device that abstracts
the differences.

This also allows for the removal of the ugly export of viper_cf_rst().

Signed-off-by: Marc Zyngier <maz@misterjones.org>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
14 years ago[ARM] pxa/zeus: basic support for Arcom Zeus SBC
Marc Zyngier [Sat, 14 Nov 2009 12:47:03 +0000 (13:47 +0100)]
[ARM] pxa/zeus: basic support for Arcom Zeus SBC

Signed-off-by: Marc Zyngier <maz@misterjones.org>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
14 years ago[ARM] pxa/em-x270: fix usb hub power up/reset sequence
Igor Grinberg [Sun, 6 Dec 2009 13:45:43 +0000 (15:45 +0200)]
[ARM] pxa/em-x270: fix usb hub power up/reset sequence

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
14 years agospi: fix probe/remove section markings
Grant Likely [Sun, 13 Dec 2009 08:03:12 +0000 (01:03 -0700)]
spi: fix probe/remove section markings

Probe/remove functions need to be marked as __devinit and __devexit
(not __init an __exit) to prevent trying to run code that has been
discarded.  This patch fixes the spi_imx driver to mark probe and
remove correctly.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
14 years agoAdd OMAP spi100k driver
Cory Maccarrone [Sun, 13 Dec 2009 08:02:11 +0000 (01:02 -0700)]
Add OMAP spi100k driver

This change adds the OMAP SPI 100k driver created by
Fabrice Crohas <fcrohas@gmail.com>.  This SPI bus is found on
OMAP7xx-series smartphones, and for many, the touchscreen is
attached to this bus.

The lion's share of the work was done by Fabrice on this driver --
I am merely porting it from the Linwizard project on his behalf.

Signed-off-by: Cory Maccarrone <darkstar6262@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
14 years agospi-imx: don't access struct device directly but use dev_get_platdata
Uwe Kleine-König [Sun, 13 Dec 2009 08:02:09 +0000 (01:02 -0700)]
spi-imx: don't access struct device directly but use dev_get_platdata

Also there is no casting needed to assign a void pointer.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
14 years agospi-imx: Add mx25 support
Sascha Hauer [Sun, 13 Dec 2009 07:58:41 +0000 (00:58 -0700)]
spi-imx: Add mx25 support

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
14 years agospi-imx: use positive logic to distinguish cpu variants
Uwe Kleine-König [Sun, 13 Dec 2009 07:58:29 +0000 (00:58 -0700)]
spi-imx: use positive logic to distinguish cpu variants

This is much safer when support for new variants is added.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
14 years agospi-imx: correct check for platform_get_irq failing
Uwe Kleine-König [Sun, 13 Dec 2009 07:58:13 +0000 (00:58 -0700)]
spi-imx: correct check for platform_get_irq failing

platform_get_irq returns -ENXIO if there is no entry.  So ensure
return value is greater than zero instead of non-zero.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
14 years agoARM: NUC900: Add spi driver support for nuc900
Wan ZongShun [Tue, 1 Dec 2009 14:29:20 +0000 (14:29 +0000)]
ARM: NUC900: Add spi driver support for nuc900

Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
14 years agospi: SuperH MSIOF SPI Master driver V2
Magnus Damm [Thu, 26 Nov 2009 11:10:05 +0000 (11:10 +0000)]
spi: SuperH MSIOF SPI Master driver V2

This patch is V2 of SPI Master support for the SuperH MSIOF.
Full duplex, spi mode 0-3, active high cs, 3-wire and lsb
first should all be supported, but the driver has so far
only been tested with "mmc_spi".

The MSIOF hardware comes with 32-bit FIFOs for receive and
transmit, and this driver simply breaks the SPI messages
into FIFO-sized chunks. The MSIOF hardware manages the pins
for clock, receive and transmit (sck/miso/mosi), but the chip
select pin is managed by software and must be configured as
a regular GPIO pin by the board code.

Performance wise there is still room for improvement, but
on a Ecovec board with the built-in sh7724 MSIOF0 this driver
gets Mini-sd read speeds of about half a megabyte per second.

Future work include better clock setup and merging of 8-bit
transfers into 32-bit words to reduce interrupt load and
improve throughput.

Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
14 years agox86: Fix duplicated UV BAU interrupt vector
Cliff Wickman [Fri, 11 Dec 2009 17:36:18 +0000 (11:36 -0600)]
x86: Fix duplicated UV BAU interrupt vector

Interrupt vector 0xec has been doubly defined in irq_vectors.h

It seems arbitrary whether LOCAL_PENDING_VECTOR or
UV_BAU_MESSAGE is the higher number.  As long as they are
unique. If they are not unique we'll hit a BUG in
alloc_system_vector().

Signed-off-by: Cliff Wickman <cpw@sgi.com>
Cc: <stable@kernel.org>
LKML-Reference: <E1NJ9Pe-0004P7-0Q@eag09.americas.sgi.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
14 years agoMerge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6
Linus Torvalds [Sat, 12 Dec 2009 23:22:22 +0000 (15:22 -0800)]
Merge branch 'ixp4xx' of git://git./linux/kernel/git/chris/linux-2.6

* 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6:
  IXP4xx: GTWX5715 platform only has two PCI IRQ lines, not four.
  IXP4xx: Introduce IXP4XX_GPIO_IRQ(n) macro and convert IXP4xx platform files.
  IXP4xx: move Gemtek GTWX5715 platform macros to the platform code.
  IXP4xx: Remove unused Motorola PrPMC1100 platform macros.
  IXP4xx: move FSG platform macros to the platform code.
  IXP4xx: move DSM G600 platform macros to the platform code.
  IXP4xx: move NAS100D platform macros to the platform code.
  IXP4xx: move NSLU2 platform macros to the platform code.
  IXP4xx: move Coyote platform macros to the platform code.
  IXP4xx: move AVILA platform macros to the platform code.
  IXP4xx: move IXDP425 platform macros to the platform code.
  IXP4xx: Extend PCI MMIO indirect address space to 1 GB.
  IXP4xx: Fix compilation failure with CONFIG_IXP4XX_INDIRECT_PCI.
  IXP4xx: Drop "__ixp4xx_" prefix from in/out/ioread/iowrite functions for clarity.
  IXP4xx: Rename indirect MMIO primitives from __ixp4xx_* to __indirect_*.
  IXP4xx: Ensure index is positive in irq_to_gpio() and npe_request().
  ARM: fix insl() and outsl() endianness on IXP4xx architecture.
  IXP4xx: Fix normally-disabled debugging text in drivers/net/arm/ixp4xx_eth.c.
  IXP4xx: change the timer base frequency to 66.666000 MHz.

14 years ago[BKL] add 'might_sleep()' to the outermost lock taker
Linus Torvalds [Sat, 12 Dec 2009 22:46:33 +0000 (14:46 -0800)]
[BKL] add 'might_sleep()' to the outermost lock taker

As shown by the previous patch (6698e3472: "tty: Fix BKL taken under a
spinlock bug introduced in the BKL split") the BKL removal is prone to
some subtle issues, where removing the BKL in one place may in fact make
a previously nested BKL call the new outer call, and then prone to nasty
deadlocks with other spinlocks.

In general, we should never take the BKL while we're holding a spinlock,
so let's just add a "might_sleep()" to it (even though the BKL doesn't
technically sleep - at least not yet), and we'll get nice warnings the
next time this kind of problem happens during BKL removal.

Acked-and-Tested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agotty: Fix BKL taken under a spinlock bug introduced in the BKL split
Alan Cox [Sat, 12 Dec 2009 10:32:36 +0000 (10:32 +0000)]
tty: Fix BKL taken under a spinlock bug introduced in the BKL split

The fasync path takes the BKL (it probably doesn't need to in fact)
while holding the file_list spinlock.  You can't do that with the kernel
lock: it causes lock inversions and deadlocks.

Leave the BKL over that bit for the moment.

Identified by AKPM.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Acked-and-Tested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agoMerge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
Linus Torvalds [Sat, 12 Dec 2009 22:27:24 +0000 (14:27 -0800)]
Merge branch 'next' of git://git./linux/kernel/git/benh/powerpc

* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (151 commits)
  powerpc: Fix usage of 64-bit instruction in 32-bit altivec code
  MAINTAINERS: Add PowerPC patterns
  powerpc/pseries: Track previous CPPR values to correctly EOI interrupts
  powerpc/pseries: Correct pseries/dlpar.c build break without CONFIG_SMP
  powerpc: Make "intspec" pointers in irq_host->xlate() const
  powerpc/8xx: DTLB Miss cleanup
  powerpc/8xx: Remove DIRTY pte handling in DTLB Error.
  powerpc/8xx: Start using dcbX instructions in various copy routines
  powerpc/8xx: Restore _PAGE_WRITETHRU
  powerpc/8xx: Add missing Guarded setting in DTLB Error.
  powerpc/8xx: Fixup DAR from buggy dcbX instructions.
  powerpc/8xx: Tag DAR with 0x00f0 to catch buggy instructions.
  powerpc/8xx: Update TLB asm so it behaves as linux mm expects.
  powerpc/8xx: Invalidate non present TLBs
  powerpc/pseries: Serialize cpu hotplug operations during deactivate Vs deallocate
  pseries/pseries: Add code to online/offline CPUs of a DLPAR node
  powerpc: stop_this_cpu: remove the cpu from the online map.
  powerpc/pseries: Add kernel based CPU DLPAR handling
  sysfs/cpu: Add probe/release files
  powerpc/pseries: Kernel DLPAR Infrastructure
  ...

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
Linus Torvalds [Sat, 12 Dec 2009 19:40:50 +0000 (11:40 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Overwrite pin config on intel DG45ID board.
  intelhdmi - dont power off HDA link
  ALSA: hrtimer - Fix lock-up
  ALSA: intelhdmi - add channel mapping for typical configurations
  ALSA: intelhdmi - channel mapping applies to Pin
  ALSA: intelhdmi - accept DisplayPort pin
  ALSA: hda - show HBR(High Bit Rate) pin cap in procfs
  ALSA: hda - Fix LED GPIO setup for HP laptops with IDT codecs
  ASoC: Fix build of OMAP sound drivers
  ALSA: opti93x: fix irq releasing if the irq cannot be allocated

14 years agoMerge branch 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind...
Linus Torvalds [Sat, 12 Dec 2009 19:40:13 +0000 (11:40 -0800)]
Merge branch 'omap-for-linus' of git://git./linux/kernel/git/tmlind/linux-omap-2.6

* 'omap-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6: (75 commits)
  omap3: Fix OMAP35XX_REV macros
  omap: serial: fix non-empty uart fifo read abort
  omap3: Zoom2/3: Update hsmmc board config params
  omap3 : Enable TWL4030 Keypad for Zoom2 and Zoom3 boards
  omap3: id code detection 3525 vs 3515
  omap3: rx51: Use wl1251 in SPI mode 3
  omap3: zoom2/3: make MMC slot work again
  omap1: htcherald: Update defconfig to include mux support
  omap1: LCD_DMA: Use some define rather than a hexadecimal
  omap: header: remove unused data-type
  omap: arch/arm/plat-omap/devices.c - sort alphabetically
  omap: Correcting GPMC_CONFIG1_DEVICETYPE_NAND
  OMAP3: serial - allow platforms specify which UARTs to initialize
  omap3: cm-t35: add mux initialization
  OMAP4: Sync up omap4430 defconfig
  OMAP4: Remove the secondary wait loop
  OMAP4: AuxCoreBoot registers only accessible in secure mode
  OMAP4: Fix SRAM base and size
  OMAP4: Fix cpu detection
  omap3: pandora: board file updates for .33
  ...

14 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Linus Torvalds [Sat, 12 Dec 2009 19:39:09 +0000 (11:39 -0800)]
Merge git://git./linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  be2net: fix error in rx completion processing.
  igbvf: avoid reset storms due to mailbox issues
  igb: fix handling of mailbox collisions between PF/VF
  usb: remove rare pm primitive for conversion to new API

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg...
Linus Torvalds [Sat, 12 Dec 2009 19:37:39 +0000 (11:37 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/penberg/slab-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
  slab, kmemleak: pass the correct pointer to kmemleak_erase()
  slab, kmemleak: stop calling kmemleak_erase() unconditionally
  SLAB: Fix unlikely() annotation in __cache_alloc_node()
  SLAB: Fix lockdep annotations for CPU hotplug
  SLUB: Fix __GFP_ZERO unlikely() annotation
  slub: allow stats to be cleared

14 years agoMerge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sat, 12 Dec 2009 19:34:10 +0000 (11:34 -0800)]
Merge branch 'sched-fixes-for-linus' of git://git./linux/kernel/git/tip/linux-2.6-tip

* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (21 commits)
  sched: Remove forced2_migrations stats
  sched: Fix memory leak in two error corner cases
  sched: Fix build warning in get_update_sysctl_factor()
  sched: Update normalized values on user updates via proc
  sched: Make tunable scaling style configurable
  sched: Fix missing sched tunable recalculation on cpu add/remove
  sched: Fix task priority bug
  sched: cgroup: Implement different treatment for idle shares
  sched: Remove unnecessary RCU exclusion
  sched: Discard some old bits
  sched: Clean up check_preempt_wakeup()
  sched: Move update_curr() in check_preempt_wakeup() to avoid redundant call
  sched: Sanitize fork() handling
  sched: Clean up ttwu() rq locking
  sched: Remove rq->clock coupling from set_task_cpu()
  sched: Consolidate select_task_rq() callers
  sched: Remove sysctl.sched_features
  sched: Protect sched_rr_get_param() access to task->sched_class
  sched: Protect task->cpus_allowed access in sched_getaffinity()
  sched: Fix balance vs hotplug race
  ...

Fixed up conflicts in kernel/sysctl.c (due to sysctl cleanup)

14 years agoMerge branch 'topic/hda' into for-linus
Takashi Iwai [Sat, 12 Dec 2009 17:18:08 +0000 (18:18 +0100)]
Merge branch 'topic/hda' into for-linus

14 years agoMerge branch 'topic/asoc' into for-linus
Takashi Iwai [Sat, 12 Dec 2009 17:18:04 +0000 (18:18 +0100)]
Merge branch 'topic/asoc' into for-linus

14 years agoPCMCIA: fix pxa2xx_lubbock modular build error
Russell King [Sat, 12 Dec 2009 10:07:34 +0000 (10:07 +0000)]
PCMCIA: fix pxa2xx_lubbock modular build error

ERROR: "pxa2xx_drv_pcmcia_ops" [drivers/pcmcia/pxa2xx_lubbock_cs.ko] undefined!
ERROR: "pxa2xx_drv_pcmcia_add_one" [drivers/pcmcia/pxa2xx_lubbock_cs.ko] undefined!

We also remove __pxa2xx_drv_pcmcia_probe and its export, since this is
no longer required.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
14 years agoALSA: hda - Overwrite pin config on intel DG45ID board.
Alexey Fisher [Sat, 12 Dec 2009 09:16:41 +0000 (11:16 +0200)]
ALSA: hda - Overwrite pin config on intel DG45ID board.

The pin config provided by BIOS have some problems:
0x0221401f: [Jack] HP Out at Ext Front  <-- other association and sequence
0x02a19020: [Jack] Mic at Ext Front     <-- other association
0x01113014: [Jack] Speaker at Ext Rear  <-- line out (not speaker)
0x01114010: [Jack] Speaker at Ext Rear  <-- line out
0x01a19030: [Jack] Mic at Ext Rear      <-- other association
0x01111012: [Jack] Speaker at Ext Rear  <-- line out
0x01116011: [Jack] Speaker at Ext Rear  <-- line out
0x40f000f0: [N/A] Other at Ext N/A
0x40f000f0: [N/A] Other at Ext N/A
0x40f000f0: [N/A] Other at Ext N/A
0x40f000f0: [N/A] Other at Ext N/A
0x40f000f0: [N/A] Other at Ext N/A
0x01451140: [Jack] SPDIF Out at Ext Rear
0x40f000f0: [N/A] Other at Ext N/A

just overwrite it.

Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
14 years agoMerge branches 'slab/fixes', 'slab/kmemleak', 'slub/perf' and 'slub/stats' into for...
Pekka Enberg [Sat, 12 Dec 2009 08:12:19 +0000 (10:12 +0200)]
Merge branches 'slab/fixes', 'slab/kmemleak', 'slub/perf' and 'slub/stats' into for-linus

14 years agobe2net: fix error in rx completion processing.
Ajit Khaparde [Sat, 12 Dec 2009 06:59:09 +0000 (22:59 -0800)]
be2net: fix error in rx completion processing.

There are certain skews of the NIC which have multiple bits set in
adapter->cap.  Use & instead of == to process rx completions.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>