Michael Welling [Mon, 28 Jul 2014 23:01:04 +0000 (18:01 -0500)]
mfd: omap-usb-host: Fix improper mask use.
single-ulpi-bypass is a flag used for older OMAP3 silicon.
The flag when set, can excite code that improperly uses the
OMAP_UHH_HOSTCONFIG_UPLI_BYPASS define to clear the corresponding bit.
Instead it clears all of the other bits disabling all of the ports in
the process.
Cc: stable@vger.kernel.org Signed-off-by: Michael Welling <mwelling@emacinc.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Charles Keepax [Tue, 15 Jul 2014 10:21:50 +0000 (11:21 +0100)]
mfd: arizona: Only free the CTRLIF_ERR IRQ if we requested it
We only request the control interface error IRQ if we set ctrlif_error,
as such we should only free it in that situation. Otherwise we will
attempt to free an IRQ we never requested and get a warning from the IRQ
core.
This patch moves the ctrlif_error variable into the arizona structure
and checks it in all cases we free the control interface error IRQ.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Charles Keepax [Tue, 15 Jul 2014 10:21:48 +0000 (11:21 +0100)]
mfd: wm5110: Add new interrupt register definitions
Newer versions of the IP have a lot of new interrupts and move several
existing interrupts. This patch adds the register definitions and regmap
hookup for these interrupts.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Charles Keepax [Tue, 15 Jul 2014 10:21:47 +0000 (11:21 +0100)]
mfd: arizona: Rename thermal shutdown interrupt
Newer versions of the IP introduce short circuit protection which will
also shutdown the speaker. Rename the interrupt and associated register
bits associated with thermal events to better fit the function and avoid
conflict with future interrupt additions.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Add register definitions for DA9063 AD (0x3) silicon variant ID
the ability to choose the silicon variant at run-time using regmap
configuration. This patch also adds RTC support for the AD silicon
changes.
It adds both BB and AD support as regmap ranges and then makes the
distinction between the two tables at run-time. This allows both AD
and BB silicon variants to be supported at the same time.
Suggested-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Opensource [Steve Twiss] <stwiss.opensource@diasemi.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Charles Keepax [Fri, 25 Jul 2014 15:24:44 +0000 (16:24 +0100)]
mfd: arizona: Map MICVDD from extcon device to the Arizona core
The extcon driver should be able to get its regulator against rather
than against the main arizona device, we must add a supply mapping
allowing the regulator to be located. This patch does so.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Maxim MAX77802 is a power management chip that contains 10 high
efficiency Buck regulators, 32 Low-dropout (LDO) regulators used
to power up application processors and peripherals, a 2-channel
32kHz clock outputs, a Real-Time-Clock (RTC) and a I2C interface
to program the individual regulators, clocks outputs and the RTC.
This patch adds support for MAX77802 to the MAX77686 driver and is
based on a driver added to the Chrome OS kernel 3.8 by Simon Glass.
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
mfd: tps6105x: Use managed resources when allocating memory
This patch introduces the use of devm_kzalloc instead of the
corresponding unmanaged version and does away with the kfrees in the
probe and remove functions. Also, a label is done away with.
Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Error checking across the driver is mostly consistent besides
a few exceptions, so change these exceptions for consistency.
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
mfd: max77686: Return correct error when pdata isn't found
When platform data is not found an -EIO (I/O error) code is returned.
This doesn't seem to be the correct error so better return -EINVAL
(Invalid argument) which is what most drivers do in this case.
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Lee Jones <lee.jones@linaro.org>
mfd: max77686: Don't define dummy function if OF isn't enabled
When the CONFIG_OF option was not enabled, a dummy function
max77686_i2c_parse_dt_pdata() was defined since this is called
unconditionally on probe(). Just always define the real function
and conditionally call it if CONFIG_OF is enabled instead.
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Lee Jones <lee.jones@linaro.org>
The driver doesn't have PM operations defined so add a suspend
and resume function handlers to allow the PMIC IRQ to wakeup
the system when it is put into a sleep state.
Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
By using the generic IRQ support in the Register map API, it
is possible to get rid max77686-irq.c and simplify the code.
Suggested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Reviewed-by: Doug Anderson <dianders@chromium.org> Tested-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
mfd: sun6i-prcm: Add support for Allwinner A23 PRCM
The Allwinner A23 SoC has a PRCM unit like the previous A31 SoC.
The differences are the AR100 clock can no longer be modified,
the APB0 clock has different divisors, and some clock gates are
gone.
This patch adds a compatible with a modified subdevice list for
the A23.
Signed-off-by: Chen-Yu Tsai <wens@csie.org> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...
+ printk(KERN_INFO"ab8500 register values:\n");
WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ...
+ printk(KERN_INFO" bank 0x%02X:\n", i);
WARNING: externs should be avoided in .c files
+extern int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size);
WARNING: quoted string split across lines
+ pr_info("Saving all ABB registers at \"ab8500_complete_register_dump\" "
+ "for crash analyze.\n");
WARNING: Prefer [subsystem eg: netdev]_err([subsystem]dev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...
+ printk(KERN_ERR "abx500_set_reg failed %d, %d", err, __LINE__);
WARNING: Prefer seq_puts to seq_printf
+ seq_printf(s, "name: number: number of: wake:\n");
WARNING: line over 80 characters
+ return single_open(file, ab8500_print_modem_registers, inode->i_private);
WARNING: line over 80 characters
+ return single_open(file, ab8500_gpadc_btemp_ball_print, inode->i_private);
WARNING: line over 80 characters
+ return single_open(file, ab8500_gpadc_main_bat_v_print, inode->i_private);
WARNING: line over 80 characters
+ vbat_true_meas_convert = ab8500_gpadc_ad_to_voltage(gpadc, VBAT_TRUE_MEAS,
WARNING: line over 80 characters
+static int ab8540_gpadc_vbat_true_meas_and_ibat_print(struct seq_file *s, void *p)
WARNING: line over 80 characters
+static const struct file_operations ab8540_gpadc_vbat_true_meas_and_ibat_fops = {
WARNING: line over 80 characters
+ vmain_l, vmain_h, btemp_l, btemp_h, vbat_l, vbat_h, ibat_l, ibat_h);
WARNING: quoted string split across lines
+ dev_err(dev, "debugfs error input: "
+ "should be egal to 1, 4, 8 or 16\n");
WARNING: Missing a blank line after declarations
+ char *s = b;
+ if ((*s == '0') && ((*(s+1) == 'x') || (*(s+1) == 'X'))) {
WARNING: simple_strtoul is obsolete, use kstrtoul instead
+ loc.mask = simple_strtoul(b, &b, 0);
WARNING: simple_strtol is obsolete, use kstrtol instead
+ loc.shift = simple_strtol(b, &b, 0);
WARNING: simple_strtoul is obsolete, use kstrtoul instead
+ loc.bank = simple_strtoul(b, &b, 0);
WARNING: simple_strtoul is obsolete, use kstrtoul instead
+ loc.addr = simple_strtoul(b, &b, 0);
WARNING: simple_strtoul is obsolete, use kstrtoul instead
+ val = simple_strtoul(b, &b, 0);
Laxman Dewangan [Mon, 9 Jun 2014 07:03:37 +0000 (12:33 +0530)]
Doc: mfd: as3722: Add details of optional missing property
Add details of following properties which are used on driver but
not documented on DT binding document.
- ams,enable-internal-int-pullup
- ams,enable-internal-i2c-pullup
Reported-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Doug Anderson [Fri, 27 Jun 2014 19:56:12 +0000 (12:56 -0700)]
mfd: cros_ec: Use the proper size when looking at the cros_ec_i2c result
We know how many bytes the EC should be sending us (which is also the
number of bytes transferred) and also how many bytes the EC actually
wanted to send to us. When computing the checksum and copying back
data let's make sure we take the lesser of the two of those. We'll
also complain if the EC tried to send us too many bytes. The EC
sending us too few bytes is legit for when we send the EC an invalid
command.
This is based on similar code in cros_ec_spi.
Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
WARNING: please, no spaces at the start of a line
#374: FILE: drivers/mfd/ab3100-core.c:374:
+ return blocking_notifier_chain_unregister(&ab3100->event_subscribers,$
WARNING: quoted string split across lines
#564: FILE: drivers/mfd/ab3100-core.c:564:
+ "debug write reg[0x%02x] with 0x%02x, "
+ "after readback: 0x%02x\n",
WARNING: quoted string split across lines
#723: FILE: drivers/mfd/ab3100-core.c:723:
+ "AB3100 P1E variant detected, "
+ "forcing chip to 32KHz\n");
WARNING: quoted string split across lines
#882: FILE: drivers/mfd/ab3100-core.c:882:
+ "could not communicate with the AB3100 analog "
+ "baseband chip\n");
WARNING: quoted string split across lines
#906: FILE: drivers/mfd/ab3100-core.c:906:
+ dev_err(&client->dev, "accepting it anyway. Please update "
+ "the driver.\n");
total: 0 errors, 15 warnings, 999 lines checked
Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Lee Jones [Wed, 2 Jul 2014 13:28:46 +0000 (14:28 +0100)]
mfd: arizona: Rid data size incompatibility warn when building for 64bit
Extinguishes:
../drivers/mfd/arizona-core.c: In function ‘arizona_of_get_type’:
../drivers/mfd/arizona-core.c:505:10:
warning: cast from pointer to integer of different size
Lee Jones [Wed, 2 Jul 2014 10:54:32 +0000 (11:54 +0100)]
mfd: stmpe: Rid data size incompatibility warn when building for 64bit
Extinguishes:
../drivers/mfd/stmpe-i2c.c: In function ‘stmpe_i2c_probe’:
../drivers/mfd/stmpe-i2c.c:88:13:
warning: cast from pointer to integer of different size
partnum = (int)of_id->data;
Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Lee Jones [Wed, 2 Jul 2014 10:22:10 +0000 (11:22 +0100)]
mfd: ab8500-debugfs: Simplify invalid debugfs data checking
Noticed during a coding review, if we reorganised the checking a
little, we can rid the code of a pointless 'else'. Whilst looking
for this particular code hunk I noticed another pointless 'else',
which I've subsequently fixed in this patch.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
If we receive EC interrupts after the cros_ec driver has probed, but
before the cros_ec_keyb driver has probed, the cros_ec IRQ handler
will not run the cros_ec_keyb notifier and the EC will leave the IRQ
line asserted. The cros_ec IRQ handler then returns IRQ_HANDLED and
the resulting flood of interrupts causes the machine to hang.
Since the EC interrupt is currently only used for the keyboard, move
the setup and handling of the EC interrupt to the cros_ec_keyb driver.
Signed-off-by: Andrew Bresticker <abrestic@chromium.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Bill Richardson [Wed, 18 Jun 2014 18:14:06 +0000 (11:14 -0700)]
mfd: cros_ec: ec_dev->cmd_xfer() returns number of bytes received from EC
When communicating with the EC, the cmd_xfer() function should return the
number of bytes it received from the EC, or negative on error.
Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Bill Richardson [Wed, 18 Jun 2014 18:14:05 +0000 (11:14 -0700)]
mfd: cros_ec: Check result code from EC messages
Just because the host was able to talk to the EC doesn't mean that the EC
was happy with what it was told. Errors in communincation are not the same
as error messages from the EC itself.
This change lets the EC report its errors separately.
[dianders: Added common function to cros_ec.c]
Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Remove the three wrapper functions that talk to the EC without passing all
the desired arguments and just use the underlying communication function
that passes everything in a struct intead.
This is internal code refactoring only. Nothing should change.
Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Bill Richardson [Wed, 18 Jun 2014 18:14:03 +0000 (11:14 -0700)]
mfd: cros_ec: cleanup: remove unused fields from struct cros_ec_device
struct cros_ec_device has a superfluous "name" field. We can get all the
debugging info we need from the existing ec_name and phys_name fields, so
let's take out the extra field.
The printout also has sufficient info in it without explicitly adding
the transport. Before this change:
cros-ec-spi spi2.0: Chrome EC (SPI)
After this change:
cros-ec-spi spi2.0: Chrome EC device registered
Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Bill Richardson [Wed, 18 Jun 2014 18:14:02 +0000 (11:14 -0700)]
mfd: cros_ec: Use struct cros_ec_command to communicate with the EC
This is some internal structure reorganization / renaming to prepare
for future patches that will add a userspace API to cros_ec. There
should be no visible changes.
Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Bill Richardson [Wed, 18 Jun 2014 18:14:00 +0000 (11:14 -0700)]
mfd: cros_ec: Tweak struct cros_ec_device for clarity
The members of struct cros_ec_device were improperly commented, and
intermixed the private and public sections. This is just cleanup to make it
more obvious what goes with what.
[dianders: left lock in the structure but gave it the name that will
eventually be used.]
Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Bill Richardson [Wed, 18 Jun 2014 18:13:59 +0000 (11:13 -0700)]
mfd: cros_ec: Allow static din/dout buffers with cros_ec_register()
The lower-level driver may want to provide its own buffers. If so,
there's no need to allocate new ones. This already happens to work
just fine (since we check for size of 0 and use devm allocation), but
it's good to document it.
[dianders: Resolved conflicts; documented that no code changes needed
on mainline]
Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Bill Richardson [Wed, 18 Jun 2014 18:13:58 +0000 (11:13 -0700)]
mfd: cros_ec: Fix the comment on cros_ec_remove()
This comment was incorrect, so update it.
Signed-off-by: Bill Richardson <wfrichar@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Lee Jones [Tue, 1 Jul 2014 11:57:36 +0000 (12:57 +0100)]
mfd: pcf50633: Reconnect -ENOMEM error path
If platform_device_alloc() or platform_device_add_data() fail during
pcf50633_probe(), the current code ignores the return error code and
continues to attempt to allocate new platform devices for each of the
supported regulators. Instead, if any failures occur we should fail
out gracefully by cleaning up after ourselves and return the error.
Chanwoo Choi [Wed, 25 Jun 2014 07:14:47 +0000 (16:14 +0900)]
mfd: sec-core: Prepare regulators for suspend state to reduce power-consumption
This patch use regulator_suspend_prepare() function to prepare the proper state
of regulators for suspend state to remove un-necessary leakage power-consumption.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Chanwoo Choi [Wed, 25 Jun 2014 07:14:46 +0000 (16:14 +0900)]
dt-bindings: mfd: s2mps11: Add support S2MPU02 PMIC
This patch add documentation for S2MPU02 PMIC device. S2MPU02 has a little
difference from S2MPS11/S2MPS14 PMIC and has LDO[1-28]/Buck[1-7].
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Chanwoo Choi [Wed, 25 Jun 2014 07:14:45 +0000 (16:14 +0900)]
regulator: s2mps11: Add support S2MPU02 regulator device
This patch add S2MPU02 regulator device to existing S2MPS11 device driver
because of little difference between S2MPS1x and S2MPU02. The S2MPU02
regulator device includes LDO[1-28] and BUCK[1-7].
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
[Add missing linear_min_sel of S2MPU02 LDO regulators by Jonghwa Lee] Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Acked-by: Mark Brown <broonie@linaro.org> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Chanwoo Choi [Wed, 25 Jun 2014 07:14:44 +0000 (16:14 +0900)]
mfd: sec-core: Add support for S2MPU02 device
Add support for Samsung S2MPU02 PMIC device to the MFD sec-core driver.
The S2MPU02 device includes PMIC/RTC/Clock devices.
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Charles Keepax [Thu, 19 Jun 2014 15:04:23 +0000 (16:04 +0100)]
mfd: arizona: Add comment to explain non-devm regulator_get
To avoid someone attempting to change this regulator_get back into a
devm_regulator_get put a comment in explaining that devres can't be used
here as the regulator will be destroyed before devres calls
regulator_put.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Regmap will refuse to read a register which is not marked as readable,
this has highlighted a number of controls in this driver which are not
marked as readable/missing defaults.
This patch corrects the situation, by adding the missing
readables/defaults.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Prathyush K [Mon, 16 Jun 2014 21:12:23 +0000 (14:12 -0700)]
mfd: cros_ec_spi: Set wakeup capability
Set the device as wakeup capable and register the wakeup source.
Note: Though it makes more sense to have the SPI framework do this,
(either via device tree or by board_info)
this change is as per an existing mail chain:
https://lkml.org/lkml/2009/8/27/291
Signed-off-by: Prathyush K <prathyush.k@samsung.com> Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Laxman Dewangan [Mon, 9 Jun 2014 08:31:59 +0000 (14:01 +0530)]
dt-binding: mfd: as3722: Correct macro name
The macro name for enable3 pin is named as AS3722_EXT_CONTROL_PIN_ENABLE2
which is conflict with the enable2 pin.
Correct this macro name to correctly reflect the enable pin i.e.
AS3722_EXT_CONTROL_PIN_ENABLE3.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reported-by: Dan Willemsen <dwillemsen@nvidia.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Charles Keepax [Mon, 2 Jun 2014 08:50:43 +0000 (09:50 +0100)]
mfd: arizona: Lower ARIZONA_MAX_CORE_SUPPLIES to 2
There are no Arizona devices with 3 core supplies but we define a fix
array with space for 3 core supplies. Lower the ARIZONA_MAX_CORE_SUPPLIES
define to 2, to save a few bytes.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Charles Keepax [Mon, 2 Jun 2014 08:50:42 +0000 (09:50 +0100)]
mfd: arizona: Use num_core_supplies in arizona_dev_exit
Currently we call regulator_bulk_disable with
ARRAY_SIZE(arizona->core_supplies), however this array may be larger
than the number of supplies actually used by the chip we are dealing
with. Use the provided num_core_supplies member instead, so that we only
disable supplies which actually exist.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Charles Keepax [Mon, 2 Jun 2014 08:50:41 +0000 (09:50 +0100)]
mfd: arizona: Don't use devres for DCVDD
Currently the Arizona core uses a devm_regulator_get against its own
device node to obtain DCVDD. The Arizona core is an MFD device and DCVDD
is usually supplied by a child node (arizona-ldo1) of the core. As
devres destruction for the MFD device will run after all its children
have been destroyed, the regulator will be destroyed before devres
calls regulator_put. This causes a warning from both the destruction of
the child node, as the regulator is still open, and from the put of the
regulator as the regulator device has already been destroyed.
This patch handles the regulator get and put without devres to avoid
this issue.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Charles Keepax [Mon, 2 Jun 2014 08:50:40 +0000 (09:50 +0100)]
mfd: arizona: Disable DCVDD before we destroy the MFD
As DCVDD is probably supplied by a child of the MFD device move its
disable to before we destroy the MFD children as the regulator likely
won't exist after that.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Charles Keepax [Mon, 2 Jun 2014 08:50:39 +0000 (09:50 +0100)]
mfd: arizona: Disable PM runtime at start of driver removal
We don't want to trigger any PM runtime operations whilst we are tearing
down the driver, as things the suspend and resume callbacks rely on
might already have been destroyed. So disable PM runtime for the device
as the first step arizona_dev_exit.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Linus Walleij [Tue, 10 Jun 2014 12:31:32 +0000 (14:31 +0200)]
mfd: tc3589x: Translate onecell, not twocell
Something changed in the OF parser in the v3.16 merge window
making it be strict about passing the number of IRQ cells
correctly and disturbing the irqdomain xlate function guard
to crash when subdevices try to obtain IRQs like this:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at
/home/linus/linux-stericsson/kernel/irq/irqdomain.c:676
irq_domain_xlate_twocell+0x40/0x48()
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.15.0-07915-gf6d059821ce9-dirty #46
[<c0014660>] (unwind_backtrace)
from [<c0011424>] (show_stack+0x10/0x14)
[<c0011424>] (show_stack)
from [<c0432630>] (dump_stack+0x9c/0xd4)
[<c0432630>] (dump_stack)
from [<c001d5c0>] (warn_slowpath_common+0x6c/0x88)
[<c001d5c0>] (warn_slowpath_common)
from [<c001d678>] (warn_slowpath_null+0x1c/0x24)
[<c001d678>] (warn_slowpath_null)
from [<c005acd0>] (irq_domain_xlate_twocell+0x40/0x48)
[<c005acd0>] (irq_domain_xlate_twocell)
from [<c005b658>] (irq_create_of_mapping+0x64/0x110)
[<c005b658>] (irq_create_of_mapping)
from [<c02e147c>] (of_irq_get+0x38/0x48)
[<c02e147c>] (of_irq_get)
from [<c01f8910>] (tc3589x_gpio_probe+0x38/0x1e4)
[<c01f8910>] (tc3589x_gpio_probe)
from [<c022eedc>] (platform_drv_probe+0x18/0x48)
[<c022eedc>] (platform_drv_probe)
from [<c022d80c>] (driver_probe_device+0x118/0x24c)
[<c022d80c>] (driver_probe_device)
from [<c022bf20>] (bus_for_each_drv+0x58/0x8c)
[<c022bf20>] (bus_for_each_drv)
from [<c022d6c4>] (device_attach+0x74/0x88)
[<c022d6c4>] (device_attach)
from [<c022cdac>] (bus_probe_device+0x84/0xa8)
[<c022cdac>] (bus_probe_device)
from [<c022b35c>] (device_add+0x440/0x520)
[<c022b35c>] (device_add)
from [<c022ec50>] (platform_device_add+0xb4/0x218)
[<c022ec50>] (platform_device_add)
from [<c0243508>] (mfd_add_device+0x220/0x31c)
[<c0243508>] (mfd_add_device)
from [<c02436a8>] (mfd_add_devices+0xa4/0x100)
[<c02436a8>] (mfd_add_devices)
from [<c024312c>] (tc3589x_probe+0x334/0x3c0)
[<c024312c>] (tc3589x_probe)
from [<c022d80c>] (driver_probe_device+0x118/0x24c)
The TC3589x device trees specify the MFD core device
as having one interrupt cell (cannot specify flags) so the
twocell translation function is clearly wrong, changing it to
onecell, as it should be, fixes the regression.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Doug Anderson [Fri, 13 Jun 2014 18:13:32 +0000 (11:13 -0700)]
mfd: cros_ec: spi: Fix end of transfer on devices with no spi-msg-delay
cros_ec_spi makes the assumption that a 0-length message will put the
spi chip select back to normal (non cs_toggle mode). This used to be
the case back on kernel-3.8 on the spi-s3c64xx driver but doesn't
appear to be true anymore. It seems like it was a pretty questionable
assumption to begin with, so let's fix the code to be more robust. We
know that a message with a single 0-length segment _will_ put things
back in order. Change cros_ec_spi to handle this.
This wasn't a problem on the main user of cros_ec_spi upstream (tegra)
because it specified 'google,cros-ec-spi-msg-delay'.
Signed-off-by: Doug Anderson <dianders@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Jean Delvare [Mon, 16 Jun 2014 11:54:15 +0000 (13:54 +0200)]
mfd: Fix cs5535 dependencies
As far as I know, the CS5535 and CS5536 chipsets are companions of the
Geode series of processors, which are 32-bit only. So the CS5535
drivers are not needed on x86-64, except for build testing purpose.
This aligns the dependencies to what FB_GEODE already uses.
Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Jean Delvare [Mon, 16 Jun 2014 11:56:01 +0000 (13:56 +0200)]
mfd: timberdale: Depend on X86_32
As far as I know the Timberdale chip was only used as a companion for
Intel Atom E600 series processors. As such, its drivers are only
useful on X86_32.
Signed-off-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Micky Ching [Fri, 6 Jun 2014 07:05:45 +0000 (15:05 +0800)]
mmc: rtsx: add support for async request
Add support for non-blocking request, pre_req() runs dma_map_sg() and
post_req() runs dma_unmap_sg(). This patch can increase card read/write
speed, especially for high speed card and slow speed CPU.
Test on intel i3(800MHz - 2.3GHz) performance mode(2.3GHz), SD card
clock 208MHz
Micky Ching [Fri, 6 Jun 2014 07:05:44 +0000 (15:05 +0800)]
mfd: rtsx: Add dma transfer function
rtsx driver using a single function for transfer data, dma map/unmap are
placed in one fix function. We need map/unmap dma in different place(for
mmc async driver), so add three function for dma map, dma transfer and
dma unmap.
Signed-off-by: Micky Ching <micky_ching@realsil.com.cn> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Merge tag 'dt-for-linus' of git://git.secretlab.ca/git/linux
Pull devicetree bugfix from Grant Likely:
"Important bug fix for parsing 64-bit addresses on 32-bit platforms.
Without this patch the kernel will try to use memory ranges that
cannot be reached"
* tag 'dt-for-linus' of git://git.secretlab.ca/git/linux:
of: Check for phys_addr_t overflows in early_init_dt_add_memory_arch
Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley:
"This is a set of 13 fixes, a MAINTAINERS update and a sparse update.
The fixes are mostly correct value initialisations, avoiding NULL
derefs and some uninitialised pointer avoidance.
All the patches have been incubated in -next for a few days. The
final patch (use the scsi data buffer length to extract transfer size)
has been rebased to add a cc to stable, but only the commit message
has changed"
* tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
[SCSI] use the scsi data buffer length to extract transfer size
virtio-scsi: fix various bad behavior on aborted requests
virtio-scsi: avoid cancelling uninitialized work items
ibmvscsi: Add memory barriers for send / receive
ibmvscsi: Abort init sequence during error recovery
qla2xxx: Fix sparse warning in qla_target.c.
bnx2fc: Improve stats update mechanism
bnx2fc: do not scan uninitialized lists in case of error.
fc: ensure scan_work isn't active when freeing fc_rport
pm8001: Fix potential null pointer dereference and memory leak.
MAINTAINERS: Update LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) maintainers Email IDs
be2iscsi: remove potential junk pointer free
be2iscsi: add an missing goto in error path
scsi_error: set DID_TIME_OUT correctly
scsi_error: fix invalid setting of host byte