profile/common/kernel-common.git
14 years agoMerge branch 'for-linus' of git://neil.brown.name/md
Linus Torvalds [Mon, 14 Dec 2009 18:03:36 +0000 (10:03 -0800)]
Merge branch 'for-linus' of git://neil.brown.name/md

* 'for-linus' of git://neil.brown.name/md: (27 commits)
  md: add 'recovery_start' per-device sysfs attribute
  md: rcu_read_lock() walk of mddev->disks in md_do_sync()
  md: integrate spares into array at earliest opportunity.
  md: move compat_ioctl handling into md.c
  md: revise Kconfig help for MD_MULTIPATH
  md: add MODULE_DESCRIPTION for all md related modules.
  raid: improve MD/raid10 handling of correctable read errors.
  md/raid10: print more useful messages on device failure.
  md/bitmap: update dirty flag when bitmap bits are explicitly set.
  md: Support write-intent bitmaps with externally managed metadata.
  md/bitmap: move setting of daemon_lastrun out of bitmap_read_sb
  md: support updating bitmap parameters via sysfs.
  md: factor out parsing of fixed-point numbers
  md: support bitmap offset appropriate for external-metadata arrays.
  md: remove needless setting of thread->timeout in raid10_quiesce
  md: change daemon_sleep to be in 'jiffies' rather than 'seconds'.
  md: move offset, daemon_sleep and chunksize out of bitmap structure
  md: collect bitmap-specific fields into one structure.
  md/raid1: add takeover support for raid5->raid1
  md: add honouring of suspend_{lo,hi} to raid1.
  ...

14 years agoMerge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6
Linus Torvalds [Mon, 14 Dec 2009 18:02:35 +0000 (10:02 -0800)]
Merge branch 'for-next' of git://git./linux/kernel/git/sameo/mfd-2.6

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (58 commits)
  mfd: Add twl6030 regulator subdevices
  regulator: Add support for twl6030 regulators
  rtc: Add twl6030 RTC support
  mfd: Add support for twl6030 irq framework
  mfd: Rename twl4030_ routines in twl-regulator.c
  mfd: Rename twl4030_ routines in rtc-twl.c
  mfd: Rename all twl4030_i2c*
  mfd: Rename twl4030* driver files to enable re-use
  mfd: Clarify twl4030 return value for read and write
  mfd: Add all twl4030 regulators to the twl4030 mfd driver
  mfd: Don't set mc13783 ADREFMODE for touch conversions
  mfd: Remove ezx-pcap defines for custom led gpio encoding
  mfd: Near complete mc13783 rewrite
  mfd: Remove build time warning for WM835x register default tables
  mfd: Force I2C to be built in when building WM831x
  mfd: Don't allow wm831x to be built as a module
  mfd: Fix incorrect error check for wm8350-core
  mfd: Fix twl4030 warning
  gpiolib: Implement gpio_to_irq() for wm831x
  mfd: Remove default selection of AB4500
  ...

14 years agoMerge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Mon, 14 Dec 2009 18:01:15 +0000 (10:01 -0800)]
Merge branch 'devel' of /home/rmk/linux-2.6-arm

* 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm:
  ARM: fix lh7a40x build
  ARM: fix sa1100 build
  ARM: fix clps711x, footbridge, integrator, ixp2000, ixp2300 and s3c build bug
  ARM: VFP: fix vfp thread init bug and document vfp notifier entry conditions
  ARM: pxa: fix now incorrect reference of skt->irq by using skt->socket.pci_irq
  [ARM] pxa/zeus: default configuration for Arcom Zeus SBC.
  [ARM] pxa/zeus: make Viper pcmcia support more generic to support Zeus
  [ARM] pxa/zeus: basic support for Arcom Zeus SBC
  [ARM] pxa/em-x270: fix usb hub power up/reset sequence
  PCMCIA: fix pxa2xx_lubbock modular build error
  ARM: RealView: Fix typo in the RealView/PBX Kconfig entry
  ARM: Do not allow the probing of the local timer
  ARM: Add an earlyprintk debug console

14 years agoMerge git://git.linux-nfs.org/projects/trondmy/nfs-2.6
Linus Torvalds [Mon, 14 Dec 2009 18:00:24 +0000 (10:00 -0800)]
Merge git://git.linux-nfs.org/projects/trondmy/nfs-2.6

* git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (75 commits)
  NFS: Fix nfs_migrate_page()
  rpc: remove unneeded function parameter in gss_add_msg()
  nfs41: Invoke RECLAIM_COMPLETE on all new client ids
  SUNRPC: IS_ERR/PTR_ERR confusion
  NFSv41: Fix a potential state leakage when restarting nfs4_close_prepare
  nfs41: Handle NFSv4.1 session errors in the delegation recall code
  nfs41: Retry delegation return if it failed with session error
  nfs41: Handle session errors during delegation return
  nfs41: Mark stateids in need of reclaim if state manager gets stale clientid
  NFS: Fix up the declaration of nfs4_restart_rpc when NFSv4 not configured
  nfs41: Don't clear DRAINING flag on NFS4ERR_STALE_CLIENTID
  nfs41: nfs41_setup_state_renewal
  NFSv41: More cleanups
  NFSv41: Fix up some bugs in the NFS4CLNT_SESSION_DRAINING code
  NFSv41: Clean up slot table management
  NFSv41: Fix nfs4_proc_create_session
  nfs41: Invoke RECLAIM_COMPLETE
  nfs41: RECLAIM_COMPLETE functionality
  nfs41: RECLAIM_COMPLETE XDR functionality
  Cleanup some NFSv4 XDR decode comments
  ...

14 years agoMerge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
Linus Torvalds [Mon, 14 Dec 2009 17:58:24 +0000 (09:58 -0800)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tj/percpu

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (34 commits)
  m68k: rename global variable vmalloc_end to m68k_vmalloc_end
  percpu: add missing per_cpu_ptr_to_phys() definition for UP
  percpu: Fix kdump failure if booted with percpu_alloc=page
  percpu: make misc percpu symbols unique
  percpu: make percpu symbols in ia64 unique
  percpu: make percpu symbols in powerpc unique
  percpu: make percpu symbols in x86 unique
  percpu: make percpu symbols in xen unique
  percpu: make percpu symbols in cpufreq unique
  percpu: make percpu symbols in oprofile unique
  percpu: make percpu symbols in tracer unique
  percpu: make percpu symbols under kernel/ and mm/ unique
  percpu: remove some sparse warnings
  percpu: make alloc_percpu() handle array types
  vmalloc: fix use of non-existent percpu variable in put_cpu_var()
  this_cpu: Use this_cpu_xx in trace_functions_graph.c
  this_cpu: Use this_cpu_xx for ftrace
  this_cpu: Use this_cpu_xx in nmi handling
  this_cpu: Use this_cpu operations in RCU
  this_cpu: Use this_cpu ops for VM statistics
  ...

Fix up trivial (famous last words) global per-cpu naming conflicts in
arch/x86/kvm/svm.c
mm/slab.c

14 years agoDocumentation: rw_lock lessons learned
William Allen Simpson [Sun, 13 Dec 2009 20:12:46 +0000 (15:12 -0500)]
Documentation: rw_lock lessons learned

In recent months, two different network projects erroneously
strayed down the rw_lock path.  Update the Documentation
based upon comments by Eric Dumazet and Paul E. McKenney in
those threads.

Further updates await somebody else with more expertise.

Changes:
  - Merged with extensive content by Stephen Hemminger.
  - Fix one of the comments by Linus Torvalds.

Signed-off-by: William.Allen.Simpson@gmail.com
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 years agomd: add 'recovery_start' per-device sysfs attribute
Dan Williams [Sun, 13 Dec 2009 04:17:12 +0000 (21:17 -0700)]
md: add 'recovery_start' per-device sysfs attribute

Enable external metadata arrays to manage rebuild checkpointing via a
md/dev-XXX/recovery_start attribute which reflects rdev->recovery_offset

Also update resync_start_store to allow 'none' to be written, for
consistency.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: rcu_read_lock() walk of mddev->disks in md_do_sync()
Dan Williams [Sun, 13 Dec 2009 04:17:06 +0000 (21:17 -0700)]
md: rcu_read_lock() walk of mddev->disks in md_do_sync()

Other walks of this list are either under rcu_read_lock() or the list
mutation lock (mddev_lock()).  This protects against the improbable case of a
disk being removed from the array at the start of md_do_sync().

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
14 years agomd: integrate spares into array at earliest opportunity.
NeilBrown [Mon, 14 Dec 2009 01:50:06 +0000 (12:50 +1100)]
md: integrate spares into array at earliest opportunity.

As v1.x metadata can record that a member of the array is
not completely recovered, it make sense to record that a
spare has become a regular member of the array at the earliest
opportunity.
So remove the tests on "recovery_offset > 0" in super_1_sync
as they really aren't needed, and schedule a metadata update
immediately after adding spares to a degraded array.

This means that if a crash happens immediately after a recovery
starts, the new device will be included in the array and recovery will
continue from wherever it was up to.  Previously this didn't happen
unless recovery was at least 1/16 of the way through.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: move compat_ioctl handling into md.c
Arnd Bergmann [Mon, 14 Dec 2009 01:50:05 +0000 (12:50 +1100)]
md: move compat_ioctl handling into md.c

The RAID ioctls are only implemented in md.c, so the
handling for them should also be moved there from
fs/compat_ioctl.c.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Neil Brown <neilb@suse.de>
Cc: Andre Noll <maan@systemlinux.org>
Cc: linux-raid@vger.kernel.org
Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: revise Kconfig help for MD_MULTIPATH
NeilBrown [Mon, 14 Dec 2009 01:49:59 +0000 (12:49 +1100)]
md: revise Kconfig help for MD_MULTIPATH

Make it clear in the config message that MD_MULTIPATH is not under
active development.

Cc: Oren Held <orenhe@il.ibm.com>
Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: add MODULE_DESCRIPTION for all md related modules.
NeilBrown [Mon, 14 Dec 2009 01:49:58 +0000 (12:49 +1100)]
md: add MODULE_DESCRIPTION for all md related modules.

Suggested by  Oren Held <orenhe@il.ibm.com>

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agoraid: improve MD/raid10 handling of correctable read errors.
Robert Becker [Mon, 14 Dec 2009 01:49:58 +0000 (12:49 +1100)]
raid: improve MD/raid10 handling of correctable read errors.

We've noticed severe lasting performance degradation of our raid
arrays when we have drives that yield large amounts of media errors.
The raid10 module will queue each failed read for retry, and also
will attempt call fix_read_error() to perform the read recovery.
Read recovery is performed while the array is frozen, so repeated
recovery attempts can degrade the performance of the array for
extended periods of time.

With this patch I propose adding a per md device max number of
corrected read attempts.  Each rdev will maintain a count of
read correction attempts in the rdev->read_errors field (not
used currently for raid10). When we enter fix_read_error()
we'll check to see when the last read error occurred, and
divide the read error count by 2 for every hour since the
last read error. If at that point our read error count
exceeds the read error threshold, we'll fail the raid device.

In addition in this patch I add sysfs nodes (get/set) for
the per md max_read_errors attribute, the rdev->read_errors
attribute, and added some printk's to indicate when
fix_read_error fails to repair an rdev.

For testing I used debugfs->fail_make_request to inject
IO errors to the rdev while doing IO to the raid array.

Signed-off-by: Robert Becker <Rob.Becker@riverbed.com>
Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd/raid10: print more useful messages on device failure.
Robert Becker [Mon, 14 Dec 2009 01:49:57 +0000 (12:49 +1100)]
md/raid10: print more useful messages on device failure.

When we get a read error on a device in a RAID10, and attempting to
repair the error fails, print more useful messages about why it
failed.

Signed-off-by: Robert Becker <Rob.Becker@riverbed.com>
Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd/bitmap: update dirty flag when bitmap bits are explicitly set.
NeilBrown [Mon, 14 Dec 2009 01:49:56 +0000 (12:49 +1100)]
md/bitmap: update dirty flag when bitmap bits are explicitly set.

There is a sysfs file which allows bits in the write-intent
bitmap to be explicit set - indicating that the block is thought
to be 'dirty'.
When this happens we should really set recovery_cp backwards
to include the block to reflect this dirtiness.

In particular, a 'resync' process will refuse to start if
recovery_cp is beyond the end of the array, so this is needed
to allow a resync to be triggered.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: Support write-intent bitmaps with externally managed metadata.
NeilBrown [Mon, 14 Dec 2009 01:49:56 +0000 (12:49 +1100)]
md: Support write-intent bitmaps with externally managed metadata.

In this case, the metadata needs to not be in the same
sector as the bitmap.
md will not read/write any bitmap metadata.  Config must be
done via sysfs and when a recovery makes the array non-degraded
again, writing 'true' to 'bitmap/can_clear' will allow bits in
the bitmap to be cleared again.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd/bitmap: move setting of daemon_lastrun out of bitmap_read_sb
NeilBrown [Mon, 14 Dec 2009 01:49:56 +0000 (12:49 +1100)]
md/bitmap: move setting of daemon_lastrun out of bitmap_read_sb

Setting daemon_lastrun really has nothing to do with reading
the bitmap superblock, it just happens to be needed at the same time.
bitmap_read_sb is about to become options, so move that code out
to after the call to bitmap_read_sb.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: support updating bitmap parameters via sysfs.
NeilBrown [Mon, 14 Dec 2009 01:49:55 +0000 (12:49 +1100)]
md: support updating bitmap parameters via sysfs.

A new attribute directory 'bitmap' in 'md' is created which
contains files for configuring the bitmap.
'location' identifies where the bitmap is, either 'none',
or 'file' or 'sector offset from metadata'.
Writing 'location' can create or remove a bitmap.
Adding a 'file' bitmap this way is not yet supported.
'chunksize' and 'time_base' must be set before 'location'
can be set.

'chunksize' can be set before creating a bitmap, but is
currently always over-ridden by the bitmap superblock.

'time_base' and 'backlog' can be updated at any time.

Signed-off-by: NeilBrown <neilb@suse.de>
Reviewed-by: Andre Noll <maan@systemlinux.org>
14 years agomd: factor out parsing of fixed-point numbers
NeilBrown [Mon, 14 Dec 2009 01:49:55 +0000 (12:49 +1100)]
md: factor out parsing of fixed-point numbers

safe_delay_store can parse fixed point numbers (for fractions
of a second).  We will want to do that for another sysfs
file soon, so factor out the code.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: support bitmap offset appropriate for external-metadata arrays.
NeilBrown [Mon, 14 Dec 2009 01:49:54 +0000 (12:49 +1100)]
md: support bitmap offset appropriate for external-metadata arrays.

For md arrays were metadata is managed externally, the kernel does not
know about a superblock so the superblock offset is 0.
If we want to have a write-intent-bitmap near the end of the
devices of such an array, we should support sector_t sized offset.
We need offset be possibly negative for when the bitmap is before
the metadata, so use loff_t instead.

Also add sanity check that bitmap does not overlap with data.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: remove needless setting of thread->timeout in raid10_quiesce
NeilBrown [Mon, 14 Dec 2009 01:49:54 +0000 (12:49 +1100)]
md: remove needless setting of thread->timeout in raid10_quiesce

As bitmap_create and bitmap_destroy already set thread->timeout
as appropriate, there is no need to do it in raid10_quiesce.
There is a possible need to wake the thread after the timeout
has been set low, but it is better to do that where the timeout
is actually set low, in bitmap_create.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: change daemon_sleep to be in 'jiffies' rather than 'seconds'.
NeilBrown [Mon, 14 Dec 2009 01:49:53 +0000 (12:49 +1100)]
md: change daemon_sleep to be in 'jiffies' rather than 'seconds'.

This removes a lot of multiplications by HZ.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: move offset, daemon_sleep and chunksize out of bitmap structure
NeilBrown [Mon, 14 Dec 2009 01:49:53 +0000 (12:49 +1100)]
md: move offset, daemon_sleep and chunksize out of bitmap structure

... and into bitmap_info.  These are all configuration parameters
that need to be set before the bitmap is created.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: collect bitmap-specific fields into one structure.
NeilBrown [Mon, 14 Dec 2009 01:49:52 +0000 (12:49 +1100)]
md: collect bitmap-specific fields into one structure.

In preparation for making bitmap fields configurable via sysfs,
start tidying up by making a single structure to contain the
configuration fields.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd/raid1: add takeover support for raid5->raid1
NeilBrown [Mon, 14 Dec 2009 01:49:51 +0000 (12:49 +1100)]
md/raid1: add takeover support for raid5->raid1

A 2-device raid5 array can now be converted to raid1.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd: add honouring of suspend_{lo,hi} to raid1.
NeilBrown [Mon, 14 Dec 2009 01:49:51 +0000 (12:49 +1100)]
md: add honouring of suspend_{lo,hi} to raid1.

This will allow us to stop writeout to portions of the array
while  they are resynced by someone else - e.g. another node in
a cluster.

Signed-off-by: NeilBrown <neilb@suse.de>
14 years agomd/raid5: don't complete make_request on barrier until writes are scheduled
NeilBrown [Mon, 14 Dec 2009 01:49:50 +0000 (12:49 +1100)]
md/raid5: don't complete make_request on barrier until writes are scheduled

The post-barrier-flush is sent by md as soon as make_request on the
barrier write completes.  For raid5, the data might not be in the
per-device queues yet.  So for barrier requests, wait for any
pre-reading to be done so that the request will be in the per-device
queues.

We use the 'preread_active' count to check that nothing is still in
the preread phase, and delay the decrement of this count until after
write requests have been submitted to the underlying devices.

Signed-off-by: NeilBrown <neilb@suse.de>
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>