Commit Graph

2676 Commits

Author SHA1 Message Date
Mark Brown 3e683126f4 Merge remote-tracking branches 'regulator/topic/mt6311', 'regulator/topic/ocp', 'regulator/topic/owner', 'regulator/topic/pfuze100' and 'regulator/topic/pwm' into regulator-next 2015-08-30 14:39:48 +01:00
Mark Brown 176175b613 Merge remote-tracking branches 'regulator/topic/lp872x', 'regulator/topic/ltc3589', 'regulator/topic/max77693' and 'regulator/topic/max8973' into regulator-next 2015-08-30 14:39:34 +01:00
Mark Brown 11f2482366 Merge remote-tracking branches 'regulator/topic/da9210', 'regulator/topic/da9211', 'regulator/topic/fan53555', 'regulator/topic/isl9305' and 'regulator/topic/list' into regulator-next 2015-08-30 14:39:14 +01:00
Mark Brown 08aad16c80 Merge remote-tracking branches 'regulator/topic/88pm800', 'regulator/topic/ad5398', 'regulator/topic/axp20x' and 'regulator/topic/da9062' into regulator-next 2015-08-30 14:38:50 +01:00
Mark Brown eaf018e170 Merge remote-tracking branch 'regulator/topic/core' into regulator-next 2015-08-30 14:38:46 +01:00
Mark Brown e616e2f11b Merge remote-tracking branch 'regulator/fix/pbias' into regulator-linus 2015-08-30 14:38:37 +01:00
kbuild test robot 6d73aef117 regulator: mt6311: fix platform_no_drv_owner.cocci warnings
drivers/regulator/mt6311-regulator.c:169:3-8: No need to set .owner here. The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30 14:34:50 +01:00
Javier Martinez Canillas 6cb6e6be41 regulator: ltc3589: Remove unnecessary MODULE_ALIAS()
The driver has a I2C device id table that is used to create the modaliases
and already contains a "ltc3589" device id. So the modalias is unnecessary.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30 12:21:54 +01:00
Javier Martinez Canillas ce317515b4 regulator: ad5398: Remove unnecessary MODULE_ALIAS()
The driver has a I2C device id table that is used to create the modaliases
and also "ad5398-regulator" is not a supported I2C id, so it's never used.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30 12:21:01 +01:00
Javier Martinez Canillas a02daad702 regulator: pfuze100: Remove unnecessary MODULE_ALIAS()
The driver has a I2C device id table that is used to create the modaliases
and also "pfuze100-regulator" is not a supported I2C id, so is never used.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-29 10:37:20 +01:00
Archit Taneja 099982fac0 regulator: core: use debug level print in regulator_check_drms
When calling regulator_set_load, regulator_check_drms prints and returns
an error if the regulator device's flag REGULATOR_CHANGE_DRMS isn't set.
drms_uA_update, however, bails out without reporting an error.

Replace the error print with a debug level print so that we don't get
such prints when the underlying regulator doesn't support DRMS.

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-28 18:42:31 +01:00
Milo Kim 804486b19d regulator: lp872x: handle error case
If memory allocation gets failed on parsing the DT, then it returns error
'-ENOMEM' explicitly. Then, the driver exists from the _probe().

Signed-off-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-25 19:36:24 +01:00
Milo Kim d9ffae15f7 regulator: lp872x: use the private data instead of updating I2C device platform data
Currently, lp872x driver parses the DT and copies values into the
'cl->dev.platform_data' if 'of_node' exists.
This may have architectural issue. Platform data is configurable through
the DT or I2C board info inside the platform area.
However, lp872x driver changes this configuration when it is loaded.

The lp872x driver should get data from the platform side and use the private
data, 'lp872x->pdata' instead of changing the original platform data.

Signed-off-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-25 19:36:15 +01:00
Javier Martinez Canillas 5b87af4cca regulator: isl9305: Export OF module alias information
The I2C core always reports the MODALIAS uevent as "i2c:<modalias>"
regardless of the mechanism that was used to register the device
(i.e: OF or board code) and the table that is used later to match
the driver with the device (i.e: I2C id table or OF match table).

So drivers needs to export the I2C id table and this be built into
the module or udev won't have the necessary information to autoload
the needed driver module when the device is added.

But this means that OF-only drivers needs to have both OF and I2C id
tables that have to be kept in sync and also the dev node compatible
manufacturer prefix is stripped when reporting the MODALIAS. Which can
lead to issues if two vendors use the same I2C device name for example.

To avoid the above, the I2C core behavior may be changed in the future
to not require an SPI device table for OF-only drivers and report the
OF module alias. So, it's better to also export the OF table even when
is unused now to prevent breaking module loading when the core changes.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-25 17:18:09 +01:00
Marek Szyprowski ee3010d0ab regulators: max77693: register driver earlier to avoid deferred probe
MAX77693 based regulators are used by USB gadget subsystem, which
doesn't support deferred probe, so the driver should be registered
before USB gadget drivers get probed.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-21 09:07:45 -07:00
Axel Lin 5a286aae3d regulator: qcom_smd: Set n_voltages for pm8941_lnldo
Just setting fixed_uV is not enough, the regulator core will also check
n_voltages setting. The fixed_uV only works when n_voltages is 1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-19 09:21:00 -07:00
Viresh Kumar 9357684271 regulator: core: Use IS_ERR_OR_NULL()
Use IS_ERR_OR_NULL() rather than open coding it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-17 13:05:29 -07:00
Bjorn Andersson da65e367b6 regulator: Regulator driver for the Qualcomm RPM
Driver for regulators exposed by the Resource Power Manager (RPM) found
in devices based on Qualcomm 8974 and newer platforms.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Acked-by: Andy Gross <agross@codeaurora.org>
Tested-by: Tim Bird <tim.bird@sonymobile.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-17 12:52:57 -07:00
Stephen Boyd ad3a942bd2 regulator: core: Print at debug level on debugfs creation failure
Failure to create a debugfs node is not an error, but we print a
warning upon failure to create the node. Downgrade this to a
debug printk so that we're quiet here. This allows multiple
drivers to request a CPU's regulator so that CPUfreq and AVSish
drivers can coexist.

The downside of this approach is that whoever gets to debugfs first
the others who come later to not have any debugfs attributes associated
with them.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-14 20:25:50 +01:00
Kishon Vijay Abraham I c329061be5 regulator: pbias: Fix broken pbias disable functionality
regulator_disable of pbias always writes '0' to the enable_reg.
However actual disable value of pbias regulator is not always '0'.
Fix it by populating the disable_val in pbias_reg_info for the
various platforms and assign it to the disable_val of
pbias regulator descriptor. This will be used by
regulator_disable_regmap while disabling pbias regulator.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
2015-08-14 19:01:58 +01:00
Viresh Kumar d3fb980014 regulator: core: Spelling fix
Trivial spell fix, s/succesfully/successfully.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-13 14:15:18 +01:00
Mark Brown 609ca5f3cb regulator: core: Use class device list for regulator_list in late init
The regulator_list has exactly the same contents as the list that the
driver core maintains of regulator_class members so is redundant. As a
first step in converting over to use the class device list convert our
iteration in late_initcall() to use the class device iterator.

Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-12 13:21:14 +01:00
Mark Brown 29f5f4860a regulator: core: Move more deallocation into class unregister
We really ought to be using the class dvice lifetime management features
more than we are rather than open coding them so take a step towards that
by moving some of the simplest deallocations to the dev_release() function.

Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-12 11:01:30 +01:00
Mark Brown 1768514eeb regulator: core: Reduce rdev locking region when releasing regulator
When we release a regulator we need to remove references to it from the
rdev which means locking the rdev.  Currently we also free resources
associated with the regulator inside the rdev lock but there is no need
to do this, we can reduce the region the lock is held by restricting it
to just actions that affect the rdev.

Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-12 11:01:29 +01:00
Mark Brown 7cd71c3ba1 regulator: core: Drop regulator_list_mutex when we're done with it on remove
When removing a regulator we hold regulator_list_mutex in order to
ensure the regualtor doesn't become removed again.  However we only need
to protect the list until we remove the regulator from the list so move
the unlock earlier to reduce the locked region.

Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-07 13:03:20 +01:00
Ian Campbell d4ea7d8645 regulator: axp20x: Add module alias
This allows the module to be autoloaded.

Together with 07949bf9c6 ("cpufreq: dt: allow driver to boot
automatically") this is sufficient to allow a modular kernel (such
as Debian's) to enable cpufreq on a Cubietruck.

Signed-off-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-04 18:29:00 +01:00
Axel Lin 08b472f7b6 regulator: mt6311: Trivial clean up
Make mt6311_buck_ops, mt6311_ldo_ops and mt6311_regulators const and remove
unneeded error variable in mt6311_i2c_probe().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-03 17:22:37 +01:00
Henry Chen 53e381627d regulator: mt6311: Modify the maximum voltage of buck.
The maximum voltage of buck should be 1.39375V.
1.39375V = 0.6V + 0.00625V * 127, 127 is the max_sel of linear range.

Reported-by: Axel Lin <axel.lin@ingics.com>
signed-off-by: Henry Chen <henryc.chen@mediatek.com>

Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-03 17:03:20 +01:00
Javier Martinez Canillas e80c47bd73 regulator: fan53555: Export I2C module alias information
The I2C core always reports the MODALIAS uevent as "i2c:<client name"
regardless if the driver was matched using the I2C id_table or the
of_match_table. So the driver needs to export the I2C table and this
be built into the module or udev won't have the necessary information
to auto load the correct module when the device is added.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-31 18:15:21 +01:00
Mikko Perttunen b10c7f3cc9 regulator: max8973: Set VSEL regmap ops if DVS GPIO is not set
Use regmap helpers for get_voltage_sel and set_voltage_sel ops
if the DVS GPIO is not set.

The DVS GPIO allows on the fly selection of the VSEL register
from two choices. However, if it is not set, the VSEL register
will stay fixed and we can use the regmap ops. This allows use
of the *hardware_vsel* regulator APIs.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-29 14:55:51 +01:00
Stephen Boyd e2adfacde6 regulator: qcom-spmi: Add vendor specific configuration
Add support for over current protection (OCP), pin control
selection, soft start strength, and auto-mode.

Cc: <devicetree@vger.kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-24 18:29:45 +01:00
Mark Brown 41dae91a72 Merge branch 'topic/ocp' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-qcom-spmi 2015-07-24 18:29:31 +01:00
Stephen Boyd 3a003baeec regulator: Add over current protection (OCP) support
Some regulators can automatically shut down when they detect an
over current event. Add an op (set_over_current_protection) and a
DT property + constraint to support this capability.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-24 18:28:46 +01:00
Mark Brown 4c7d83e8a8 Merge remote-tracking branches 'regulator/fix/88pm800', 'regulator/fix/max8973', 'regulator/fix/s2mps11' and 'regulator/fix/supply' into regulator-linus 2015-07-24 16:19:25 +01:00
Henry Chen 8766018b6e regulator: mt6311: Add support for mt6311 regulator
Add regulator support for mt6311.
It has 2 regulaotrs - Buck and LDO, provide the related buck/ldo voltage
data to the driver, and creates the regulator_desc table. Supported
operations for Buck are enabled/disabled and voltage change, only
enabled/disabled for LDO.

Signed-off-by: Henry Chen <henryc.chen@mediatek.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-24 12:30:49 +01:00
Daniel Kurtz a70f0d027c regulator: tps6586x: silence pointer-to-int-cast
of_regulator_match.driver_data is (void *).  tps6586x uses it to store an
anonymous enum value (those TPS6586X_ID_ values).

Later, it tries to extract the ID by casting directly to an int, which is a
no-no ([-Wpointer-to-int-cast]):

drivers/regulator/tps6586x-regulator.c: In function 'tps6586x_parse_regulator_dt':
drivers/regulator/tps6586x-regulator.c:430:8: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   id = (int)tps6586x_matches[i].driver_data;
        ^

Instead of casting to int, uintptr_t is better suited for receiving and
comparing integers extracted from void *.  This is especially true on
64-bit systems where sizeof(void *) != sizeof(int).

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-23 15:58:33 +01:00
Uwe Kleine-König a13eaf02e2 regulator: rk808: make better use of the gpiod API
The gpiod functions include variants for managed gpiod resources. Use it
to simplify the remove function.

As the driver handles a device node without a specification of dvs gpios
just fine, additionally use the variant of gpiod_get exactly for this
use case. This makes error checking more strict.

As a third benefit this patch makes the driver use the flags parameter
of gpiod_get* which will not be optional any more after 4.2 and so
prevents a build failure when the respective gpiod commit is merged.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-21 17:11:30 +01:00
Uwe Kleine-König 604d499427 regulator: rk808: add #include for gpiod functions
This fixes a build problem on mips found by the kbuild test robot:

drivers/regulator/rk808-regulator.c: In function 'rk808_buck1_2_get_voltage_sel_regmap':
drivers/regulator/rk808-regulator.c:97:2: error: implicit declaration of function 'gpiod_get_value' [-Werror=implicit-function-declaration]
  if (IS_ERR(gpio) || gpiod_get_value(gpio) == 0)
  ^

Fixes: bad47ad2ee ("regulator: rk808: fixed the overshoot when adjust voltage")
Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-21 17:11:29 +01:00
Chris Zhong bad47ad2ee regulator: rk808: fixed the overshoot when adjust voltage
There is a overshoot in DCDC1/DCDC2, we have 2 method to workaround:
1st is use dvs pin to switch the voltage between value in BUCKn_ON_VSEL
and BUCKn_DVS_VSEL. If DVS pin is inactive, the voltage of DCDC1/DCDC2
are controlled by BUCKn_ON_VSEL, when we pull dvs1/dvs2 pin to active,
they would be controlled by BUCKn_DVS_VSEL. In this case, the ramp rate
is same as the value programmed in BUCKn_RATE, and the fastest rate is
10mv/us.
2nd method is gradual adjustment, adjust the voltage to a target value
step by step via i2c, each step is set to 100 mA. If you write the
voltage directly using an i2c write the rk808 will always ramp as fast
as it possibly can, about 100mv/us.

Signed-off-by: Chris Zhong <zyw@rock-chips.com>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-20 18:40:44 +01:00
Mark Brown bf1fc23c80 Merge branch 'fix/88pm800' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-88pm800
Conflicts:
	drivers/regulator/88pm800.c
2015-07-17 12:42:48 +01:00
Krzysztof Kozlowski 2a32b401a1 regulator: Remove the max77843 driver
The max77693 regulator driver supports Maxim 77843 device so remove the
max77843 driver.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 21:39:30 +01:00
Krzysztof Kozlowski 9e9a08e867 regulator: max77693: Add support for MAX77843 device
The charger and safeout parts of MAX77843 are almost the same as MAX77693.
From regulator point of view the only differences are the constraints
and register values related to these constraints. Now the max77693
regulator driver can be used for MAX77843 device.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 21:39:30 +01:00
Krzysztof Kozlowski bc1aadc186 drivers: max77843: Switch to common max77693 state container
Switch to the same definition of state container as in MAX77693 drivers.
This will allow usage of one regulator driver in both devices: MAX77693
and MAX77843.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 21:39:30 +01:00
Krzysztof Kozlowski 61b305cd2a drivers: max77693: Move state container to common header
This prepares for merging some of the drivers between max77693 and
max77843 so the child MFD driver can be attached to any parent MFD main
driver.

Move the state container to common header file. Additionally add
consistent 'i2c' prefixes to its members (of 'struct i2c_client' type).

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Acked-by: Sebastian Reichel <sre@kernel.org>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 21:39:30 +01:00
Krzysztof Kozlowski 5b5e771fb7 regulator: max77693: Support different register configurations
Add support for different configurations of charger's registers so the
same driver could be used on other devices (e.g. MAX77843).

Signed-off-by: Krzysztof Kozlowski <k.kozlowski.k@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 21:39:29 +01:00
Javier Martinez Canillas 36a1f1b6dd regulator: core: Fix memory leak in regulator_resolve_supply()
The regulator_resolve_supply() function calls set_supply() which in turn
calls create_regulator() to allocate a supply regulator.

If an error occurs after set_supply() succeeded, the allocated regulator
has to be freed before propagating the error code.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 21:38:59 +01:00
Javier Martinez Canillas e2c09ae7a7 regulator: core: Increase refcount for regulator supply's module
When a regulator is unregistered with regulator_unregister(), a call to
regulator_put() is made for its input supply if there is one. This does
a module_put() to decrement the refcount of the module that owns the
supply but there isn't a corresponding try_module_get() in set_supply()
to make the calls balanced.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 21:38:59 +01:00
Vaibhav Hiremath fa26e4d2b3 regulator: 88pm800: Use regulator_nodes/of_match in the descriptor
This patch is add regulator_nodes/of_match in the regulator
descriptor for using information from DT instead of specific codes.

With this patch, driver gets simplified,

  - No need to maintain "struct of_regulator_match" table
    and call of_regulator_match() fn.
  - No need for pm800_regulator_dt_init() fn, as it was only
    used for of_regulator_match().
  - probe() fn got simplified around regulator_config and regulator_desc
    initialization.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 21:32:58 +01:00
Vaibhav Hiremath a07d94a54b regulator: 88pm800: Update driver to use devm_regulator_register fn
This patch replaces standard regulator_register with
devm_regulator_register() fn, as using devm_regulator_register() fn
simplifies the driver return/exit path.

As part of this update, patch also cleanups up all unnecessary changes
which is result of this patch -

  - Remove _remove() fn, as devm_ variant takes care of it.
  - Remove pm800_regulators.regulators[] field, as it was only
    needed during cleanup, so we no longer need this.
    This also saved some amount of memory.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 21:32:58 +01:00
Vaibhav Hiremath 4d45c70bfb regulator: 88pm800: Fix indentation of assignments of data structures
This patch makes code more clean from readability point of view,
make all assignments of LDO, BUCk and regulator_ops structure
at the same indentation.

Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-16 21:32:58 +01:00
Mark Brown 9f7e25edb1 regulator: core: Handle full constraints systems when resolving supplies
When resolving device supplies if we fail to look up the regulator we
substitute in the dummy supply instead if the system has fully specified
constraints. When resolving supplies for regulators we do not have the
equivalent code and instead just directly use the regulator_dev_lookup()
result causing spurious failures.

This does not affect DT systems since we are able to detect missing
mappings directly as part of regulator_dev_lookup() and so have appropriate
handling in the DT specific code.

Reported-by: Christian Hartmann <cornogle@googlemail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-15 12:19:44 +01:00
Krzysztof Kozlowski a807a6cc29 regulator: drivers: Drop owner assignment from i2c_driver
i2c_driver does not need to set an owner because i2c_register_driver()
will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-14 18:53:01 +01:00
Krzysztof Kozlowski 736050c4c1 regulator: da9062: Drop owner assignment from platform_driver
platform_driver does not need to set an owner because
platform_driver_register() will set it.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-14 18:48:19 +01:00
James Ban 7bd3935432 regulator: da9211: support da9215
This is a patch for supporting da9215 buck converter.

Signed-off-by: James Ban <james.ban.opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-13 19:11:24 +01:00
Geert Uytterhoeven 4245746037 regulator: da9210: Add optional interrupt support
Add optional interrupt support to the da9210 regulator driver, to handle
over-current, under- and over-voltage, and over-temperature events.

Only the interrupt sources for which we handle events are unmasked, to
avoid interrupts we cannot handle.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-13 11:19:28 +01:00
Lee Jones 60cb65ebf4 regulator: pwm-regulator: Fix ' comparison between signed and unsigned integer' warning
drivers/regulator/pwm-regulator.c:
  In function ‘pwm_regulator_init_table’:
drivers/regulator/pwm-regulator.c:171:14:
  warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-10 19:34:06 +01:00
Lee Jones b343e08f3c regulator: pwm-regulator: Fix 'used uninitialized' warning
drivers/regulator/pwm-regulator.c:
  In function 'pwm_regulator_init_table':
drivers/regulator/pwm-regulator.c:172:14:
  warning: 'length' is used uninitialized in this function [-Wuninitialized]
    if ((length < sizeof(*duty_cycle_table)) ||
              ^
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-10 19:34:06 +01:00
Lee Jones f293634b5a regulator: pwm-regulator: Fix 'unused-variable' warning
drivers/regulator/pwm-regulator.c:
  In function 'pwm_regulator_init_continuous':
drivers/regulator/pwm-regulator.c:202:22:
  warning: unused variable 'np' [-Wunused-variable]
     struct device_node *np = pdev->dev.of_node;
              ^
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-10 19:34:06 +01:00
Yi Zhang 322dfa6402 regulator: 88pm800: fix LDO vsel_mask value
As per datasheet,
Except LDO2, all other LDO's use bit [3:0] for VOUT select.

Current code uses wrong mask value of 0x1f, So this patch
fixes it to use 0xf.

Signed-off-by: Yi Zhang <yizhang@marvell.com>
[vaibhav.hiremath@linaro.org: Updated changelog with more detailed description]
Signed-off-by: Vaibhav Hiremath <vaibhav.hiremath@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-09 20:04:25 +01:00
Axel Lin 5d506a5ad4 regulator: qcom_spmi-regulator: Use DIV_ROUND_UP instead of open-coded
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-09 19:02:42 +01:00
Lee Jones f3f6439d86 regulator: pwm-regulator: Small clean-ups
Remove over-bracketing, use framework API to fetch PWM period and
be more forthcoming that pwm_voltage_to_duty_cycle() actually returns
duty cycle as a percentage, rather than a register value.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-09 18:54:25 +01:00
Lee Jones f747a1fe78 regulator: pwm-regulator: Remove obsoleted property
In "[3d7ef30] regulator: pwm-regulator: Simplify voltage to duty-cycle
call" we stopped using max_duty_cycle, so we can retire it from device
data and DT.

There is no need to deprecate this property, as it hasn't hit Mainline
yet.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-09 18:54:24 +01:00
Lee Jones 5ad2cb14f5 regulator: pwm-regulator: Don't assign structure attributes right away
Perhaps this is just personal preference, but ...

This patch introduces a new local variable to receive and test regulator
initialisation data.  It simplifies and cleans up the code making it
that little bit easier to read and maintain.  The local value is assigned
to the structure attribute when all the others are.  This is the way we
usually do things.

Prevents this kind of nonsense:

	this->is->just.silly = fetch_silly_value(&pointer);
	if (!this->is->just.silly) {
		printk("Silly value failed: %d\n", this->is->just.silly);
		return this->is->just.silly;
	}

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-07 18:58:28 +01:00
Lee Jones cae897dec2 regulator: pwm-regulator: Simplify voltage to duty-cycle call
If we reverse some of the logic and change the formula used,
we can simplify the function greatly.

It is intentional that this function is supplied and then re-worked
within the same patch-set.  The submission in the previous patch is
the tried and tested (i.e. in real releases) method written by ST.
This patch contains a simplification provided later.  It looks and
performs better, but doesn't have the same time-under-test that the
original method does.  The idea is that we keep some history in
order to provide an easy way back i.e. revert.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-07 18:58:28 +01:00
Lee Jones 4773be185a regulator: pwm-regulator: Add support for continuous-voltage
The current version of PWM regulator only supports a static table
approach, where pre-calculated values are supplied by the vendor and
obtained via DT.  The continuous-voltage method takes min_uV and
max_uV, and divides the difference between them up into a number of
slices.  The number of slices depend on how large the duty cycle
register is.  This information is provided by a DT property.

As the name alludes, this provides values for a continuous voltage
range between min_uV and max_uV, which has obvious benefits over
either limited voltage possibilities, or the requirement to provide
a large voltage-table.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-07 18:58:27 +01:00
Laxman Dewangan ffaab99184 regulator: max8973: add support to configure ETR based on rail load
Add support to configure Enhanced Transient Response Enable (ETR)
and Sensitivity Selection based on maximum current i.e. expected
load on that rail.

Maxim recommended as:
- Enable ETR with high sensitivity (75mV/us) for 0 to 9A expected loads,
- Enable ETR with low sensitivity (150mV/us) for 9A to 12A expected loads.
- Disable ETR for expected load > 12A.

These recommendation will be configured for MAX77621 when maximum load
is provided through regulator constraint for maximum current from platform.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-07 14:43:53 +01:00
Laxman Dewangan 3692db3a90 regulator: max8973: add support to configure ETR from DT
The MAX8973/MAX77621 feature an Enhanced Transient Response(ETR)
circuit that is enabled through software. The enhanced transient
response reduces the voltage droop during large load steps by
temporarily allowing all three phases to fire in unison, slewing
total inductor current faster than would normally be possible if
all three phases continued to operate 120deg out of phase. The
enhanced transient response detector features two selectable
sensitivity settings, which select the output voltage slew rate
during load transients that triggers the ETR circuit. The sensitivity
of the ETR detector is set by the CKADV[1:0] bits in the CONTROL2
register.

Add support to configure the ETR through platform data from DT.
Update the DT binding document accordingly.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-07 14:43:53 +01:00
Laxman Dewangan 127e106242 regulator: max8973: Fix up control flag option for bias control
The control flag for the bias control is MAX8973_CONTROL_BIAS_ENABLE
rather than MAX8973_BIAS_ENABLE which is macro for the bits in
register.

Fix this typo.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-07 14:42:20 +01:00
Lee Jones f9178dad67 regulator: pwm-regulator: Separate voltage-table initialisation
Take this out of the main .probe() routine in order to facilitate the
introduction of different ways to obtain 'duty cycle' information.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-07 14:27:55 +01:00
Axel Lin ec8677267f regulator: ltc3589: Constify ltc3589_reg_defaults
ltc3589_reg_defaults[] is not modified after initialized, so make it const.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-07 14:24:17 +01:00
Krzysztof Kozlowski 70cfef2626 regulator: Add lockdep asserts to help detecting locking misuse
Add lockdep_assert_held_once() to functions explicitly mentioning that
rdev or regulator_list mutex must be held. Using WARN_ONCE shouldn't
pollute the dmesg to much.

The patch (if CONFIG_LOCKDEP enabled) will show warnings in certain
regulators calling regulator_notifier_call_chain() without rdev->mutex
held.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-06 21:56:15 +01:00
Linus Torvalds 9d86b4128c Fix up implicit <module.h> users that will break later.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJVkO2uAAoJEOvOhAQsB9HWOT0P/jvFrpj2iuWqdMcvBuMdlx6K
 /9qiMsOStbxmbmjj3RsbFCkeHJMUBCI0ZVrIosdEyeZWx33fHkZJisvN1i1PMA63
 qppcZtkGxSmCOi6+e9k+qZNBvKBWy2oCXyLx7zaUKkWuR7wGe9488+9dqd9x+/gu
 i/HTvf8Omrukwko2a0omWUSmUimhveb/hQ7Vxc/M9lbxFeO3jMabV5ZzgfnoTTrh
 Rd2zo4kGbhj8nxonCUHgamnk6hoTE3KYhBPvqohzTDSTALmZVxhCwaQzQWzq+kdl
 oSLa+tik508/csh98tN9dlMkJReHlDNdJIbfazQ1vHI00T5PsQELexFT02iKBhS7
 5mdHSPp5P1TgGB6Fk3lN+hVO6Ja0S/vmJUi72M2y5DPd55lnvOaCVuqzWIJTYOoN
 tqllBH4WIz27hsJWiMLgkJQaDxfBFYx104tOq56s5SeOthBluSE2xoNDrzZGyvRh
 NeVza4ccgxIj0p2xfgeErx89r4GSCNk/LakpcMJReaT7ri23mTCDZJNLMcVW7BYm
 2MW6M3LF748eN3P2YyNnU+TeQNpIho4whuwfOV+uR4tpdd5MtMaObWimwxBN7URM
 LeW3gIwsZFHxYU9NLeZoQZVi6gDmaVe7ma82AbHXaV/mQVYsSP9M6gCO+FASCTGt
 Rz6Nyl4/Ns8rdXUoOud8
 =qotW
 -----END PGP SIGNATURE-----

Merge tag 'module-implicit-v4.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux

Pull implicit module.h fixes from Paul Gortmaker:
 "Fix up implicit <module.h> users that will break later.

  The files changed here are simply modular source files that are
  implicitly relying on <module.h> being present.  We fix them up now,
  so that we can decouple some of the module related init code from the
  core init code in the future.

  The addition of the module.h include to several files here is also a
  no-op from a code generation point of view, else there would already
  be compile issues with these files today.

  There may be lots more implicit includes of <module.h> in tree, but
  these are the ones that extensive build test coverage has shown that
  must be fixed in order to avoid build breakage fallout for the pending
  module.h <---> init.h code relocation we desire to complete"

* tag 'module-implicit-v4.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
  frv: add module.h to mb93090-mb00/flash.c to avoid compile fail
  drivers/cpufreq: include <module.h> for modular exynos-cpufreq.c code
  drivers/staging: include <module.h> for modular android tegra_ion code
  crypto/asymmetric_keys: pkcs7_key_type needs module.h
  sh: mach-highlander/psw.c is tristate and should use module.h
  drivers/regulator: include <module.h> for modular max77802 code
  drivers/pcmcia: include <module.h> for modular xxs1500_ss code
  drivers/hsi: include <module.h> for modular omap_ssi code
  drivers/gpu: include <module.h> for modular rockchip code
  drivers/gpio: include <module.h> for modular crystalcove code
  drivers/clk: include <module.h> for clk-max77xxx modular code
2015-07-02 10:25:22 -07:00
Linus Torvalds 4570a37169 sound updates for 4.2-rc1
It was a busy development cycle at this time, as you can see a wide
 range of changes in diffstat.  There are no big changes but many
 refactoring and improvements.  Here we go some highlights:
 
 * ALSA core:
 - Procfs codes were cleaned up to use seq_file
 - Procfs can be opt out via Kconfig (only for EXPERT)
 - Two types of jack API were unified finally; now both kctl and input
   jack devs are handled via a single function call.
 
 * HD-audio
 - Continued code restructuring for the future ASoC driver; now HDA
   controller driver is split to a core helper module.
 - Preliminary codes for Skylake audio support in HDA core.
 - Proper i915 gfx power well management for SKL & co
 - Enabled runtime PM as default for Intel HDMI/DP codecs
 - Newer Tegra chip supports
 - More quirks for Dell headsets, Alienware (with CA0132), etc.
 - A couple of DRM ELD helper API functions
 
 * ASoC
 - Support for loading ASoC topology maps from firmware, intended to be
   used to allow self-describing DSP firmware images to be built which
   can map controls added by the DSP to userspace without the kernel
   needing to know about individual DSP firmwares
 - Lots of refactoring to avoid direct access to snd_soc_codec where
   it's not needed supporting future refactoring
 - Big refactoring, cleanup and enhancement for the Wolfson ADSP driver
 - Cleanup series for TI TAS2552 and R-CAR drivers
 - Fixes and improvements on RT56xx codecs
 - Support for TI TAS571x power amplifiers
 - Support for Qualcomm APQ8016 and ZTE ZX296702 SoCs
 - Support for x86 systems with RT5650 and Qualcomm Storm
 - Support for Mediatek AFE (Audio Front End) unit
 - Other various small fixes to ASoC codec drivers
 
 * Firewire
 - Enhanced to allow non-blocking streams to use timestamp
   synchronization
 - Improve support for DM1500 and BeBoBv3
 
 * Misc
 - Cleanup of old pci API functions over all PCI sound drivers
 - Fix long-standing regression of the old powermac i2c setup
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJVitjmAAoJEGwxgFQ9KSmksW8P/2ngNzNpo/bmmGh6xjB7GWU9
 RDAkqhKd6yvcClQojGS9n4a9CJ8nk5tdqTr9rMp58N7DRv6GYCPdq0A+lLOih+yC
 UPcTkTMBKm6UtvJjEcaasMxhvs5xno345oo5KrBdvlfv1rXe83dTtzEsybWYkaVD
 dJbbr5QFaiyj5cTp9nanK5kyTyDDXCdP+vjBGv5u9+GbVxQ6Eenyts89uSqEZs1F
 ltoBrl4VotXyqHKneJ0ttUKEimcVIgu8rCXH0sTtCg0SZVJFi+UXzI/VkkS+expL
 x9bNN6bw5UT9LA8+qybFRETx+8qchFsffzeUEle4wkIpVKXt/VqjP3GIvp6umlF5
 RhU5Wumf2KuIVjgVsYxd7bUkmHr4ywpqS3vSWMWU90FApJay7exatzLPyUVN0AxH
 pdAizc8NWFk1kVtWq8jr9agEdxDt2l+E9UXij+ViGyouMZL1oSvOo9NgovfwvfC6
 qKUisUkq53p1uPOW/U5gvF7bee2enEXMI9YUY1Z8MHx7nloq+25Nqma8P0gYthB8
 6Qk+t1oqC2p7ZMSkyVHH9nySQmoLITZHZmsHqqpLW+jFtanhuckDI75AvmrScs+r
 3+2YZXxPI0caZZ1qxMCd7Clmh7ZcSeRe73HXSXmF0xrLffISM3Yg3ZN10cbWQRj2
 D6TiHCspLpn+pcYLcWJ2
 =D78E
 -----END PGP SIGNATURE-----

Merge tag 'sound-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound

Pull sound updates from Takashi Iwai:
 "It was a busy development cycle at this time, as you can see a wide
  range of changes in diffstat.  There are no big changes but many
  refactoring and improvements.  Here we go some highlights:

  ALSA core:
   - Procfs codes were cleaned up to use seq_file
   - Procfs can be opt out via Kconfig (only for EXPERT)
   - Two types of jack API were unified finally; now both kctl and input
     jack devs are handled via a single function call.

  HD-audio:
   - Continued code restructuring for the future ASoC driver; now HDA
     controller driver is split to a core helper module.
   - Preliminary codes for Skylake audio support in HDA core.
   - Proper i915 gfx power well management for SKL & co
   - Enabled runtime PM as default for Intel HDMI/DP codecs
   - Newer Tegra chip supports
   - More quirks for Dell headsets, Alienware (with CA0132), etc.
   - A couple of DRM ELD helper API functions

  ASoC:
   - Support for loading ASoC topology maps from firmware, intended to
     be used to allow self-describing DSP firmware images to be built
     which can map controls added by the DSP to userspace without the
     kernel needing to know about individual DSP firmwares
   - Lots of refactoring to avoid direct access to snd_soc_codec where
     it's not needed supporting future refactoring
   - Big refactoring, cleanup and enhancement for the Wolfson ADSP
     driver
   - Cleanup series for TI TAS2552 and R-CAR drivers
   - Fixes and improvements on RT56xx codecs
   - Support for TI TAS571x power amplifiers
   - Support for Qualcomm APQ8016 and ZTE ZX296702 SoCs
   - Support for x86 systems with RT5650 and Qualcomm Storm
   - Support for Mediatek AFE (Audio Front End) unit
   - Other various small fixes to ASoC codec drivers

  Firewire:
   - Enhanced to allow non-blocking streams to use timestamp
     synchronization
   - Improve support for DM1500 and BeBoBv3

  Misc:
   - Cleanup of old pci API functions over all PCI sound drivers
   - Fix long-standing regression of the old powermac i2c setup"

* tag 'sound-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (533 commits)
  ALSA: pcm: Fix pcm_class sysfs output
  ALSA: hda-beep: Update authors dead email address
  ASoC: wm_adsp: Move DSP Rate controls into the codec
  ASoC: wm8995: Fix setting sysclk for WM8995_SYSCLK_MCLK2 case
  ALSA: hda: provide default bus io ops extended hdac
  ALSA: hda: add hda link cleanup routine
  ALSA: hda: add hdac_ext stream creation and cleanup routines
  ASoC: rsrc-card: remove unused ret
  ALSA: HDAC: move SND_HDA_PREALLOC_SIZE to core
  ASoC: mediatek: Add machine driver for rt5650 rt5676 codec
  ASoC: mediatek: Add machine driver for MAX98090 codec
  ASoC: mediatek: Add AFE platform driver
  ASoC: rsnd: remove io from rsnd_mod
  ASoC: rsnd: move rsnd_mod_is_working() to rsnd_io_is_working()
  ASoC: rsnd: don't use rsnd_mod_to_io() on snd_kcontrol
  ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_src_xxx()
  ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_ssi_xxx()
  ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_dma_xxx()
  ASoC: rsnd: don't use rsnd_mod_to_io() on rsnd_get_adinr()
  ASoC: rsnd: add common interrupt handler for SSI/SRC/DMA
  ...
2015-06-25 17:15:18 -07:00
Krzysztof Kozlowski 32c848e33a regulator: s2mps11: Fix GPIO suspend enable shift wrapping bug
Status of enabling suspend mode for regulator was stored in bitmap-like
long integer.

However since adding support for S2MPU02 the number of regulators
exceeded 32 so on devices with more than 32 regulators (S2MPU02 and
S2MPS13) overflow happens when shifting the bit. This could lead to
enabling suspend mode for completely different regulator than intended
or to switching different regulator to other mode (e.g. from always
enabled to controlled by PWRHOLD pin). Both cases could result in larger
energy usage and issues when suspending to RAM.

Fixes: 00e2573d2c ("regulator: s2mps11: Add support S2MPU02 regulator device")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
2015-06-24 12:25:20 +01:00
Linus Torvalds 84e9c87e6f == Changes to existing drivers ==
- Constify structures; throughout the subsystem
    - Move support to DT in; cros_ec
    - DT changes and documentation; cros-ec, max77693, max77686, arizona, da9063
    - ACPI changes and documentation; mfd-core
    - Use different platform specific API in; cros_ec_*, arizona-core
    - Remove unused parent field from; cros_ec_i2c
    - Add wake-up/reset delay in; cross_ec_spi, arizona-core
    - Staticise structures/functions in; cros_ec
    - Remove redundant code; arizona-core, max77686
    - Bugfix; twl4030-power
    - Allow compile test; aat2870, tps65910
    - MAINTAINERS adaptions; samsung, syscon
    - Resource Management (devm_*); arizona-core
    - Refactor Reset code; arizona-core
    - Insist on at least one full boot; arizona-core
    - Trivial formatting; arizona-core
    - Add low-power-sleep; arizona-core
    - IRQ ONESHOT changes; twl4030-irq, mc13xxx-core, wm831x-auxadc, htc-i2cpld,
                           wm8350-core, ab8500-debugfs, ab8500-gpadc, si476x-i2c
 
  == (Re-)moved drivers ==
    - Move protocol helpers out to drivers/platform; cros_ec
 
  == New drivers/supported devices ==
    - Add support for AXP22x into axp20x
    - Add support for OnKey into da9063-core
    - Add support for Pinctrl into mt6397-core
    - New STMicroelectronics LPC Watchdog driver
    - New STMicroelectronics LPC Real-Time Clock driver
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJViWsQAAoJEFGvii+H/HdhBSEP/1nBi6iCwAb0gGJ5HeVKAVGa
 bF9EYM3wMEu64Rb3b4CZGVaI2DWy148vsyDdoOht6gRpaGk9yWz4KR9saG0cemKe
 NC1fqOrY+a6FytqJOcQ51fhcXAn49uqAOzJsTZX3AQ4Z93EXT3ZhF8/shXqUXNc1
 rXzV5enMwco9xnc3+0qzJoA0RaFfZuLB33bxt53GmnJVdnc5b1Haj5t40IN2oDSd
 3pA2MQqVw/j4rGwsYOoTkJHK792X969BJHj9AHESwFYz87/u2f8RQin5xi3RWN/M
 1XtkvURZESA+ewPWbOsq6wiVZd/wm4i2knoqWeXx0S5uKpi48PaljgY/PNYt8cOt
 oC1kVA5oOFIksdue7HG+mJ1EdAd38m3OGDJrivfFCfn8O8U+wsVrmrpS/hPuWQr6
 JTsZKapS77vty+jDSHrCU/F1rd5M7fVucxHqum0YCHz6w+B5CYWY3+qLcVa5zimi
 f3LbcuWI5XsNzuAsW3iqF1M+bPT6G9GRJV30FczX7KQkLNT0++q62lMF4K3mz93m
 avtrmZxFrF0yAP1n4Molz5x8JgfWdyvCSuGGxxfYmGf2v4taLW2BSRFRrWE3WwN3
 KQDzcftt3R7CM50wkIVqKJwBP7pA/UV+PPaRopbPqsdeXnkL+EoYyOpDuQkKsblz
 Q5M3ChB5rsu8trNyMPI6
 =Y02f
 -----END PGP SIGNATURE-----

Merge tag 'mfd-for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "Changes to existing drivers:
   - Constify structures; throughout the subsystem
   - Move support to DT in; cros_ec
   - DT changes and documentation; cros-ec, max77693, max77686, arizona, da9063
   - ACPI changes and documentation; mfd-core
   - Use different platform specific API in; cros_ec_*, arizona-core
   - Remove unused parent field from; cros_ec_i2c
   - Add wake-up/reset delay in; cross_ec_spi, arizona-core
   - Staticise structures/functions in; cros_ec
   - Remove redundant code; arizona-core, max77686
   - Bugfix; twl4030-power
   - Allow compile test; aat2870, tps65910
   - MAINTAINERS adaptions; samsung, syscon
   - Resource Management (devm_*); arizona-core
   - Refactor Reset code; arizona-core
   - Insist on at least one full boot; arizona-core
   - Trivial formatting; arizona-core
   - Add low-power-sleep; arizona-core
   - IRQ ONESHOT changes; twl4030-irq, mc13xxx-core, wm831x-auxadc, htc-i2cpld,
                          wm8350-core, ab8500-debugfs, ab8500-gpadc, si476x-i2c

  (Re-)moved drivers:
   - Move protocol helpers out to drivers/platform; cros_ec

  New drivers/supported devices:
   - Add support for AXP22x into axp20x
   - Add support for OnKey into da9063-core
   - Add support for Pinctrl into mt6397-core
   - New STMicroelectronics LPC Watchdog driver
   - New STMicroelectronics LPC Real-Time Clock driver"

* tag 'mfd-for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (59 commits)
  mfd: lpc_ich: Assign subdevice ids automatically
  mfd: si476x-i2c: Pass the IRQF_ONESHOT flag
  mfd: ab8500-gpadc: Pass the IRQF_ONESHOT flag
  mfd: ab8500-debugfs: Pass the IRQF_ONESHOT flag
  mfd: wm8350-core: Pass the IRQF_ONESHOT flag
  mfd: htc-i2cpld: Pass the IRQF_ONESHOT flag
  mfd: wm831x-auxadc: Pass the IRQF_ONESHOT flag
  mfd: mc13xxx-core: Pass the IRQF_ONESHOT flag
  mfd: twl4030-irq: Pass the IRQF_ONESHOT flag
  mfd: mt6397-core: Add GPIO sub-module support
  mfd: arizona: Add convience defines for micd_rate/micd_bias_starttime
  mfd: dt: Add bindings for DA9063 OnKey
  mfd: da9063: Add support for OnKey driver
  mfd: arizona: Fix incorrect Makefile conditionals
  mfd: arizona: Add stub for wm5102_patch()
  mfd: Check ACPI device companion before checking resources
  Documentation: Add WM8998/WM1814 device tree bindings
  mfd: arizona: Split INx_MODE into two fields
  mfd: wm5110: Add delay before releasing reset line
  mfd: arizona: Add better support for system suspend
  ...
2015-06-23 17:31:27 -07:00
Mark Brown 733ada000f Merge remote-tracking branches 'regulator/topic/of', 'regulator/topic/pwm', 'regulator/topic/qcom' and 'regulator/topic/soft-start' into regulator-next 2015-06-22 11:19:56 +01:00
Mark Brown 0460a368ea Merge remote-tracking branches 'regulator/topic/lp8755', 'regulator/topic/max14577', 'regulator/topic/max77693', 'regulator/topic/max77843' and 'regulator/topic/max8973' into regulator-next 2015-06-22 11:19:55 +01:00
Mark Brown c16bcf03c8 Merge remote-tracking branches 'regulator/topic/da9063', 'regulator/topic/doc', 'regulator/topic/fan53555', 'regulator/topic/gpio' and 'regulator/topic/ilim' into regulator-next 2015-06-22 11:19:52 +01:00
Mark Brown 4055da975d Merge remote-tracking branches 'regulator/topic/88pm8607', 'regulator/topic/arizona', 'regulator/topic/cleanup' and 'regulator/topic/da9062' into regulator-next 2015-06-22 11:19:51 +01:00
Mark Brown 4ccb09f697 Merge remote-tracking branch 'regulator/topic/core' into regulator-next 2015-06-22 11:19:51 +01:00
Mark Brown 87028bd117 Merge remote-tracking branches 'regulator/fix/doc', 'regulator/fix/max77686' and 'regulator/fix/wm831x' into regulator-linus 2015-06-22 11:19:49 +01:00
Mark Brown 24ba1bb3ef Merge remote-tracking branch 'regulator/fix/core' into regulator-linus 2015-06-22 11:19:48 +01:00
Axel Lin 419d06a1cf regulator: qcom_spmi: Fix calculating number of voltages
n /= range->step_uV + 1; is equivalent to n /= (range->step_uV + 1);
which is wrong. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-19 16:28:17 +01:00
Stephen Boyd 9b2dfee395 regulator: qcom_spmi: Add missing braces for aligned code
drivers/regulator/qcom_spmi-regulator.c:751:3-50: code aligned
with following code on line 753
drivers/regulator/qcom_spmi-regulator.c:584:3-41: code aligned
with following code on line 587

These lines where missing braces causing the break to always
be executed even when it shouldn't be. Fix it.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-17 08:54:19 +01:00
Paul Gortmaker ca1c8e93c3 drivers/regulator: include <module.h> for modular max77802 code
This file is built off of a tristate Kconfig option and also contains
modular function calls so it should explicitly include module.h to
avoid compile breakage during header shuffles done in the future.

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2015-06-16 14:12:26 -04:00
Julia Lawall 0f94bffad4 regulator: fix simple_return.cocci warnings
Simplify a trivial if-return sequence and combine with a
preceding function call.

Generated by: scripts/coccinelle/misc/simple_return.cocci

CC: Mark Brown <broonie@kernel.org>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 15:58:53 +01:00
Stephen Boyd e92a404741 regulator: Add QCOM SPMI regulator driver
Add an SPMI regulator driver for Qualcomm's PM8841, PM8941, and
PM8916 PMICs. This driver is based largely on code from
codeaurora.org[1].

[1] https://www.codeaurora.org/cgit/quic/la/kernel/msm-3.10/tree/drivers/regulator/qpnp-regulator.c?h=msm-3.10
Cc: David Collins <collinsd@codeaurora.org>
Cc: <devicetree@vger.kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-16 12:14:54 +01:00
Stephen Boyd 36e4f839de regulator: Add input current limit support
Some regulators can limit their input current (typically annotated
as ilim). Add an op (set_input_current_limit) and a DT property +
constraint to support this.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-12 13:18:02 +01:00
Stephen Boyd 57f66b7886 regulator: Add soft start support
Some regulators support a "soft start" feature where the voltage
ramps up slowly when the regulator is enabled. Add an op
(set_soft_start) and a DT property + constraint to support this.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-12 13:16:57 +01:00
Stephen Boyd 23c779b9f9 regulator: Add pull down support
Some regulators need to be configured to pull down a resistor
when the regulator is disabled. Add an op (set_pull_down) and a
DT property + constraint to support this.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-12 13:09:43 +01:00
Stephen Boyd 22a10bca28 regulator: Add system_load constraint
Some regulators have a fixed load that isn't captured by
consumers that the kernel knows about. Add a constraint to
support this.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-12 13:05:11 +01:00
Axel Lin 366604ec0d regulator: max8973: Fix up ramp_delay for MAX8973_RAMP_25mV_PER_US case
Fix trivial typo.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-10 18:29:04 +01:00
Stefan Wahren 5751a99fe9 regulator: core: replace sprintf with scnprintf
In order to avoid potential overflows in print_constraints we
better replace sprintf() with scnprintf().

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-10 11:09:30 +01:00
Mark Brown 96dc589624 Merge branch 'fix/core' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-core 2015-06-10 11:09:28 +01:00
Stefan Wahren a7068e3932 regulator: core: fix constraints output buffer
The buffer for condtraints debug isn't big enough to hold the output
in all cases. So fix this issue by increasing the buffer.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
2015-06-10 00:22:07 +01:00
Mark Brown c456b89a93 regulator: core: Don't corrupt display when printing uV offsets
We weren't taking into account the already used buffer when telling
sprintf() where to print to.

Reported-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-09 19:57:50 +01:00
Laxman Dewangan 0f7d6ece63 regulator: max8973: add support for MAX77621
Maxim MAX77621 device is high-efficiency, three-phase,
DC-DC step-down switching regulator delivers peak
output currents up to 16A. This device is extension of
MAX8973 and compatible with the register definition.

The MAX77621 has the SHUTDOWN pin which is EN pin on the
MAX8973. On MAX77621, the SHUTDOWN pin (active low) reset
device register to its POR/OTP value. The voltage output
is enabled when SHUTDONW pin is HIGH and EN bit on VOUT
register is HIGH.

For MAX8973, VOUT is enabled when EN bit or EN pin is high.

Add support of the MAX77621 device on max8973 regulator driver
with following changes:
- Make sure SHUTDOWN pin is set HIGH through GPIO calls if
  GPIO from AP connected to SHUTDOWN pin provided.
- Enable/disable the rail through register access only.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-09 18:09:11 +01:00
Laxman Dewangan 3064c1f302 regulator: max8973: configure ramp delay through callback
Regulator core framework support the configuration of ramp
delay reading from platform specific regulator data via the
regulator callback ops.

Instead of reading regulator init data on driver and setting
ramp delay, use the callback to achieve this.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-09 18:09:10 +01:00
Lee Jones ab101e3544 regulator: pwm-regulator: Diffientiate between dev (device) and rdev (regulator_dev)
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-08 19:18:19 +01:00
Lee Jones c779cebb7d regulator: pwm-regulator: Remove superfluous is_enabled check
The core framework already takes care of this.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-08 19:18:19 +01:00