openwrt/staging/blogic.git
10 years agomfd: Add ACPI support
Mika Westerberg [Tue, 16 Sep 2014 11:52:36 +0000 (14:52 +0300)]
mfd: Add ACPI support

If an MFD device is backed by ACPI namespace, we should allow subdevice
drivers to access their corresponding ACPI companion devices through normal
means (e.g using ACPI_COMPANION()).

This patch adds such support to the MFD core. If the MFD parent device
does not specify any ACPI _HID/_CID for the child device, the child
device will share the parent ACPI companion device. Otherwise the child
device will be assigned with the corresponding ACPI companion, if found
in the namespace below the parent.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agoRevert "mfd: wm5102: Manually apply register patch"
Charles Keepax [Wed, 24 Sep 2014 09:37:10 +0000 (10:37 +0100)]
Revert "mfd: wm5102: Manually apply register patch"

This reverts commit d9d03496f6f904a3588bdb8b215853bc4e50132c.

It seems this commit was applied twice, once through ASoC and once
through MFD:

commit 4c9bb8bc352a14c9613c77bc3f1e9038cd086b9b
mfd: wm5102: Manually apply register patch

commit d9d03496f6f904a3588bdb8b215853bc4e50132c
mfd: wm5102: Manually apply register patch

This has lead to a small piece of duplicate code. It is harmless hence
how it has gone unoticed for so long. This patch reverts one of the two
commits removing the unneeded code.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: ti_am335x_tscadc: Update logic in CTRL register for 5-wire TS
Jeff Lance [Thu, 4 Sep 2014 17:01:57 +0000 (19:01 +0200)]
mfd: ti_am335x_tscadc: Update logic in CTRL register for 5-wire TS

The logic in AFE_Pen_Ctrl bitmask in the CTRL register is different for five
wire versus four or eight wire touschscreens. This patch should fix this for
five-wire touch screens. There should be no change needed here for four and
eight wire tousch screens.

Signed-off-by: Jeff Lance <j-lance1@ti.com>
[bigeasy: keep the change mfd only]
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: dt-bindings: atmel-gpbr: Rename doc file to conform to naming convention
Lee Jones [Wed, 24 Sep 2014 10:33:44 +0000 (11:33 +0100)]
mfd: dt-bindings: atmel-gpbr: Rename doc file to conform to naming convention

Cc: boris.brezillon@free-electrons.com
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: dt-bindings: qcom-pm8xxx: Rename doc file to conform to naming convention
Lee Jones [Wed, 24 Sep 2014 10:29:17 +0000 (11:29 +0100)]
mfd: dt-bindings: qcom-pm8xxx: Rename doc file to conform to naming convention

Cc: Stanimir Varbanov <svarbanov@mm-sol.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: Inherit coherent_dma_mask from parent device
Boris BREZILLON [Mon, 22 Sep 2014 19:37:55 +0000 (21:37 +0200)]
mfd: Inherit coherent_dma_mask from parent device

dma_mask and dma_parms are already inherited from the parent device but
dma_coherent_mask was left uninitialized (set to zero thanks to kzalloc).
Set sub-device coherent_dma_mask to its parent value to simplify
sub-drivers making use of dma coherent helper functions (those drivers
currently have to explicitly set the dma coherent mask using
dma_set_coherent_mask function).

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: Document DT bindings for Qualcomm SPMI PMICs
Stanimir Varbanov [Fri, 1 Aug 2014 14:30:49 +0000 (17:30 +0300)]
mfd: Document DT bindings for Qualcomm SPMI PMICs

Document DT bindings used to describe the Qualcomm SPMI PMICs.

Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: Add support for Qualcomm SPMI PMICs
Josh Cartwright [Fri, 1 Aug 2014 14:30:48 +0000 (17:30 +0300)]
mfd: Add support for Qualcomm SPMI PMICs

The Qualcomm SPMI PMIC chips are components used with the
Snapdragon 800 series SoC family.  This driver exists
largely as a glue mfd component, it exists to be an owner
of an SPMI regmap for children devices described in
device tree.

Signed-off-by: Josh Cartwright <joshc@codeaurora.org>
Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: dt-bindings: pm8xxx: Add new compatible string
Stanimir Varbanov [Tue, 23 Sep 2014 13:52:40 +0000 (16:52 +0300)]
mfd: dt-bindings: pm8xxx: Add new compatible string

The rtc driver now supports PM8941 PMIC device, reflect this
in the binding document.

Signed-off-by: Stanimir Varbanov <svarbanov@mm-sol.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: axp209x: Drop the parent supplies field
Maxime Ripard [Sat, 20 Sep 2014 20:06:35 +0000 (22:06 +0200)]
mfd: axp209x: Drop the parent supplies field

Now that the regulator code get its parent supplies purely from the DT, we can
drop the parent supplies resources in the MFD driver.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: twl4030-power: Use 'ti,system-power-controller' as alternative way to support...
Nishanth Menon [Wed, 17 Sep 2014 12:34:12 +0000 (07:34 -0500)]
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>
10 years agomfd: dt-bindings: twl4030-power: Use the standard property to mark power control
Nishanth Menon [Wed, 17 Sep 2014 12:34:11 +0000 (07:34 -0500)]
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>
10 years agomfd: syscon: Add Atmel GPBR DT bindings documention
Boris BREZILLON [Thu, 11 Sep 2014 13:18:45 +0000 (15:18 +0200)]
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>
10 years agomfd: rk808: Add register caching
Doug Anderson [Tue, 9 Sep 2014 23:06:04 +0000 (16:06 -0700)]
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>
10 years agomfd: arizona: Use handle_simple_irq for IRQ dispatch chip
Charles Keepax [Tue, 9 Sep 2014 16:00:09 +0000 (17:00 +0100)]
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>
10 years agomfd: max14577: Don't pass IRQ domain to mfd_add_devices
Krzysztof Kozlowski [Fri, 5 Sep 2014 10:15:10 +0000 (12:15 +0200)]
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>
10 years agomfd: stmpe: Document DT binding for irq_over_gpio
Sean Cross [Fri, 12 Sep 2014 03:18:34 +0000 (11:18 +0800)]
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>
10 years agomfd: stmpe: Support gpio over irq under device tree
Sean Cross [Fri, 12 Sep 2014 03:18:33 +0000 (11:18 +0800)]
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>
10 years agomfd: intel_soc_pmic: Add CONFIG_PM_SLEEP check for suspend_fn/resume_fn
Jaewon Kim [Fri, 12 Sep 2014 04:35:45 +0000 (13:35 +0900)]
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>
10 years agomfd: rtsx_pcr: Fix MSI enable error handling
Chris Ball [Thu, 4 Sep 2014 16:11:53 +0000 (17:11 +0100)]
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>
10 years agomfd: ti_am335x_tscadc: Fix TSC resume
Sebastian Andrzej Siewior [Mon, 8 Sep 2014 13:28:42 +0000 (15:28 +0200)]
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: 7ca6740cd1cd ("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>
10 years agomfd: tps65217: Tell regmap what registers are valid
Mark Brown [Fri, 5 Sep 2014 21:16:18 +0000 (22:16 +0100)]
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>
10 years agomfd: mc13xxx: Configure WDI reset
Markus Pargmann [Mon, 8 Sep 2014 07:01:11 +0000 (09:01 +0200)]
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>
10 years agomfd: pcf50633: Use sprintf directly
Andy Shevchenko [Thu, 4 Sep 2014 09:32:12 +0000 (12:32 +0300)]
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>
10 years agomfd: Add HI6421 PMIC Core driver
Guodong Xu [Mon, 1 Sep 2014 08:28:34 +0000 (16:28 +0800)]
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>
10 years agomfd: dt-bindings: Add Device Tree bindings for HI6421
Guodong Xu [Mon, 1 Sep 2014 08:28:33 +0000 (16:28 +0800)]
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>
10 years agomfd: lpc_sch: Remove FSF address
Andy Shevchenko [Tue, 2 Sep 2014 10:45:22 +0000 (13:45 +0300)]
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>
10 years agomfd: lpc_sch: Add support for Intel Quark X1000
Andy Shevchenko [Tue, 2 Sep 2014 10:45:21 +0000 (13:45 +0300)]
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>
10 years agopci_ids: Add support for Intel Quark ILB
Josef Ahmad [Tue, 2 Sep 2014 10:45:20 +0000 (13:45 +0300)]
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>
10 years agomfd: lpc_sch: Reduce duplicate code and improve manageability
Andy Shevchenko [Tue, 2 Sep 2014 10:45:19 +0000 (13:45 +0300)]
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>
10 years agomfd: RK808: Add new mfd driver for RK808
Chris Zhong [Wed, 3 Sep 2014 13:51:44 +0000 (21:51 +0800)]
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>
10 years agomfd: dt-bindings: Add RK808 device tree bindings document
Chris Zhong [Wed, 3 Sep 2014 13:51:43 +0000 (21:51 +0800)]
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>
10 years agomfd: da9052: Avoid setting read_flag_mask for da9052-i2c driver
Axel Lin [Sat, 16 Aug 2014 13:23:40 +0000 (21:23 +0800)]
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>
10 years agomfd: arizona: Propagate irq_wake through to parent IRQ
Charles Keepax [Mon, 1 Sep 2014 14:29:11 +0000 (15:29 +0100)]
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>
10 years agomfd: arizona: Update DT binding to support INn_MODE init_data
Inha Song [Sat, 30 Aug 2014 02:27:19 +0000 (11:27 +0900)]
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>
10 years agomfd: arizona: Add support for INn_Mode register control
Inha Song [Sat, 30 Aug 2014 02:27:18 +0000 (11:27 +0900)]
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>
10 years agomfd: arizona: Add ASYNC_SAMPLE_RATE_2 registers
Charles Keepax [Mon, 1 Sep 2014 14:48:52 +0000 (15:48 +0100)]
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>
10 years agomfd: Add Ricoh RN5T618 PMIC core driver
Beniamino Galvani [Sat, 30 Aug 2014 12:50:23 +0000 (14:50 +0200)]
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>
10 years agomfd: ti_am335x_tscadc: Fix TSC operation after ADC continouous mode
Vignesh R [Mon, 1 Sep 2014 06:31:06 +0000 (12:01 +0530)]
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: 7ca6740cd1cd ("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>
10 years agomfd: rn5t618: Document device tree bindings
Beniamino Galvani [Sat, 30 Aug 2014 12:50:26 +0000 (14:50 +0200)]
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>
10 years agomfd: davinci_voicecodec: Fix 'if defined' guard type in header
Rasmus Villemoes [Fri, 22 Aug 2014 16:49:03 +0000 (18:49 +0200)]
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>
10 years agomfd: tps65910: Work around silicon erratum SWCZ010
Arnout Vandecappelle (Essensium/Mind) [Fri, 22 Aug 2014 15:30:56 +0000 (17:30 +0200)]
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>
10 years agomfd: ti_ssp: Remove unused header
Rasmus Villemoes [Thu, 28 Aug 2014 11:52:50 +0000 (13:52 +0200)]
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>
10 years agomfd: stmpe: Rid variable length array Sparse warnings
Lee Jones [Thu, 28 Aug 2014 10:20:33 +0000 (11:20 +0100)]
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>
10 years agomfd: max8925-i2c: Fix variable length array Sparse warning
Lee Jones [Thu, 28 Aug 2014 10:01:15 +0000 (11:01 +0100)]
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>
10 years agomfd: 88pm860x-i2c: Fix variable length array Sparse warning
Lee Jones [Thu, 28 Aug 2014 09:51:26 +0000 (10:51 +0100)]
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>
10 years agomfd: 88pm860x-i2c: Purge unused functions
Lee Jones [Thu, 28 Aug 2014 09:48:18 +0000 (10:48 +0100)]
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>
10 years agomfd: lpc_ich: Add Device IDs for Intel 9 Series PCH
James Ralston [Wed, 27 Aug 2014 21:34:25 +0000 (14:34 -0700)]
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>
10 years agomfd: max77693: Improve support for the flash cell
Jacek Anaszewski [Fri, 22 Aug 2014 09:06:18 +0000 (11:06 +0200)]
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>
10 years agomfd: max77693: Fix register enum name
Jacek Anaszewski [Wed, 20 Aug 2014 13:43:39 +0000 (15:43 +0200)]
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>
10 years agomfd: lpc_ich: Add PCI ID for Intel Braswell
Alan Cox [Thu, 21 Aug 2014 09:46:25 +0000 (12:46 +0300)]
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>
10 years agomfd: da9052-i2c: Remove duplicate test for I2C_FUNC_SMBUS_BYTE_DATA functionality
Axel Lin [Fri, 15 Aug 2014 13:53:17 +0000 (21:53 +0800)]
mfd: da9052-i2c: Remove duplicate test for I2C_FUNC_SMBUS_BYTE_DATA functionality

Since commit b42261078a91 ("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>
10 years agomfd: menelaus: Fix error return code
Julia Lawall [Thu, 21 Aug 2014 12:06:06 +0000 (07:06 -0500)]
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>
10 years agomfd: arizona: Avoid use of legacy IRQ mapping
Charles Keepax [Tue, 12 Aug 2014 13:51:22 +0000 (14:51 +0100)]
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>
10 years agomfd: arizona: Mark additional registers as volatile
Charles Keepax [Wed, 13 Aug 2014 10:42:47 +0000 (11:42 +0100)]
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>
10 years agomfd: wm5102: Mark register write sequencer control 3 readable
Mark Brown [Wed, 13 Aug 2014 10:42:46 +0000 (11:42 +0100)]
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>
10 years agomfd: rtsx_usb: Fix decimal printf format specifiers prefixed with 0x
Hans Wennborg [Wed, 6 Aug 2014 04:42:28 +0000 (21:42 -0700)]
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>
10 years agomfd: twl6040: Fix error return code
Julia Lawall [Wed, 6 Aug 2014 20:12:15 +0000 (22:12 +0200)]
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>
10 years agomfd: wm8994: Allow modular build
Mark Brown [Thu, 31 Jul 2014 14:41:30 +0000 (15:41 +0100)]
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>
10 years agomfd: menelaus: Remove null pointer dereference
Himangi Saraogi [Sat, 9 Aug 2014 16:40:27 +0000 (22:10 +0530)]
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>
10 years agomfd: wm8994: Export symbols ready for built-in => modular build
Lee Jones [Fri, 22 Aug 2014 09:09:27 +0000 (10:09 +0100)]
mfd: wm8994: Export symbols ready for built-in => modular build

We'd like to be able to build the WM8994 family as modules, but the
build will fail if the external symbols aren't exported first.

Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: sm501: Avoid implicit sign extension
Lee Jones [Mon, 18 Aug 2014 15:11:27 +0000 (16:11 +0100)]
mfd: sm501: Avoid implicit sign extension

Suspicious implicit sign extension where 'reg' (unsigned char) is
promoted in reg << clksrc to int, then sign-extended to unsigned
long. If reg << clksrc is greater than 0x7FFFFFFF, the upper bits
of the result will all be 1.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: twl4030-irq: Check return value from twl_i2c_write() - warn() on failure
Lee Jones [Mon, 18 Aug 2014 15:03:14 +0000 (16:03 +0100)]
mfd: twl4030-irq: Check return value from twl_i2c_write() - warn() on failure

In the original code a return value variable was provided, but it
was never checked and the user was never informed of failure.  Now
it is and they are.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: pcf50633: Check return value of platform_device_add()
Lee Jones [Mon, 18 Aug 2014 14:54:06 +0000 (15:54 +0100)]
mfd: pcf50633: Check return value of platform_device_add()

The return value of platform_device_add() is checked after every
other use throughout the kernel.

We're also sliding in another cheeky dev_err() => dev_warn() change
as we're not actually erroring out here, rather reporting the fact
that something's gone wrong, but carrying on regardless.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: max77686: Remove check which is always true
Lee Jones [Mon, 18 Aug 2014 14:41:59 +0000 (15:41 +0100)]
mfd: max77686: Remove check which is always true

As 'reg' is unsigned, it can't be less than 0, so checking if it is
greater than or equal to 0 will always result in a true condition.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: wm5102: Insert missing break in case statement
Lee Jones [Mon, 18 Aug 2014 14:05:01 +0000 (15:05 +0100)]
mfd: wm5102: Insert missing break in case statement

Chip identifier wm5102_reva_patch is always overwritten with
wm5102_revb_patch, even when the code is run on a Rev-A chip.  Place
in the missing break to force the code into doing something sensible
instead.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: htc-i2cpld: Rectify pointer offset error
Lee Jones [Mon, 18 Aug 2014 12:10:20 +0000 (13:10 +0100)]
mfd: htc-i2cpld: Rectify pointer offset error

Checking the result of container_of() against NULL will always result to
false.  Using the offset of member 'chip_out' to find the start of 'struct
htcpld_chip' will result in an offset error when .get_chip() is attempting
to obtain 'htcpld-in'.  Instead, we'll use the correct member based on a
previously the set chip label.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: htc-i2cpld: Use '!variable' instead of 'variable == NULL'
Lee Jones [Wed, 13 Aug 2014 12:52:27 +0000 (13:52 +0100)]
mfd: htc-i2cpld: Use '!variable' instead of 'variable == NULL'

This aids in consistency, as the rest of the checks in the file use this
notation.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: htc-i2cpld: container_of() cannot return NULL
Lee Jones [Wed, 13 Aug 2014 12:48:27 +0000 (13:48 +0100)]
mfd: htc-i2cpld: container_of() cannot return NULL

Logically dead code (DEADCODE)

dead_error_line: Execution cannot reach this statement: return;

Remove the check for NULL.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomisc: st_kim: Increase size of dev_name buffer to incorporate termination
Lee Jones [Wed, 13 Aug 2014 11:45:19 +0000 (12:45 +0100)]
misc: st_kim: Increase size of dev_name buffer to incorporate termination

Calling strncpy with a maximum size argument of 32 bytes on destination
array kim_gdata->dev_name of size 32 bytes might leave the destination
string unterminated.

Cc: gregkh@linuxfoundation.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomisc: st_core: Protect unsigned value against becoming negative
Lee Jones [Wed, 13 Aug 2014 11:23:10 +0000 (12:23 +0100)]
misc: st_core: Protect unsigned value against becoming negative

Coverity reported:
  This less-than-zero comparison of an unsigned value is never true.

In answer to that, we only ever decrement if protos_registered is
positive.  We can subsequently remove the paranoid checking during
unregister.

Cc: gregkh@linuxfoundation.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agoiio: sensors-core: st: Check st_sensors_set_drdy_int_pin()'s return value
Lee Jones [Wed, 13 Aug 2014 10:27:34 +0000 (11:27 +0100)]
iio: sensors-core: st: Check st_sensors_set_drdy_int_pin()'s return value

Value from st_sensors_set_drdy_int_pin() is assigned to err here,
but that stored value is not used before it is overwritten.  To fix
this we're enforcing a check on st_sensors_set_drdy_int_pin()'s
return value and if it's an error, we're returning right away.

Cc: jic23@kernel.org
Cc: linux-iio@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agoMerge branches 'ib-mfd-arm-3.18', 'ib-mfd-hwmon-leds-watchdog-3.18' and 'ib-mfd-power...
Lee Jones [Fri, 26 Sep 2014 07:14:30 +0000 (08:14 +0100)]
Merge branches 'ib-mfd-arm-3.18', 'ib-mfd-hwmon-leds-watchdog-3.18' and 'ib-mfd-power-charger-regulator-3.18' into ibs-for-mfd-merged

10 years agohwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver
Andreas Werner [Wed, 27 Aug 2014 17:53:06 +0000 (19:53 +0200)]
hwmon: (menf21bmc) Introduce MEN14F021P00 BMC HWMON driver

Added driver to support the 14F021P00 BMC Hardware Monitoring.
The BMC is a Board Management Controller including monitoring of the
board voltages.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agoleds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver
Andreas Werner [Wed, 27 Aug 2014 17:52:36 +0000 (19:52 +0200)]
leds: leds-menf21bmc: Introduce MEN 14F021P00 BMC LED driver

Added driver to support the 14F021P00 BMC LEDs.
The BMC is a Board Management Controller including four LEDs which
can be switched on and off.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
Acked-by: Bryan Wu <cooloney@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agowatchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver
Andreas Werner [Wed, 27 Aug 2014 17:52:06 +0000 (19:52 +0200)]
watchdog: menf21bmc_wdt: Introduce MEN 14F021P00 BMC Watchdog driver

Added driver to support the 14F021P00 BMC Watchdog.
The BMC is a Board Management Controller including watchdog functionality.

Signed-off-by: Andreas Werner <andreas.werner@men.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agoDocumentation: charger: max14577: Document exported sysfs entry
Krzysztof Kozlowski [Fri, 12 Sep 2014 06:54:00 +0000 (08:54 +0200)]
Documentation: charger: max14577: Document exported sysfs entry

Document the 'fast charge timer' setting exported by max14577 driver
through sysfs entry.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agodevicetree: mfd: max14577: Add device tree bindings document
Krzysztof Kozlowski [Fri, 12 Sep 2014 06:53:59 +0000 (08:53 +0200)]
devicetree: mfd: max14577: Add device tree bindings document

Add document describing device tree bindings for MAX14577 MFD
drivers: MFD core, extcon, regulator and charger.

Both MAX14577 and MAX77836 chipsets are documented.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agopower: max17040: Add ID for MAX77836 Fuel Gauge block
Krzysztof Kozlowski [Fri, 12 Sep 2014 06:53:58 +0000 (08:53 +0200)]
power: max17040: Add ID for MAX77836 Fuel Gauge block

MAX77836 has the same Fuel Gauge as MAX17040/17048. The max17040 driver
can be safely re-used. The patch adds MAX77836 device to the array of
i2c_device_id. Additionally it removes the id associated with MAX17040
device as the value is not used.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agocharger: max14577: Configure battery-dependent settings from DTS and sysfs
Krzysztof Kozlowski [Fri, 12 Sep 2014 06:53:57 +0000 (08:53 +0200)]
charger: max14577: Configure battery-dependent settings from DTS and sysfs

Remove hard-coded values for:
 - Fast Charge current,
 - End Of Charge current,
 - Fast Charge timer,
 - Overvoltage Protection Threshold,
 - Battery Constant Voltage,
and use DTS or sysfs to configure them. This allows using the max14577 charger
driver with different batteries.

Now the charger driver requires valid configuration data from DTS. In
case of wrong configuration data it fails during probe.

The fast charge timer is configured through sysfs entry.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agoregulator/mfd: max14577: Export symbols for calculating charger current
Krzysztof Kozlowski [Fri, 12 Sep 2014 06:53:56 +0000 (08:53 +0200)]
regulator/mfd: max14577: Export symbols for calculating charger current

This patch prepares for changing the max14577 charger driver to allow
configuring battery-dependent settings from DTS.

The patch moves from regulator driver to MFD core driver and exports:
 - function for calculating register value for charger's current;
 - table of limits for chargers (MAX14577, MAX77836).

Previously they were used only by the max14577 regulator driver. In next
patch the charger driver will use them as well. Exporting them will
reduce unnecessary code duplication.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Mark Brown <broonie@linaro.org>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agocharger: max14577: Add support for MAX77836 charger
Krzysztof Kozlowski [Fri, 12 Sep 2014 06:53:55 +0000 (08:53 +0200)]
charger: max14577: Add support for MAX77836 charger

Add support for MAX77836 charger to the max14577 driver. The MAX77836
charger is almost the same as 14577 model except:
 - No dead-battery detection;
 - Support for special charger (like in MAX77693);
 - Support for DX over-voltage protection (like in MAX77693);
 - Lower values of charging current (two times lower current for
   slow/fast charge, much lower EOC current);
 - Slightly different values in ChgTyp field of STATUS2 register. On
   MAX14577 0x6 is reserved and 0x7 dead battery. On the MAX77836 the
   0x6 means special charger and 0x7 is reserved. Regardless of these
   differences the driver maps them to one enum max14577_muic_charger_type.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: max14577: Map charger device to its own of_node
Krzysztof Kozlowski [Fri, 12 Sep 2014 06:53:54 +0000 (08:53 +0200)]
mfd: max14577: Map charger device to its own of_node

Add a "maxim,max14577-charger" of_compatible to the mfd_cell so the
MFD child device (the charger) will have its own of_node set. This will
be used by the max14577 charger driver in next patches to obtain battery
configuration from DTS.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agomfd: max14577: Add defines for MAX77836 charger
Krzysztof Kozlowski [Fri, 12 Sep 2014 06:53:53 +0000 (08:53 +0200)]
mfd: max14577: Add defines for MAX77836 charger

Prepare for adding support for MAX77836 charger to the max14577 charger
driver by adding necessary new defines and prefixes to existing ones.

The MAX77836 uses slightly different values for ChgTyp field of STATUS2
register. On the MAX14577 value of 0x6 is reserved and 0x7 dead battery.
On the MAX77836 the opposite:
 - 0x6 means special charger,
 - 0x7 is reserved.
Regardless of these differences use one common enum
max14577_muic_charger_type.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
10 years agomfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver
Andreas Werner [Wed, 27 Aug 2014 17:51:45 +0000 (19:51 +0200)]
mfd: menf21bmc: Introduce MEN 14F021P00 BMC MFD Core driver

The MEN 14F021P00 Board Management Controller provides an
I2C interface to the host to access the feature implemented in the BMC.
The BMC is a PIC Microntroller assembled on CPCI Card from MEN Mikroelektronik
and on a few Box/Display Computer.

Added MFD Core driver, supporting the I2C communication to the device.

The MFD driver currently supports the following features:
  - Watchdog
  - LEDs
- Hwmon (voltage monitoring)

Signed-off-by: Andreas Werner <andreas.werner@men.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agodevicetree: Dialog Semiconductor consolidate existing vendor prefixes to standardise...
Steve Twiss [Fri, 22 Aug 2014 14:26:55 +0000 (15:26 +0100)]
devicetree: Dialog Semiconductor consolidate existing vendor prefixes to standardise on 'dlg'

This patch series updates the device tree vendor prefix for
Dialog Semiconductor.

Various methods are currently used throughout the kernel: 'diasemi',
'dialog' and 'dlg'. Others have also been suggested.

This patch set aims to consolidate the usage of the vendor prefix to
use a common standard. The prefix 'dlg' is used.

Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>
Acked-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
10 years agoLinux 3.17-rc2
Linus Torvalds [Mon, 25 Aug 2014 22:36:20 +0000 (15:36 -0700)]
Linux 3.17-rc2

10 years agoMerge tag 'nfs-for-3.17-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
Linus Torvalds [Mon, 25 Aug 2014 22:34:28 +0000 (15:34 -0700)]
Merge tag 'nfs-for-3.17-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs

Pull NFS client fixes from Trond Myklebust:
 "Highlights:

   - more fixes for read/write codepath regressions
     * sleeping while holding the inode lock
     * stricter enforcement of page contiguity when coalescing requests
     * fix up error handling in the page coalescing code

   - don't busy wait on SIGKILL in the file locking code"

* tag 'nfs-for-3.17-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
  nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait
  nfs: can_coalesce_requests must enforce contiguity
  nfs: disallow duplicate pages in pgio page vectors
  nfs: don't sleep with inode lock in lock_and_join_requests
  nfs: fix error handling in lock_and_join_requests
  nfs: use blocking page_group_lock in add_request
  nfs: fix nonblocking calls to nfs_page_group_lock
  nfs: change nfs_page_group_lock argument

10 years agoMerge tag 'renesas-sh-drivers-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Mon, 25 Aug 2014 22:29:33 +0000 (15:29 -0700)]
Merge tag 'renesas-sh-drivers-for-v3.17' of git://git./linux/kernel/git/horms/renesas

Pull SH driver fix from Simon Horman:
 "Confine SH_INTC to platforms that need it"

* tag 'renesas-sh-drivers-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
  sh: intc: Confine SH_INTC to platforms that need it

10 years agoMerge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Linus Torvalds [Mon, 25 Aug 2014 22:28:57 +0000 (15:28 -0700)]
Merge branch 'upstream' of git://git.linux-mips.org/ralf/upstream-linus

Pull MIPS fixes from Ralf Baechle:
 "Pretty much all across the field so with this we should be in
  reasonable shape for the upcoming -rc2"

* 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
  MIPS: OCTEON: make get_system_type() thread-safe
  MIPS: CPS: Initialize EVA before bringing up VPEs from secondary cores
  MIPS: Malta: EVA: Rename 'eva_entry' to 'platform_eva_init'
  MIPS: EVA: Add new EVA header
  MIPS: scall64-o32: Fix indirect syscall detection
  MIPS: syscall: Fix AUDIT value for O32 processes on MIPS64
  MIPS: Loongson: Fix COP2 usage for preemptible kernel
  MIPS: NL: Fix nlm_xlp_defconfig build error
  MIPS: Remove race window in page fault handling
  MIPS: Malta: Improve system memory detection for '{e, }memsize' >= 2G
  MIPS: Alchemy: Fix db1200 PSC clock enablement
  MIPS: BCM47XX: Fix reboot problem on BCM4705/BCM4785
  MIPS: Remove duplicated include from numa.c
  MIPS: Add common plat_irq_dispatch declaration
  MIPS: MSP71xx: remove unused plat_irq_dispatch() argument
  MIPS: GIC: Remove useless parens from GICBIS().
  MIPS: perf: Mark pmu interupt IRQF_NO_THREAD

10 years agoMerge tag 'trace-fixes-v3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Mon, 25 Aug 2014 22:11:53 +0000 (15:11 -0700)]
Merge tag 'trace-fixes-v3.17-rc1' of git://git./linux/kernel/git/rostedt/linux-trace

Pull fix for ftrace function tracer/profiler conflict from Steven Rostedt:
 "The rewrite of the ftrace code that makes it possible to allow for
  separate trampolines had a design flaw with the interaction between
  the function and function_graph tracers.

  The main flaw was the simplification of the use of multiple tracers
  having the same filter (like function and function_graph, that use the
  set_ftrace_filter file to filter their code).  The design assumed that
  the two tracers could never run simultaneously as only one tracer can
  be used at a time.  The problem with this assumption was that the
  function profiler could be implemented on top of the function graph
  tracer, and the function profiler could run at the same time as the
  function tracer.  This caused the assumption to be broken and when
  ftrace detected this failed assumpiton it would spit out a nasty
  warning and shut itself down.

  Instead of using a single ftrace_ops that switches between the
  function and function_graph callbacks, the two tracers can again use
  their own ftrace_ops.  But instead of having a complex hierarchy of
  ftrace_ops, the filter fields are placed in its own structure and the
  ftrace_ops can carefully use the same filter.  This change took a bit
  to be able to allow for this and currently only the global_ops can
  share the same filter, but this new design can easily be modified to
  allow for any ftrace_ops to share its filter with another ftrace_ops.

  The first four patches deal with the change of allowing the ftrace_ops
  to share the filter (and this needs to go to 3.16 as well).

  The fifth patch fixes a bug that was also caused by the new changes
  but only for archs other than x86, and only if those archs implement a
  direct call to the function_graph tracer which they do not do yet but
  will in the future.  It does not need to go to stable, but needs to be
  fixed before the other archs update their code to allow direct calls
  to the function_graph trampoline"

* tag 'trace-fixes-v3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
  ftrace: Use current addr when converting to nop in __ftrace_replace_code()
  ftrace: Fix function_profiler and function tracer together
  ftrace: Fix up trampoline accounting with looping on hash ops
  ftrace: Update all ftrace_ops for a ftrace_hash_ops update
  ftrace: Allow ftrace_ops to use the hashes from other ops

10 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 24 Aug 2014 23:17:41 +0000 (16:17 -0700)]
Merge branch 'x86-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:
 "A couple of EFI fixes, plus misc fixes all around the map"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  efi/arm64: Store Runtime Services revision
  firmware: Do not use WARN_ON(!spin_is_locked())
  x86_32, entry: Clean up sysenter_badsys declaration
  x86/doc: Fix the 'tlb_single_page_flush_ceiling' sysconfig path
  x86/mm: Fix sparse 'tlb_single_page_flush_ceiling' warning and make the variable read-mostly
  x86/mm: Fix RCU splat from new TLB tracepoints

10 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 24 Aug 2014 23:16:55 +0000 (16:16 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull perf fixes from Ingo Molnar:
 "A kprobes and a perf compat ioctl fix"

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf: Handle compat ioctl
  kprobes: Skip kretprobe hit in NMI context to avoid deadlock

10 years agoMerge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
Linus Torvalds [Sun, 24 Aug 2014 22:57:00 +0000 (15:57 -0700)]
Merge tag 'fixes-for-linus' of git://git./linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "A collection of fixes from this week, it's been pretty quiet and
  nothing really stands out as particularly noteworthy here -- mostly
  minor fixes across the field:

   - ODROID booting was fixed due to PMIC interrupts missing in DT
   - a collection of i.MX fixes
   - minor Tegra fix for regulators
   - Rockchip fix and addition of SoC-specific mailing list to make it
     easier to find posted patches"

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  bus: arm-ccn: Fix warning message
  ARM: shmobile: koelsch: Remove non-existent i2c6 pinmux
  ARM: tegra: apalis/colibri t30: fix on-module 5v0 supplies
  MAINTAINERS: add new Rockchip SoC list
  ARM: dts: rockchip: readd missing mmc0 pinctrl settings
  ARM: dts: ODROID i2c improvements
  ARM: dts: Enable PMIC interrupts on ODROID
  ARM: dts: imx6sx: fix the pad setting for uart CTS_B
  ARM: dts: i.MX53: fix apparent bug in VPU clks
  ARM: imx: correct gpu2d_axi and gpu3d_axi clock setting
  ARM: dts: imx6: edmqmx6: change enet reset pin
  ARM: dts: vf610-twr: Fix pinctrl_esdhc1 pin definitions.
  ARM: imx: remove unnecessary ARCH_HAS_OPP select
  ARM: imx: fix TLB missing of IOMUXC base address during suspend
  ARM: imx6: fix SMP compilation again
  ARM: dt: sun6i: Add #address-cells and #size-cells to i2c controller nodes

10 years agoMerge tag 'gpio-v3.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw...
Linus Torvalds [Sun, 24 Aug 2014 22:54:23 +0000 (15:54 -0700)]
Merge tag 'gpio-v3.17-2' of git://git./linux/kernel/git/linusw/linux-gpio

Pull gpio fixes from Linus Walleij:

 - a largeish fix for the IRQ handling in the new Zynq driver.  The
   quite verbose commit message gives the exact details.
 - move some defines for gpiod flags outside an ifdef to make stub
   functions work again.
 - various minor fixes that we can accept for -rc1.

* tag 'gpio-v3.17-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio-lynxpoint: enable input sensing in resume
  gpio: move GPIOD flags outside #ifdef
  gpio: delete unneeded test before of_node_put
  gpio: zynq: Fix IRQ handlers
  gpiolib: devres: use correct structure type name in sizeof
  MAINTAINERS: Change maintainer for gpio-bcm-kona.c

10 years agoMerge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux
Linus Torvalds [Sun, 24 Aug 2014 22:48:12 +0000 (15:48 -0700)]
Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux

Pull drm fixes from Dave Airlie:
 "Intel and radeon fixes.

  Post KS/LC git requests from i915 and radeon stacked up.  They are all
  fixes along with some new pci ids for radeon, and one maintainers file
  entry.

   - i915: display fixes and irq fixes
   - radeon: pci ids, and misc gpuvm, dpm and hdp cache"

* 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (29 commits)
  MAINTAINERS: Add entry for Renesas DRM drivers
  drm/radeon: add additional SI pci ids
  drm/radeon: add new bonaire pci ids
  drm/radeon: add new KV pci id
  Revert "drm/radeon: Use write-combined CPU mappings of ring buffers with PCIe"
  drm/radeon: fix active_cu mask on SI and CIK after re-init (v3)
  drm/radeon: fix active cu count for SI and CIK
  drm/radeon: re-enable selective GPUVM flushing
  drm/radeon: Sync ME and PFP after CP semaphore waits v4
  drm/radeon: fix display handling in radeon_gpu_reset
  drm/radeon: fix pm handling in radeon_gpu_reset
  drm/radeon: Only flush HDP cache for indirect buffers from userspace
  drm/radeon: properly document reloc priority mask
  drm/i915: don't try to retrain a DP link on an inactive CRTC
  drm/i915: make sure VDD is turned off during system suspend
  drm/i915: cancel hotplug and dig_port work during suspend and unload
  drm/i915: fix HPD IRQ reenable work cancelation
  drm/i915: take display port power domain in DP HPD handler
  drm/i915: Don't try to enable cursor from setplane when crtc is disabled
  drm/i915: Skip load detect when intel_crtc->new_enable==true
  ...

10 years agoaio: fix reqs_available handling
Benjamin LaHaise [Sun, 24 Aug 2014 17:14:05 +0000 (13:14 -0400)]
aio: fix reqs_available handling

As reported by Dan Aloni, commit f8567a3845ac ("aio: fix aio request
leak when events are reaped by userspace") introduces a regression when
user code attempts to perform io_submit() with more events than are
available in the ring buffer.  Reverting that commit would reintroduce a
regression when user space event reaping is used.

Fixing this bug is a bit more involved than the previous attempts to fix
this regression.  Since we do not have a single point at which we can
count events as being reaped by user space and io_getevents(), we have
to track event completion by looking at the number of events left in the
event ring.  So long as there are as many events in the ring buffer as
there have been completion events generate, we cannot call
put_reqs_available().  The code to check for this is now placed in
refill_reqs_available().

A test program from Dan and modified by me for verifying this bug is available
at http://www.kvack.org/~bcrl/20140824-aio_bug.c .

Reported-by: Dan Aloni <dan@kernelim.com>
Signed-off-by: Benjamin LaHaise <bcrl@kvack.org>
Acked-by: Dan Aloni <dan@kernelim.com>
Cc: Kent Overstreet <kmo@daterainc.com>
Cc: Mateusz Guzik <mguzik@redhat.com>
Cc: Petr Matousek <pmatouse@redhat.com>
Cc: stable@vger.kernel.org # v3.16 and anything that f8567a3845ac was backported to
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agobus: arm-ccn: Fix warning message
Pawel Moll [Mon, 18 Aug 2014 17:20:49 +0000 (18:20 +0100)]
bus: arm-ccn: Fix warning message

A message warning a user about wrong vc value was printing
out port instead.

Reported-by: Drew Richardson <drew.richardson@arm.com>
Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoARM: shmobile: koelsch: Remove non-existent i2c6 pinmux
Geert Uytterhoeven [Thu, 14 Aug 2014 22:19:10 +0000 (07:19 +0900)]
ARM: shmobile: koelsch: Remove non-existent i2c6 pinmux

On r8a7791, i2c6 (aka iic3) doesn't need pinmux, but the koelsch dts
refers to non-existent pinmux configuration data:

pinmux core: sh-pfc does not support function i2c6
sh-pfc e6060000.pfc: invalid function i2c6 in map table

Remove it to fix this.

Fixes: commit 1d41f36a68c0f4e9b01d563ce33bab5201858b54 ("ARM: shmobile:
       koelsch dts: Add VDD MPU regulator for DVFS")

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Olof Johansson <olof@lixom.net>
10 years agoARM: tegra: apalis/colibri t30: fix on-module 5v0 supplies
Marcel Ziswiler [Fri, 22 Aug 2014 19:25:10 +0000 (13:25 -0600)]
ARM: tegra: apalis/colibri t30: fix on-module 5v0 supplies

Working on Gigabit/PCIe support in U-Boot for Apalis T30 I realised
that the current device tree source includes for our modules only
happen to work due to referencing the on-carrier 5v0 supply from USB
which is not at all available on-module. The modules actually contain
TPS60150 charge pumps to generate the PMIC required 5 volts from the
one and only 3.3 volt module supply. This patch fixes this.

(Note: When back-porting this to v3.16 stable releases, simply drop the
change to tegra30-apalis.dtsi; that file was added in v3.17)

Cc: <stable@vger.kernel.org> #v3.16+
Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>