Lee Jones [Fri, 18 May 2012 08:39:12 +0000 (09:39 +0100)]
mfd: Enable Device Tree support in the ab8500-pwm driver
This patch ensures probing of the ab8500-pwm driver during a DT
enabled boot, so long as the associated nodes are present in the
Device Tree binary.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Lee Jones [Fri, 18 May 2012 08:39:10 +0000 (09:39 +0100)]
mfd: Enable Device Tree support in the ab8500-sysctrl driver
This patch ensures probing of the ab8500-sysctrl driver during a DT
enabled boot, so long as the associated nodes are present in the
Device Tree binary.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Peter Ujfalusi [Wed, 16 May 2012 11:11:58 +0000 (14:11 +0300)]
mfd: Add support for Device Tree to twl6040
Device tree based probing support for the core twl6040 driver. Child
devices will be created as MFD devices:
- ASoC codec is always created
- Vibra child is only created if the vibra section present in the DT blob.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Peter Ujfalusi [Wed, 16 May 2012 11:11:57 +0000 (14:11 +0300)]
mfd: Register the twl6040 child for the ASoC codec unconditionally
The main function of the twl6040 is to provide audio on OMAP4+ platforms.
Since the ASoC codec driver can work without the pdata we can register the
child to load the codec driver whenever the twl6040 MFD driver is loaded.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Peter Ujfalusi [Wed, 16 May 2012 11:11:56 +0000 (14:11 +0300)]
mfd: Allocate twl6040 IRQ numbers dynamically
Use irq_alloc_descs() to get the IRQ number range dynamically instead of
the hardwired use if pdata->irq_base.
The twl6040 only provides interrupts for it's internal components which
means that it is not working as an IRQ expander type of device.
The client drivers will receive their interrupt numbers as resource which
is configured based on the received IRQ range we got from irq_alloc_descs()
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Peter Ujfalusi [Wed, 16 May 2012 11:11:55 +0000 (14:11 +0300)]
mfd: twl6040 code cleanup in interrupt initialization part
No functional change, just to make the code a bit more uniform and
remove wrapped lines.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Lee Jones [Thu, 17 May 2012 13:45:22 +0000 (14:45 +0100)]
mfd: Enable ab8500-gpadc driver for Device Tree
This patch will allow the ab8500-gpadc driver to be probed during
Device Tree enabled boot.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Lee Jones [Thu, 17 May 2012 13:45:20 +0000 (14:45 +0100)]
mfd: Prevent unassigned pointer from being used in ab8500-gpadc driver
Before this patch if probe failed to find the platform IRQ it
would attempt to print a message out using dev_err, which in
turn was being passed an unassigned pointer. This patch
ensures the information passed to dev_err is correct.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Lee Jones [Thu, 17 May 2012 13:45:19 +0000 (14:45 +0100)]
mfd: Enable ab8500-debug when Device Tree is enabled
Allow the ab8500-debugfs driver to be probed during DT start-up.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Lee Jones [Thu, 17 May 2012 13:45:13 +0000 (14:45 +0100)]
mfd: Enable Device Tree for ab8500-core driver
This patch will allow the ab8500-core driver to be probed and set up
when booting when Device Tree is enabled. This includes platform ID
look-up which identifies the machine it is currently running on. If
we are undergoing a DT enabled boot, we will refuse to setup each of
the other ab8500-* devices, as they will be probed individually by DT.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Lee Jones [Sat, 19 May 2012 15:21:37 +0000 (17:21 +0200)]
mfd: Remove confusing ab8500-i2c file and merge into ab8500-core
ab8500-i2c is used as core code to register the ab8500 device.
After allocating ab8500 memory, it immediately calls into
ab8500-core where the real initialisation takes place. This
patch moves all core registration and memory allocation into
the true ab8500-core file and removes ab8500-i2c completely.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Fri, 18 May 2012 11:01:19 +0000 (13:01 +0200)]
mfd: mc13xxx core should not be user visible
Since the core is not usable without one of the bus modules it should not
be presented in the UI but should instead be selected by the bus modules.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Johan Hovold [Tue, 15 May 2012 17:45:40 +0000 (19:45 +0200)]
mfd: Fix double free in wm8350 error path
Fix double free in probe error path introduced by the recent conversion
of wm8350 to use regmap.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Johan Hovold [Tue, 15 May 2012 17:24:53 +0000 (19:24 +0200)]
mfd: Convert lm3533 to use devres
Use devres to manage core driver data and regmap.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Ashish Jangam [Fri, 18 May 2012 10:19:18 +0000 (12:19 +0200)]
mfd: Add ADC support to the DA9052/53 core
This patch adds ADC support to the DA9052/53 core.
Tested on smdkv6410 and i.mx53 QS boards.
Signed-off-by: Ashish Jangam <ashish.jangam@kpitcummins.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Rhyland Klein [Fri, 18 May 2012 09:52:19 +0000 (11:52 +0200)]
mfd: Add tps65910-irq devicetree init and irqdomain support
This change changes the tps65910-irq code to use irqdomain, and support
initialization from devicetree. This assumes that the irq_base in the
platform data is -1 if devicetree is used.
Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Richard Zhao [Sun, 13 May 2012 01:18:02 +0000 (09:18 +0800)]
mfd: Make anatop register accessor more flexible and rename meaningfully
- rename to anatop_read_reg and anatop_write_reg
- anatop_read_reg directly return reg value
- anatop_write_reg write reg with mask
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Reviewed-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Wed, 16 May 2012 08:05:54 +0000 (09:05 +0100)]
mfd: wm8400 needs to depend on I2C=y
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>
Mark Brown [Mon, 14 May 2012 21:14:24 +0000 (23:14 +0200)]
mfd: Convert wm831x to irq_domain
The modern idiom is to use irq_domain to allocate interrupts. This is
useful partly to allow further infrastructure to be based on the domains
and partly because it makes it much easier to allocate virtual interrupts
to devices as we don't need to allocate a contiguous range of interrupt
numbers.
Convert the wm831x driver over to this infrastructure, using a legacy
IRQ mapping if an irq_base is specified in platform data and otherwise
using a linear mapping, always registering the interrupts even if they
won't ever be used. Only boards which need to use the GPIOs as
interrupts should need to use an irq_base.
This means that we can't use the MFD irq_base management since the
unless we're using an explicit irq_base from platform data we can't rely
on a linear mapping of interrupts. Instead we need to map things via
the irq_domain - provide a conveniencem function wm831x_irq() to save a
small amount of typing when doing so. Looking at this I couldn't clearly
see anything the MFD core could do to make this nicer.
Since we're not supporting device tree yet there's no meaningful
advantage if we don't do this conversion in one, the fact that the
interrupt resources are used for repeated IP blocks makes accessor
functions for the irq_domain more trouble to do than they're worth.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Sun, 13 May 2012 20:53:45 +0000 (21:53 +0100)]
mfd: Don't try to flag IRQ 0 as a wm831x wake source
If we've not got a primary IRQ we shouldn't be trying to flag IRQ 0 as a
wake source.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Chanwoo Choi [Mon, 14 May 2012 20:54:20 +0000 (22:54 +0200)]
mfd: Add MAX77693 irq handler
This patch supports IRQ handling for MAX77693.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Chanwoo Choi [Mon, 14 May 2012 20:50:39 +0000 (22:50 +0200)]
mfd: Add MAX77693 driver
This patch adds MFD driver for MAX77693 to enable its sub devices.
The MAX77693 is a multi-function devices. It includes PMIC,
MUIC(Micro USB Interface Controller), flash LED control and
haptic motor control.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Mon, 14 May 2012 09:13:16 +0000 (10:13 +0100)]
mfd: Export wm8400_block_read()
Used by the regulator driver.
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>
Mark Brown [Mon, 14 May 2012 09:13:15 +0000 (10:13 +0100)]
mfd: Don't support non-modular wm8400 build
It's relying on non-exported symbols.
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>
Dan Carpenter [Sat, 12 May 2012 11:01:04 +0000 (14:01 +0300)]
mfd: Silence an lm3533 gcc warning
This is supposed to be umode_t. It causes a GCC warning:
drivers/mfd/lm3533-core.c:440:2: warning: initialization from incompatible pointer type [enabled by default]
drivers/mfd/lm3533-core.c:440:2: warning: (near initialization for ‘lm3533_attribute_group.is_visible’) [enabled by default]
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Laxman Dewangan [Fri, 11 May 2012 16:18:27 +0000 (21:48 +0530)]
gpio: Convert tps65910 to a platform driver
Make the gpio-tps65910 as platform driver and register
this from tps65910 core driver as mfd sub device.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Axel Lin [Fri, 11 May 2012 01:31:29 +0000 (09:31 +0800)]
mfd: Convert pcf50633-core to use devm_* APIs
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Axel Lin [Fri, 11 May 2012 01:29:51 +0000 (09:29 +0800)]
mfd: Convert da9052 to use devm_* APIs
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Wim Van Sebroeck [Thu, 10 May 2012 18:54:32 +0000 (20:54 +0200)]
mfd: Change tunnelcreek watchdog name on the lpc_sch subdevices array
The name of the tunnelcreek watchdog device is not tunnelcreek_wdt but
ie6xx_wdt.
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Axel Lin [Thu, 10 May 2012 15:35:02 +0000 (23:35 +0800)]
mfd: Fix lm3533 regmap_update_bits() call
Current code calls regmap_update_bits() with mask and val arguments swapped.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Johan Hovold [Thu, 10 May 2012 17:18:29 +0000 (19:18 +0200)]
mfd: Use SI-units for the lm3533 max-current interface
Use SI-units (uA) for max-current interface (5000 - 29800 uA).
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Johan Hovold [Thu, 10 May 2012 17:18:28 +0000 (19:18 +0200)]
mfd: Remove unused max-current lm3533 function
The max-current attributes of the subdrivers have been dropped so
remove the no longer used lm3533_ctrlbank_get_max_current function.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Johan Hovold [Thu, 10 May 2012 12:11:29 +0000 (14:11 +0200)]
mfd: Remove lm3533 boost attributes
Remove boost-frequency and ovp attributes, which can be set through
platform data, from sysfs.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Johan Hovold [Thu, 10 May 2012 12:11:28 +0000 (14:11 +0200)]
mfd: Add boost frequency and ovp to lm3533 platform data
Add boost-frequency and over-voltage-protection settings to platform
data.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Wed, 9 May 2012 21:53:48 +0000 (22:53 +0100)]
mfd: Remove wm8400 custom cache implementation
Save a useful amount of code by removing the custom cache implementation
for wm8400 and using the regmap cache. Also simplify things by not
separately reseting the CODEC registers, this is a sufficiently infrequent
operation that we can simply invalidate the entire cache when this happens.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Wed, 9 May 2012 20:18:05 +0000 (21:18 +0100)]
mfd: Staticise non-exported tps65217_update_bits()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: AnilKumar Ch <anilkumar@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Fri, 11 May 2012 13:10:28 +0000 (15:10 +0200)]
mfd: Fix tps65910 build failure
The tps65910_parse_dt() prototype for !CONFIG_OF was not correct, leading to:
drivers/mfd/tps65910.c: In function ‘tps65910_i2c_probe’:
drivers/mfd/tps65910.c:218:3: error: too many arguments to function ‘tps65910_parse_dt’
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Laxman Dewangan [Fri, 11 May 2012 13:07:44 +0000 (15:07 +0200)]
mfd: Register tps65910 gpios as an mfd device
As gpio support for tps65910 is on gpio driver, registering
gpio support as the mfd sub devices instead of calling gpio_init()
from the core probe.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Laxman Dewangan [Fri, 11 May 2012 10:36:57 +0000 (12:36 +0200)]
mfd: Convert all tps65910 allocation to devm_*
Convert memory allocation and regmap initialization to
use devm_* functions.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Laxman Dewangan [Wed, 9 May 2012 13:10:54 +0000 (18:40 +0530)]
mfd: Cache tps65910 register when we need it
During regmap initialization, we do not provide the default value and
hence in place of caching register during regmap_init(), cache it
when actually we need it i.e. after reading of that register.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NeilBrown [Tue, 8 May 2012 19:43:59 +0000 (05:43 +1000)]
mfd: Define all twl-regulator feature flags in one place
twl-regulator has a collection of feature flags, some defined
in twl-core.c and one defined in i2c/twl.h.
This is confusing for anyone adding a new feature flag.
So collect them together and place them in twl.h immediately
after the structure in which they are initially set.
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Rhyland Klein [Fri, 11 May 2012 09:36:26 +0000 (11:36 +0200)]
mfd: Add tps65910 device-tree support
Add device tree based initialization support for TI's tps65910 pmic.
Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Rhyland Klein [Tue, 8 May 2012 18:42:39 +0000 (11:42 -0700)]
mfd: Add tps65910 device tree bindings documentation
Add device tree bindings for TI's tps65910 pmic.
Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Rhyland Klein [Tue, 8 May 2012 18:42:38 +0000 (11:42 -0700)]
mfd: Commonize tps65910 regmap access through header
This change removes the read/write callback functions in favor of common
regmap accessors inside the header file. This change also makes use of
regmap_read/write for single register access which maps better onto what this
driver actually needs.
Signed-off-by: Rhyland Klein <rklein@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Michel JAOUEN [Mon, 7 May 2012 13:02:03 +0000 (15:02 +0200)]
mfd: Support of hierachical interrupt for ab8500
Hierarchical interrupt is supported since ab8500 V2.
However, it is not implemented in the ab8500-core driver.
With the current implementation, when an ab9540 interrupt
occurs, 17 Latch registers are read through i2c. With
hierarchical interrupt implementation, there are only 4 i2c
accesses.
Signed-off-by: Maxime Coquelin <maxime.coquelin@stericsson.com>
Reviewed-by: Michel Jaouen <michel.jaouen@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Peter Ujfalusi [Wed, 2 May 2012 13:54:42 +0000 (16:54 +0300)]
mfd: Add regulator support for twl6040 VIO, V2V1 supplies
twl6040 has three power supply source:
VBAT needs to be connected to VBAT, VIO, and V2V1.
Add regulator support for the VIO, V2V1 supplies.
Initially handle the two supply together with bulk commands.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
NeilBrown [Wed, 25 Apr 2012 03:05:24 +0000 (13:05 +1000)]
mfd: enable wakeup on twl4030 IRQ.
Most of the interrupts that come through this line should trigger
wakeups:
power button
RTC alarm
power available
usb plug/unplug
so mark the interrupt as a wakeup interrupt.
This is particularly important for when the interrupt arrives during
the late suspend phase. Without this setting it will be ignored.
Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Axel Lin [Wed, 25 Apr 2012 02:09:46 +0000 (10:09 +0800)]
mfd: Convert twl6040-core to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Axel Lin [Wed, 25 Apr 2012 02:06:40 +0000 (10:06 +0800)]
mfd: Convert tps65217 to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Axel Lin [Wed, 25 Apr 2012 02:04:58 +0000 (10:04 +0800)]
mfd: Convert tps65090 to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Axel Lin [Wed, 25 Apr 2012 02:03:44 +0000 (10:03 +0800)]
mfd: Convert s5m-core to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Axel Lin [Wed, 25 Apr 2012 02:01:55 +0000 (10:01 +0800)]
mfd: Convert rc5t583 to devm_regmap_init_i2c()
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Axel Lin [Wed, 25 Apr 2012 01:30:36 +0000 (09:30 +0800)]
mfd: Return proper error if tps65090 regmap_init_i2c fails
Return proper error instead of 0 if regmap_init_i2c fails.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Linus Walleij [Mon, 23 Apr 2012 12:28:44 +0000 (14:28 +0200)]
mfd: Allow for const stmpe keyboard data
Since it's not like we will re-arrange the keys at run-time, it
seems proper to allow the keymap data to be const. This solves
a compilation warning in ux500.
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Aaron Sierra [Fri, 20 Apr 2012 19:14:11 +0000 (14:14 -0500)]
watchdog: Convert iTCO_wdt driver to mfd model
This patch converts the iTCO_wdt driver to use the multi-function device
driver model. It uses resources discovered by the lpc_ich driver, so that
it no longer does its own PCI scanning.
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Johan Hovold [Thu, 3 May 2012 10:26:36 +0000 (12:26 +0200)]
mfd: Add LM3533 lighting-power core driver
Add support for National Semiconductor / TI LM3533 lighting power chips.
This is the core driver which provides register access over I2C and
registers the ambient-light-sensor, LED and backlight sub-drivers.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Lee Jones [Fri, 4 May 2012 18:23:20 +0000 (19:23 +0100)]
mfd: Add support for db8500-prcmu regulator supply for nmk-i2c.4
This applies a supply alias for the db8500's fifth Nomadik i2c port.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Lee Jones [Wed, 9 May 2012 15:19:25 +0000 (17:19 +0200)]
mfd: Enable Device Tree support for the db8500-prcmu
This patch will enable probing to occur during a Device Tree enabled
boot. The IRQ base is expected to be located in and will be fetched
from the DT itself. We also prevent any of the db8500 regulators
from being registered here, as they will be enabled via DT instead.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Lee Jones [Thu, 19 Apr 2012 20:36:41 +0000 (21:36 +0100)]
mfd: Register db8500-prcmu as a platform driver instead of only probing
Pass the probe function as part of the platform_driver struct and
register using the more common platform_driver_register call. In
subsequent patches we'll also add DT support into the struct.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Olof Johansson [Sat, 5 May 2012 23:02:48 +0000 (16:02 -0700)]
mfd: Fix of_match_node() da9052 arguments
The driver calls of_match_node() with the arguments swapped.
Signed-off-by: Olof Johansson <olof@lixom.net>
Tested-by: Ying-Chun Liu <paul.liu@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Seth Heasley [Tue, 17 Apr 2012 21:09:22 +0000 (14:09 -0700)]
lpc_sch: Add Intel Centerton Multifunction Device support
This patch adds the Intel Centerton processor DeviceID for the
Integrated Legacy Block (ILB).
The ILB provides GPIO, SMBus, and Watchdog functionality.
Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Seth Heasley [Mon, 23 Apr 2012 16:23:56 +0000 (09:23 -0700)]
pci_ids: Add Intel Centerton Legacy Block DeviceID
This patch adds the Integrated Legacy Block DeviceID for the Centerton CPU. It will be used in the GPIO and Multifunction Devices driver.
Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Alessandro Rubini [Thu, 12 Apr 2012 08:48:55 +0000 (10:48 +0200)]
gpio: Add STA2X11 GPIO block
This introduces 128 gpio bits (for each PCI device installed) with
working interrupt support.
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Alessandro Rubini [Thu, 12 Apr 2012 08:48:44 +0000 (10:48 +0200)]
mfd: Add driver for STA2X11 MFD block
This also introduces <asm/sta2x11.h> to export a function that is in
the base sta2x11 support patches. The header will increase with other
prototypes and constants over time.
Signed-off-by: Alessandro Rubini <rubini@gnudd.com>
Acked-by: Giancarlo Asnaghi <giancarlo.asnaghi@st.com>
Cc: Alan Cox <alan@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Mon, 7 May 2012 09:03:23 +0000 (10:03 +0100)]
mfd: Convert wm8994 to module_i2c_driver()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Mon, 7 May 2012 09:03:22 +0000 (10:03 +0100)]
mfd: Read CUST_ID from the wm8994 device
Read CUST_ID from the device and log it for diagnostics.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Mon, 7 May 2012 09:03:21 +0000 (10:03 +0100)]
mfd: Convert wm8350 physical I/O to regmap API
The driver still uses a custom cache implementation but the underlying
physical I/O is now done using the regmap API, saving some code and
avoiding allocating enormous scratch arrays on the stack.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Mon, 7 May 2012 09:03:20 +0000 (10:03 +0100)]
mfd: Fix wm831x register range passing for recent ARM updates
The removal of mach/io.h from most ARM platforms also set the range of
valid IO ports to be empty for most platforms when previously any 32
bit integer had been valid. This makes it impossible to add IO resources
as the added range is smaller than that of the root resource for IO ports.
Since we're not really using IO memory at all fix this by defining our
own root resource outside the normal tree and make that the parent of
all IO resources. This also ensures we won't conflict with read IO ports
if we ever run on a platform which happens to use them.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Mon, 7 May 2012 09:03:19 +0000 (10:03 +0100)]
mfd: Fix tps65910 section annotations
A warning was being generated by the reference from tps65910_i2c_probe()
to tps65910_sleepinit() since the latter was annotated as __init but the
former was unannotated. Since these functions can only be called during
device init make them both __devinit, and while we're at it also annotate
tps65910_i2c_remove() __devexit for symmetry.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Mon, 7 May 2012 09:03:18 +0000 (10:03 +0100)]
mfd: Don't use I2C-specific suspend and resume operations for tps65090
The legacy suspend operations have been deprecated and printing warnings
on boot for over a year now.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Mon, 7 May 2012 09:03:17 +0000 (10:03 +0100)]
mfd: Fix tps65090 ifdefs for suspend mode
CONFIG_PM also covers runtime only PM.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Rickard Andersson [Tue, 17 Apr 2012 07:30:57 +0000 (09:30 +0200)]
mfd: Add parameter to disable ab8500 battery management
This patch makes it possible to disable battery management
via a module boot parameter. When 'ab8500-core.no_bm=1' then
ab8500_btemp, ab8500_chargalg, ab8500_charger and ab8500_fg will
not be probed. This boot parameter is used for scripted testing
of the system.
Signed-off-by: Rickard Andersson <rickard.andersson@stericsson.com>
Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Jonas Aaberg [Tue, 17 Apr 2012 07:30:33 +0000 (09:30 +0200)]
mfd: Deny ab8500 suspend if i2c transfer is ongoing
If we are in the middle of an I2C transfer we need to deny suspend
of the AB8500 core. Implement an atomic reference counter for the
I2C operations to make sure we don't do this.
Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Reviewed-by: Mattias Wallin <mattias.wallin@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Rabin Vincent [Tue, 17 Apr 2012 07:30:24 +0000 (09:30 +0200)]
mfd: Handle the ab8500 irq for suspend/resume
Ensure that the AB interrupt is only handled at a time when
all core drivers are resumed. Ensure that the AB interrupt
is marked as a wakeup interrupt.
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Reviewed-by: Jonas Aberg <jonas.aberg@stericsson.com>
Reviewed-by: Mattias Wallin <mattias.wallin@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Virupax Sadashivpetimath [Tue, 17 Apr 2012 07:30:14 +0000 (09:30 +0200)]
mfd: Add new resources on ab8500 AB8505 and AB9540
The AB8505 and AB9540 has extended support for micro USB
resistance detection, used for detecting chargers. Let's
register resources for this resource. Let's also split off the
separate codec device for AB9540.
Signed-off-by: Virupax Sadashivpetimath <virupax.sadashivpetimath@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Marc Reilly [Sun, 1 Apr 2012 06:41:39 +0000 (16:41 +1000)]
mfd: Add mc13xxx i2c driver
Adds support for mc13xxx family ICs connected via i2c.
Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Acked-by: Oskar Schirmer <oskar@scara.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Marc Reilly [Sun, 1 Apr 2012 06:41:38 +0000 (16:41 +1000)]
mfd: Move the mc13xxx-core spi specific code into a separate module
All spi specific code is moved into a new module. The mc13xxx struct
moves to a new local include file by necessity.
A new config choice selects the SPI bus type support and by default is
value of SPI_MASTER to remain compatible with existing configs.
Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Marc Reilly [Sun, 1 Apr 2012 06:41:37 +0000 (16:41 +1000)]
mfd: Use regmap for the mc13xxx-core register access
This change converts the mc13xxx core to use regmap rather than direct
spi r/w.
The spidev member of mc13xxx struct becomes redundant and is removed.
Extra debugging aids are added to mc13xxx_reg_rmw.
Mutex init is moved to before regmap init.
Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Marc Reilly [Tue, 1 May 2012 10:26:46 +0000 (12:26 +0200)]
mfd: Prepare for separating spi and i2c mc13xxx-core backends
This patch abstracts the bus specific operations from the driver core.
Generic init and cleanup is consolidated into mc13xxx_common_*.
spi specific functions are renamed to reflect such.
(The irq member of the mc13xxx struct is no longer redundant, it's used
to store the irq for cleanup time).
Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Russ Dill [Sun, 22 Apr 2012 08:48:18 +0000 (01:48 -0700)]
mfd: Fix build breakage in omap-usb-host.c
'ARM: OMAP3: USB: Fix the EHCI ULPI PHY reset issue' removes the include for
linux/gpio.h from omap-usb-host.c. This include indirectly includes plat/cpu.h
which is required by omap-usb-host.c. Fix the build breakage by including
it directly.
Acked-by: Keshava Munegowda <keshava_mgowda@ti.com>
Acked-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Samuel Ortiz [Mon, 16 Apr 2012 19:28:29 +0000 (21:28 +0200)]
mfd: No need to check for the GPIO offset from asic3_gpio_to_irq
The gpiolib code will only call our gpio_to_irq ops for our registered
GPIO range.
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Laxman Dewangan [Wed, 18 Apr 2012 10:13:51 +0000 (12:13 +0200)]
mfd: Add support for tps65910 device sleep
Adding support for device sleep through the external input control
signal "SLEEP".
Changing the SLEEP signal state can switch the device into SLEEP and
ACTIVE state.
Also adding sleep configuration for different resources so that they
should be keep on during sleep state of device.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Ying-Chun Liu (PaulLiu) [Sun, 15 Apr 2012 16:01:50 +0000 (00:01 +0800)]
mfd: Add device-tree support for da9502 i2c driver
This patch adds device-tree support for dialog MFD and the binding
documentations.
Signed-off-by: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Ashish Jangam <ashish.jangam@kpitcummins.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Pasi Savanainen [Thu, 12 Apr 2012 09:40:37 +0000 (12:40 +0300)]
mfd: Convert Intel MSIC driver to use devm_* interfaces.
The devm_* functions eliminate the need for manual resource releasing
and simplify error handling. Resources allocated by devm_* are freed
automatically on driver detach.
Signed-off-by: Pasi Savanainen <ext-pasi.m.savanainen@gmail.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Paul Parsons [Tue, 10 Apr 2012 23:35:34 +0000 (00:35 +0100)]
mfd: Avoid unbalanced asic3 irq wakeup enables/disables
The mfd/asic3 driver does not currently define a irq_set_wake() handler.
Consequently any attempt to configure the 3 ASIC3 GPIO buttons - RECORD,
CALENDAR, HOME - as wakeup sources results in Unbalanced IRQ warnings
when the system is woken from sleep mode:
WARNING: at kernel/irq/manage.c:520 irq_set_irq_wake+0xc4/0xf8()
Unbalanced IRQ 342 wake disable
...
WARNING: at kernel/irq/manage.c:520 irq_set_irq_wake+0xc4/0xf8()
Unbalanced IRQ 337 wake disable
...
WARNING: at kernel/irq/manage.c:520 irq_set_irq_wake+0xc4/0xf8()
Unbalanced IRQ 339 wake disable
...
This patch adds a irq_set_wake() handler to the mfd/asic3 driver.
Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Cc: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Lars-Peter Clausen [Tue, 10 Apr 2012 20:51:28 +0000 (22:51 +0200)]
mfd: Remove redundant spi driver bus initialization
In ancient times it was necessary to manually initialize the bus field of an
spi_driver to spi_bus_type. These days this is done in spi_driver_register() so
we can drop the manual assignment.
The patch was generated using the following coccinelle semantic patch:
// <smpl>
@@
identifier _driver;
@@
struct spi_driver _driver = {
.driver = {
- .bus = &spi_bus_type,
},
};
// </smpl>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Paul Parsons [Mon, 9 Apr 2012 12:18:31 +0000 (13:18 +0100)]
mfd: Set asic3 DS1WM clock_rate
The mfd/asic3 driver does not set the ds1wm_driver_data clock_rate field
before passing the structure to the DS1WM w1 busmaster driver.
This was not noticed before commit
26a6afb, because ds1wm_find_divisor()
unintentionally returned the correct divisor when a zero clock_rate was
passed in. However after that commit DS1WM fails a zero clock_rate:
ds1wm ds1wm: no suitable divisor for 0Hz clock
This patch sets the ds1wm_driver_data clock_rate field.
Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Acked-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Laxman Dewangan [Mon, 9 Apr 2012 08:25:55 +0000 (13:55 +0530)]
mfd: Add rc5t583's gpio in mfd device list
Adding the gpio of RC583 in the list of rc583 mfd devices
to register the gpio driver of RC5T583.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Paul Parsons [Thu, 5 Apr 2012 16:45:04 +0000 (17:45 +0100)]
mfd: Add PCMCIA/CF support to asic3
This patch is part of a set which adds PCMCIA/CF support for the hx4700.
This patch adds asic3_set_register() calls to:
1. Enable the PCMCIA/CF in asic3_probe().
2. Disable the PCMCIA/CF in asic3_remove().
Signed-off-by: Paul Parsons <lost.distance@yahoo.com>
Acked-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Mark Brown [Thu, 5 Apr 2012 14:16:56 +0000 (15:16 +0100)]
mfd: Cache wm8994 chip revision
There's no need to mark the chip revision registers as volatile, it won't
change at runtime so we can cache it from the device at startup.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Axel Lin [Tue, 3 Apr 2012 01:09:19 +0000 (09:09 +0800)]
mfd: Use module_pci_driver
This patch converts the drivers in drivers/mfd/* to use module_pci_driver()
macro which makes the code smaller and a bit simpler.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Andres Salomon <dilinger@queued.net>
Cc: Ira W. Snyder <iws@ovro.caltech.edu>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Denis Turischev <denis@compulab.co.il>
Cc: Harald Welte <HaraldWelte@viatech.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Peter Tyser [Wed, 18 Apr 2012 14:48:24 +0000 (09:48 -0500)]
gpio: Add support for Intel ICHx/3100/Series[56] GPIO
This driver works on many Intel chipsets, including the ICH6, ICH7,
ICH8, ICH9, ICH10, 3100, Series 5/3400 (Ibex Peak), Series 6/C200
(Cougar Point), and NM10 (Tiger Point).
Additional Intel chipsets should be easily supported if needed, eg the
ICH1-5, EP80579, etc.
Tested on QM67 (Cougar Point), QM57 (Ibex Peak), 3100 (Whitmore Lake),
and NM10 (Tiger Point).
Includes work from Jean Delvare:
- Resource leak removal during module load/unload
- GPIO API bit value enforcement
Also includes code cleanup from Guenter Roeck and Grant Likely.
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Aaron Sierra [Wed, 28 Mar 2012 14:43:10 +0000 (09:43 -0500)]
mfd: Add LPC driver for Intel ICH chipsets
This driver currently creates resources for use by a forthcoming ICH
chipset GPIO driver. It could be expanded to create the resources for
converting the esb2rom (mtd) and iTCO_wdt (wdt), and potentially more,
drivers to use the mfd model.
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Uwe Kleine-König [Fri, 30 Mar 2012 20:04:56 +0000 (22:04 +0200)]
mfd: Mark const init data with __initconst instead of __initdata for ab5500
As long as there is no other non-const variable marked __initdata in the
same compilation unit it doesn't hurt. If there were one however
compilation would fail with
error: $variablename causes a section type conflict
because a section containing const variables is marked read only and so
cannot contain non-const variables.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Linus Torvalds [Sun, 29 Apr 2012 22:19:10 +0000 (15:19 -0700)]
Linux 3.4-rc5
Linus Torvalds [Sun, 29 Apr 2012 22:00:44 +0000 (15:00 -0700)]
Merge tag 'pm-for-3.4-rc5' of git://git./linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael J. Wysocki:
"Fix for an issue causing hibernation to hang on systems with highmem
(that practically means i386) due to broken memory management (bug
introduced in 3.2, so -stable material) and PM documentation update
making the freezer documentation follow the code again after some
recent updates."
* tag 'pm-for-3.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
PM / Freezer / Docs: Update documentation about freezing of tasks
PM / Hibernate: fix the number of pages used for hibernate/thaw buffering
Linus Torvalds [Sun, 29 Apr 2012 20:30:08 +0000 (13:30 -0700)]
autofs: make the autofsv5 packet file descriptor use a packetized pipe
The autofs packet size has had a very unfortunate size problem on x86:
because the alignment of 'u64' differs in 32-bit and 64-bit modes, and
because the packet data was not 8-byte aligned, the size of the autofsv5
packet structure differed between 32-bit and 64-bit modes despite
looking otherwise identical (300 vs 304 bytes respectively).
We first fixed that up by making the 64-bit compat mode know about this
problem in commit
a32744d4abae ("autofs: work around unhappy compat
problem on x86-64"), and that made a 32-bit 'systemd' work happily on a
64-bit kernel because everything then worked the same way as on a 32-bit
kernel.
But it turned out that 'automount' had actually known and worked around
this problem in user space, so fixing the kernel to do the proper 32-bit
compatibility handling actually *broke* 32-bit automount on a 64-bit
kernel, because it knew that the packet sizes were wrong and expected
those incorrect sizes.
As a result, we ended up reverting that compatibility mode fix, and
thus breaking systemd again, in commit
fcbf94b9dedd.
With both automount and systemd doing a single read() system call, and
verifying that they get *exactly* the size they expect but using
different sizes, it seemed that fixing one of them inevitably seemed to
break the other. At one point, a patch I seriously considered applying
from Michael Tokarev did a "strcmp()" to see if it was automount that
was doing the operation. Ugly, ugly.
However, a prettier solution exists now thanks to the packetized pipe
mode. By marking the communication pipe as being packetized (by simply
setting the O_DIRECT flag), we can always just write the bigger packet
size, and if user-space does a smaller read, it will just get that
partial end result and the extra alignment padding will simply be thrown
away.
This makes both automount and systemd happy, since they now get the size
they asked for, and the kernel side of autofs simply no longer needs to
care - it could pad out the packet arbitrarily.
Of course, if there is some *other* user of autofs (please, please,
please tell me it ain't so - and we haven't heard of any) that tries to
read the packets with multiple writes, that other user will now be
broken - the whole point of the packetized mode is that one system call
gets exactly one packet, and you cannot read a packet in pieces.
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: David Miller <davem@davemloft.net>
Cc: Ian Kent <raven@themaw.net>
Cc: Thomas Meyer <thomas@m3y3r.de>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Marcos Paulo de Souza [Sun, 29 Apr 2012 20:29:30 +0000 (22:29 +0200)]
PM / Freezer / Docs: Update documentation about freezing of tasks
The file Documentation/power/freezing-of-tasks.txt was still referencing
the TIF_FREEZE flag, that was removed by the commit
d88e4cb67197d007fb778d62fe17360e970d5bfa(freezer: remove now unused
TIF_FREEZE).
This patch removes all the references of TIF_FREEZE that were left
behind.
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Linus Torvalds [Sun, 29 Apr 2012 20:12:42 +0000 (13:12 -0700)]
pipes: add a "packetized pipe" mode for writing
The actual internal pipe implementation is already really about
individual packets (called "pipe buffers"), and this simply exposes that
as a special packetized mode.
When we are in the packetized mode (marked by O_DIRECT as suggested by
Alan Cox), a write() on a pipe will not merge the new data with previous
writes, so each write will get a pipe buffer of its own. The pipe
buffer is then marked with the PIPE_BUF_FLAG_PACKET flag, which in turn
will tell the reader side to break the read at that boundary (and throw
away any partial packet contents that do not fit in the read buffer).
End result: as long as you do writes less than PIPE_BUF in size (so that
the pipe doesn't have to split them up), you can now treat the pipe as a
packet interface, where each read() system call will read one packet at
a time. You can just use a sufficiently big read buffer (PIPE_BUF is
sufficient, since bigger than that doesn't guarantee atomicity anyway),
and the return value of the read() will naturally give you the size of
the packet.
NOTE! We do not support zero-sized packets, and zero-sized reads and
writes to a pipe continue to be no-ops. Also note that big packets will
currently be split at write time, but that the size at which that
happens is not really specified (except that it's bigger than PIPE_BUF).
Currently that limit is the system page size, but we might want to
explicitly support bigger packets some day.
The main user for this is going to be the autofs packet interface,
allowing us to stop having to care so deeply about exact packet sizes
(which have had bugs with 32/64-bit compatibility modes). But user
space can create packetized pipes with "pipe2(fd, O_DIRECT)", which will
fail with an EINVAL on kernels that do not support this interface.
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: David Miller <davem@davemloft.net>
Cc: Ian Kent <raven@themaw.net>
Cc: Thomas Meyer <thomas@m3y3r.de>
Cc: stable@kernel.org # needed for systemd/autofs interaction fix
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Sun, 29 Apr 2012 19:19:13 +0000 (12:19 -0700)]
Merge tag 'staging-3.4-rc4' of git://git./linux/kernel/git/gregkh/staging
Pull staging tree fixes from Greg Kroah-Hartman:
"Here are some tiny drivers/staging/ bugfixes. Some build fixes that
were recently reported, as well as one kfree bug that is hitting a
number of users."
* tag 'staging-3.4-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
staging: ozwpan: Fix bug where kfree is called twice.
staging: octeon-ethernet: fix build errors by including interrupt.h
staging: zcache: fix Kconfig crypto dependency
staging: tidspbridge: remove usage of OMAP2_L4_IO_ADDRESS