Commit graph

468518 commits

Author SHA1 Message Date
Nishanth Menon
fecc4452b9 mfd: twl4030-power: Use 'ti,system-power-controller' as alternative way to support system power off
ti,system-power-controller is more or less the standard way of
indicating that the PMIC is the system wide power controller and hence
may be used to switch off the system. Almost ALL TI PMIC drivers and
many Maxim PMIC drivers follow the same style.

So support 'ti,system-power-controller' in addition to the usual
'ti,use_poweroff' to indicate that the PMIC instance has control for
switching off the system.

Signed-off-by: Nishanth Menon <nm@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:58 +01:00
Nishanth Menon
b64c6887f4 mfd: dt-bindings: twl4030-power: Use the standard property to mark power control
ti,system-power-controller is more or less the standard way of
indicating that the PMIC is the system wide power controller and hence
may be used to switch off the system. Almost ALL TI PMIC drivers and
many Maxim PMIC drivers follow the same style.

So support 'ti,system-power-controller' in addition to the usual
'ti,use_poweroff' to indicate that the PMIC instance has control for
switching off the system.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:57 +01:00
Boris BREZILLON
c896e68ec1 mfd: syscon: Add Atmel GPBR DT bindings documention
The GPBR block provides a set of battery-backed registers that can be used
to save data which need to be kept when the system is powered down and
VDD-core is maintained by an external battery.

A typical usage is the RTT block (when used as an RTC) which needs one of
those registers to save the current time.

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Johan Hovold <johan@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:56 +01:00
Doug Anderson
2adb3b8e6f mfd: rk808: Add register caching
Let's define the voltatile registers (those that can't be cached) and
enable caching.  The rk808 is accessed almost constantly with cpufreq
so this is really nice.

As measured by ftrace:
  before this change: cpu0_set_target() => ~2200us
  after this change:  cpu0_set_target() =>  ~500us

Signed-off-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:56 +01:00
Charles Keepax
cfeb35da2a mfd: arizona: Use handle_simple_irq for IRQ dispatch chip
We use a dummy IRQ chip to dispatch interrupts to the two seperate IRQ
domains on the Arizona devices. This is just a simple software IRQ chip
and thus the current handle_edge_irq is unnecessary for its needs.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:55 +01:00
Krzysztof Kozlowski
be69e9e007 mfd: max14577: Don't pass IRQ domain to mfd_add_devices
The max14577 MFD cells do not have any resources so the IRQ domain
passed to mfd_add_devices is not used.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:54 +01:00
Sean Cross
0bf1f0cda1 mfd: stmpe: Document DT binding for irq_over_gpio
STMPE now supports using a GPIO as an IRQ source.  Document the device
tree binding for this option.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:54 +01:00
Sean Cross
851ec59614 mfd: stmpe: Support gpio over irq under device tree
The stmpe_platform_data has a irq_over_gpio field, which allows the
system to read STMPE events whenever an IRQ occurs on a GPIO pin.
This patch adds the ability to configure this field and to use a GPIO
as an IRQ source for boards configuring the STMPE in device tree.

Signed-off-by: Sean Cross <xobs@kosagi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:53 +01:00
Jaewon Kim
bdaf67030c mfd: intel_soc_pmic: Add CONFIG_PM_SLEEP check for suspend_fn/resume_fn
This patch fix warning message with CONFIG_PM_SLEEP disabled
If CONFIG_PM_SLEEP is not enabled we receive the following warning message:

drivers/mfd/intel_soc_pmic_core.c:118:12:
 warning: 'intel_soc_pmic_suspend' defined but not used

Signed-off-by: Jaewon Kim <jaewon02.kim@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:52 +01:00
Chris Ball
5152970538 mfd: rtsx_pcr: Fix MSI enable error handling
pci_enable_msi() can return failure with both positive and negative
integers -- it returns 0 for success -- but is only tested here for
"if (ret < 0)".  This causes us to try to use MSI on the RTS5249 SD
reader in the Dell XPS 11 when enabling MSI failed, causing:

[    1.737110] rtsx_pci: probe of 0000:05:00.0 failed with error -110

Cc: stable <stable@vger.kernel.org>
Reported-by: D. Jared Dominguez <Jared_Dominguez@Dell.com>
Tested-by: D. Jared Dominguez <Jared_Dominguez@Dell.com>
Signed-off-by: Chris Ball <chris@printf.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:52 +01:00
Sebastian Andrzej Siewior
6a71f38dd8 mfd: ti_am335x_tscadc: Fix TSC resume
In the resume path, the ADC invokes am335x_tsc_se_set_cache() with 0 as
the steps argument if continous mode is not in use. This in turn disables
all steps and so the TSC is not working until one ADC sampling is
performed.

This patch fixes it by writing the current cached mask instead of the
passed steps.

Fixes: 7ca6740cd1 ("mfd: input: iio: ti_amm335x: Rework TSC/ADCA
synchronization")
Cc: stable@vger.kernel.org # v3.13+
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:51 +01:00
Mark Brown
0b496b4c95 mfd: tps65217: Tell regmap what registers are valid
Allow regmap to provide debugfs access to the register map by telling it
what registers are valid.

Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:50 +01:00
Markus Pargmann
34a4958e4c mfd: mc13xxx: Configure WDI reset
Setup the PMIC to make a restart when a watchdog interrupt occures.
If this is not configured, the PMIC will shut down the power supply
without a restart.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:50 +01:00
Andy Shevchenko
970d9fbca9 mfd: pcf50633: Use sprintf directly
When dump a content of the registers let's use snprintf() directly with %*ph
specifier.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:49 +01:00
Guodong Xu
8bdf87b400 mfd: Add HI6421 PMIC Core driver
This adds driver to support HiSilicon Hi6421 PMIC. Hi6421 includes multi-
functions, such as regulators, codec, ADCs, Coulomb counter, etc.
This driver includes core APIs _only_.

Drivers for individul components, like voltage regulators, are
implemented in corresponding driver directories and files.

Registers in Hi6421 are memory mapped, so using regmap-mmio API.

Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:23:43 +01:00
Guodong Xu
0709b048ce mfd: dt-bindings: Add Device Tree bindings for HI6421
Add documentation for HiSilicon Hi6421 PMIC DT binding.

Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:59 +01:00
Andy Shevchenko
85de80e8df mfd: lpc_sch: Remove FSF address
This patch removes FSF address because it can be changed. While here, update
the copyright lines by adding Intel Corp. to them.

There is no functional change.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:59 +01:00
Andy Shevchenko
ec689a8a81 mfd: lpc_sch: Add support for Intel Quark X1000
Intel Quark X1000 SoC supports IRQ based GPIO. This patch will
enable MFD support for Quark X1000 and provide IRQ resources
to Quark X1000 GPIO device driver.

Signed-off-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
Tested-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:58 +01:00
Josef Ahmad
bb048713bb pci_ids: Add support for Intel Quark ILB
This patch adds the PCI id for Intel Quark ILB.
It will be used for GPIO and Multifunction device driver.

Signed-off-by: Josef Ahmad <josef.ahmad@intel.com>
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:57 +01:00
Andy Shevchenko
b24512c860 mfd: lpc_sch: Reduce duplicate code and improve manageability
This patch refactors the driver to use helper functions instead of
copy'n'pasted pieces of code.

It also introduces an additional struct to hold a chipset info. The chipset
info will be used to store features that are supported by specific processor or
chipset. LPC_SCH supports SMBUS, GPIO and WDT features. As this code base might
expand further to support more processors, this implementation will help to
keep code base clean and manageable.

The patch is partially based on the work done by Chang Rebecca Swee Fun.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Chang Rebecca Swee Fun <rebecca.swee.fun.chang@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:57 +01:00
Chris Zhong
f69a7cf74d mfd: RK808: Add new mfd driver for RK808
The RK808 chip is a power management IC for multimedia and handheld
devices. It contains the following components:

- Regulators
- RTC
- Clkout

The RK808 core driver is registered as a platform driver and provides
communication through I2C with the host device for the different
components.

Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Zhang Qing <zhangqing@rock-chips.com>
Tested-by: Heiko <heiko@sntech.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:56 +01:00
Chris Zhong
a53b9a97ac mfd: dt-bindings: Add RK808 device tree bindings document
Add device tree bindings documentation and a header file
for rockchip's RK808 pmic.

Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Signed-off-by: Zhang Qing <zhangqing@rock-chips.com>
Tested-by: Heiko <heiko@sntech.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:55 +01:00
Axel Lin
e9e9d39735 mfd: da9052: Avoid setting read_flag_mask for da9052-i2c driver
Current code init regmap with &da9052_regmap_config for both da9052-spi and
da9052-i2c drivers. da9052-spi sets the read_flag_mask.
The same setting may be applied for da9052-i2c if da9052-spi driver is loaded
first because they actually use the same regmap_config setting.
Fix this issue by using a local variable for regmap_config in da9052-spi driver,
so the settings in spi driver won't impact the settings in i2c driver.
Also makes da9052_regmap_config const to avoid similar issue.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:54 +01:00
Charles Keepax
c38715fed8 mfd: arizona: Propagate irq_wake through to parent IRQ
If one of the internal Arizona IRQs is set as a wake source this needs
to be propogated back to the actual IRQ line that the Arizona device is
attached to.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:54 +01:00
Inha Song
dc5193cc4a mfd: arizona: Update DT binding to support INn_MODE init_data
This patch update DT binding to support INn_MODE init_data. Each
input signal path can be configurated either as a Analogue or
Digital using the INn_MODE registers.

Signed-off-by: Inha Song <ideal.song@samsung.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:53 +01:00
Inha Song
cc47aed9a1 mfd: arizona: Add support for INn_Mode register control
Some boards need to set the INn_MODE[1:0] register to change
the input signal patch. This wlf,inmode property is optional.
If present, values must be specified less than or equal to
the number of input singals. If values less than the number
of input signals, elements that has not been specifed are set
to 0 by default.

Example:
   - wlf,inmode = <2 0 2>;	/* IN1, IN3 use DMIC */

Signed-off-by: Inha Song <ideal.song@samsung.com>
Reviewed-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:52 +01:00
Charles Keepax
c24084db22 mfd: arizona: Add ASYNC_SAMPLE_RATE_2 registers
Some arizona devices have a second asynchronous sample rate, add the
registers necessary to support this.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:52 +01:00
Beniamino Galvani
9bb9e29c78 mfd: Add Ricoh RN5T618 PMIC core driver
Ricoh RN5T618 is a power management IC which integrates 3 step-down
DCDC converters, 7 low-dropout regulators, a Li-ion battery charger,
fuel gauge, ADC, GPIOs and a watchdog timer.

This commit adds a MFD core driver to support the I2C communication
with the device.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:51 +01:00
Vignesh R
6ac734d224 mfd: ti_am335x_tscadc: Fix TSC operation after ADC continouous mode
After enabling and disabling ADC continuous mode via sysfs, ts_print_raw
fails to return any data. This is because when ADC is configured for
continuous mode, it disables touch screen steps.These steps are not
re-enabled when ADC continuous mode is disabled. Therefore existing values
of REG_SE needs to be cached before enabling continuous mode and
disabling touch screen steps and enabling ADC steps. The cached value
are to be restored to REG_SE once ADC is disabled.

Fixes: 7ca6740cd1 ("mfd: input: iio: ti_amm335x: Rework TSC/ADC synchronization")

Cc: stable@vger.kernel.org # v3.13+
Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:50 +01:00
Beniamino Galvani
a654f81640 mfd: rn5t618: Document device tree bindings
This adds the device tree bindings documentation for Ricoh RN5T618.

Signed-off-by: Beniamino Galvani <b.galvani@gmail.com>
Reviewed-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:50 +01:00
Rasmus Villemoes
c593aca4e4 mfd: davinci_voicecodec: Fix 'if defined' guard type in header
The include guard doesn't work as intended due to the transposition
typo DAVINCI -> DAVINIC.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:49 +01:00
Arnout Vandecappelle (Essensium/Mind)
be1c770028 mfd: tps65910: Work around silicon erratum SWCZ010
http://www.ti.com/lit/pdf/SWCZ010:
  Glitch on SDA-SCL not managed correctly by the I2C IP

Impact:
The standard specifies that the I2C transfer should restart on a start
event in all cases. The current design does not support two consecutive
Start conditions. This can cause the first real access after such a
glitch to be corrupted.

Description:
An unexpected glitch on SDA and SCL can generate a wrong start event.
In the current design, the SCL line must toggle two times to detect a
new start event and completely restart the I2C access; hence the real
start event is not detected in the case of a single SCL toggle.

Workaround:
Repeat I2C access.

A simpler workaround is to make a dummy transfer just before the first
access to the tps65910 chip. This can be done unconditionally.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:48 +01:00
Rasmus Villemoes
dfa52c852d mfd: ti_ssp: Remove unused header
The header file include/linux/mfd/ti_ssp.h does not seem to be used
anywhere. It was orphaned by 3033ee62 "mfd: Remove obsolete ti-ssp
driver". Remove it.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:48 +01:00
Lee Jones
7929fa7740 mfd: stmpe: Rid variable length array Sparse warnings
Numbers are generated by taking the largest currently used values.

drivers/mfd/stmpe.c:252:17:
  warning: Variable length array is used.
drivers/mfd/stmpe.c:857:16:
  warning: Variable length array is used.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:47 +01:00
Lee Jones
87bd1c9250 mfd: max8925-i2c: Fix variable length array Sparse warning
The largest byte size in use currently is 8.  Fix array size to 9.

drivers/mfd/max8925-i2c.c:40:33:
  warning: Variable length array is used

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:46 +01:00
Lee Jones
7a36ceb284 mfd: 88pm860x-i2c: Fix variable length array Sparse warning
drivers/mfd/88pm860x-i2c.c:125:33:
  warning: Variable length array is used.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:45 +01:00
Lee Jones
260a127bfb mfd: 88pm860x-i2c: Purge unused functions
The following functions appear to be unused since v2.6.39:

  pm860x_page_reg_read()
  pm860x_page_bulk_write()
  pm860x_page_set_bits()

Let's remove them.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:45 +01:00
James Ralston
fea31042ff mfd: lpc_ich: Add Device IDs for Intel 9 Series PCH
This patch adds the LPC Device IDs for the Intel 9 Series PCH.

Signed-off-by: James Ralston <james.d.ralston@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:44 +01:00
Jacek Anaszewski
a0bc607208 mfd: max77693: Improve support for the flash cell
This patch improves support for the flash cell of
max77693 mfd by adding relevant of_compatible field
and a structure for caching related platform data.
Added are also FLASH registers related macro definitions.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:43 +01:00
Jacek Anaszewski
4b5c1f1e08 mfd: max77693: Fix register enum name
According to the MAX77693 documentation the name of
the register is FLASH_STATUS.

Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:43 +01:00
Alan Cox
ff0c9da013 mfd: lpc_ich: Add PCI ID for Intel Braswell
This is the same as used in Baytrail so add the new PCI ID to the driver's
list of supported IDs.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:42 +01:00
Axel Lin
378515fc10 mfd: da9052-i2c: Remove duplicate test for I2C_FUNC_SMBUS_BYTE_DATA functionality
Since commit b42261078a ("regmap: i2c: fallback to SMBus if the adapter
does not support standard I2C"), regmap-i2c will check the
I2C_FUNC_SMBUS_[BYTE|WORD]_DATA functionality based on the regmap_config
setting if the adapter does not support standard I2C.

So remove the I2C_FUNC_SMBUS_BYTE_DATA functionality check in the driver code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:41 +01:00
Julia Lawall
42a71ef97b mfd: menelaus: Fix error return code
Convert a zero return value on error to a negative one, as returned
elsewhere in the function.

Additionally, converted 1 << 7 to BIT(7) at the suggestion of Lee Jones.

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

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:41 +01:00
Charles Keepax
2a3377ee2d mfd: arizona: Avoid use of legacy IRQ mapping
regmap_add_irq_chip is called from arizona_irq_init with the irq_base
specified as -1 and regmap_add_irq_chip uses if (irq_base) to check if
it should use legacy IRQ mapping. As such the irq mappings are currently
added with irq_domain_add_legacy, rather than irq_domain_add_linear.
This is clearly a typo as there is no reason why this driver can't use
irq_domain_add_linear.

This patch corrects this by passing the irq_base as zero to
regmap_add_irq_chip.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:40 +01:00
Charles Keepax
e569d937af mfd: arizona: Mark additional registers as volatile
Mark some additional registers as volatile. The write sequencer control
registers should not be cached, as we don't ever want their value
synchronised as this might cause a write sequence to be accidentally
initiated.

Additionally, the DAC_COMP registers require special preconditions to
write so there values wouldn't be updated accurately during a register
sync.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:39 +01:00
Mark Brown
48018943eb mfd: wm5102: Mark register write sequencer control 3 readable
During init the core checks if the wm5102 has finished starting by reading
register 0x19 and looking at the value. This read always fails since this
is not a readable register, mark it as being one. While we're at it provide
a constant for the register name (as supplied by Charles Keepax).

Signed-off-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:38 +01:00
Hans Wennborg
5e9bbf17b3 mfd: rtsx_usb: Fix decimal printf format specifiers prefixed with 0x
The prefix suggests the number should be printed in hex, so use
the %x specifier to do that.

Found by using regex suggested by Joe Perches.

Signed-off-by: Hans Wennborg <hans@hanshq.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:38 +01:00
Julia Lawall
f2b8678161 mfd: twl6040: Fix error return code
Convert a zero return value on error to a negative one, as returned
elsewhere in the function.

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

// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}

// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:37 +01:00
Mark Brown
6052d83e71 mfd: wm8994: Allow modular build
The interfaces that used to be built in only (interrupts IIRC) no longer
are so allow the driver to be built as a module fixing arm64 allmodconfig
builds.

Signed-off-by: Mark Brown <broonie@linaro.org>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-09-26 08:15:36 +01:00
Himangi Saraogi
e0c8a1f52d mfd: menelaus: Remove null pointer dereference
If vtg is NULL, it is not possible to access its mode_reg field. At all
sites where the static function menelaus_set_voltage is called, the first
argument is the address of a structure defined in the file. So, the null
test is unnecessary and is removed. Also, a label is done away with.

This problem was found using the following Coccinelle semantic match:

// <smpl>
@@
expression E, E1;
identifier f;
statement S1,S2,S3;
@@

* if (E == NULL)
{
  ... when != if (E == NULL) S1 else S2
      when != E = E1
* E->f
  ... when any
  return ...;
}
else S3
// </smpl>

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>
2014-09-26 08:15:36 +01:00