Commit graph

2752 commits

Author SHA1 Message Date
Mark Brown d6d50a8f17 Merge remote-tracking branches 'regulator/topic/ltc3589', 'regulator/topic/max77620', 'regulator/topic/max77686', 'regulator/topic/max77802' and 'regulator/topic/maxim' into regulator-next 2016-03-13 15:19:47 +07:00
Mark Brown d1f83021d5 Merge remote-tracking branches 'regulator/topic/discharge', 'regulator/topic/fan53555', 'regulator/topic/gpio', 'regulator/topic/hi655x' and 'regulator/topic/lp872x' into regulator-next 2016-03-13 15:19:35 +07:00
Mark Brown 92aa18f88c Merge remote-tracking branches 'regulator/topic/act8865', 'regulator/topic/act8945a', 'regulator/topic/axp20x' and 'regulator/topic/cs4271' into regulator-next 2016-03-13 15:19:24 +07:00
Mark Brown c155e0ab13 Merge remote-tracking branch 'regulator/topic/core' into regulator-next 2016-03-13 15:19:22 +07:00
Mark Brown 905373b637 Merge remote-tracking branches 'regulator/fix/ad5398', 'regulator/fix/da9210', 'regulator/fix/max77802' and 'regulator/fix/pv88090' into regulator-linus 2016-03-13 15:19:09 +07:00
James Ban 623f7b9339 regulator: pv88090: fix incorrect clear of event register
This is a patch to fix incorrect clear of event register.

Signed-off-by: James Ban <James.Ban.opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-07 14:39:03 +07:00
Laxman Dewangan 51817f468f regulator: max77620: Add support to configure active-discharge
Add regulator ops callback for configuration of active-discharge
and provide necessarily information via regulator descriptor.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-02 23:31:45 +09:00
Laxman Dewangan 909f7ee0b5 regulator: core: Add support for active-discharge configuration
Add support to enable/disable active discharge of regulator via
machine constraints. This configuration is done when setting
machine constraint during regulator register and if regulator
driver implemented the callback ops.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-02 23:31:45 +09:00
Mark Brown 07a06694cb Merge branch 'topic/discharge' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-max77620 2016-03-02 23:31:35 +09:00
Laxman Dewangan 354794dacc regulator: helper: Add helper to configure active-discharge using regmap
Add helper function to set the state of active-discharge of
regulator using regmap. The HW regulator driver can directly
use this by providing the necessary information in the regulator
descriptor.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-02 23:13:05 +09:00
Laxman Dewangan 670666b9e0 regulator: core: Add support for active-discharge configuration
Add support to enable/disable active discharge of regulator via
machine constraints. This configuration is done when setting
machine constraint during regulator register and if regulator
driver implemented the callback ops.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-03-02 23:13:05 +09:00
Maarten ter Huurne 79b5d0266a regulator: act8865: Specify fixed voltage of 3.3V for ACT8600's REG9
The documentation lists both 1.8V and 3.3V for this regulator output,
but 3.3V is mentioned more often and also matches what JZ4770 and
JZ4780 expect as an input.

Note that the voltage of REG9 is not programmable, so this commit only
changes the voltage reported in sysfs and debugfs, not the actual
output voltage of the hardware.

Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-29 20:33:46 +09:00
Maarten ter Huurne 30f065bf1f regulator: act8865: Rename platform_data field to init_data
Make the field name match its type.

Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-29 20:33:46 +09:00
Maarten ter Huurne abea1bb08c regulator: act8865: Remove "static" from local variable
There is no need to preserve its value between calls. I guess this
was a copy-paste slip-up.

Signed-off-by: Maarten ter Huurne <maarten@treewalker.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-29 20:33:44 +09:00
Axel Lin 4d92325125 regulator: max77620: Remove duplicate module alias
The same alias is already in .id_table.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-26 10:36:54 +09:00
Axel Lin aad76f743b regulator: max77620: Eliminate duplicate code
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-26 10:36:54 +09:00
Axel Lin 47dbdbf64f regulator: max77620: Remove unused fields
These fields are never used and not required at all, remove them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-26 10:36:54 +09:00
Krzysztof Adamski 32165230eb regulator: core: fix crash in error path of regulator_register
This problem was introduced by:
commit daad134d66 ("regulator: core: Request GPIO before creating
sysfs entries")

The error path was not updated correctly after moving GPIO registration
code and in case regulator_ena_gpio_free failed, device_unregister() was
called even though device_register() was not yet called.

This problem breaks the boot at least on all Tegra 32-bit devices. It
will also crash each device that specifices GPIO that is unavaiable at
regulator_register call. Here's error log I've got when forced GPIO to
be invalid:

[    1.116612] usb-otg-vbus-reg: Failed to request enable GPIO10: -22
[    1.122794] Unable to handle kernel NULL pointer dereference at
virtual address 00000044
[    1.130894] pgd = c0004000
[    1.133598] [00000044] *pgd=00000000
[    1.137205] Internal error: Oops: 5 [#1] SMP ARM

and here's backtrace from KDB:

Exception stack(0xef11fbd0 to 0xef11fc18)
fbc0:                                     00000000 c0738a14 00000000 00000000
fbe0: c0b2a0b0 00000000 00000000 c0738a14 c0b5fdf8 00000001 ef7f6074 ef11fc4c
fc00: ef11fc50 ef11fc20 c02a8344 c02a7f1c 60000013 ffffffff
[<c010cee0>] (__dabt_svc) from [<c02a7f1c>] (kernfs_find_ns+0x18/0xf8)
[<c02a7f1c>] (kernfs_find_ns) from [<c02a8344>] (kernfs_find_and_get_ns+0x40/0x58)
[<c02a8344>] (kernfs_find_and_get_ns) from [<c02ac4a4>] (sysfs_unmerge_group+0x28/0x68)
[<c02ac4a4>] (sysfs_unmerge_group) from [<c044389c>] (dpm_sysfs_remove+0x30/0x5c)
[<c044389c>] (dpm_sysfs_remove) from [<c0436ba8>] (device_del+0x48/0x1f4)
[<c0436ba8>] (device_del) from [<c0436d84>] (device_unregister+0x30/0x6c)
[<c0436d84>] (device_unregister) from [<c0403910>] (regulator_register+0x6d0/0xdac)
[<c0403910>] (regulator_register) from [<c04052d4>] (devm_regulator_register+0x50/0x84)
[<c04052d4>] (devm_regulator_register) from [<c0406298>] (reg_fixed_voltage_probe+0x25c/0x3c0)
[<c0406298>] (reg_fixed_voltage_probe) from [<c043d21c>] (platform_drv_probe+0x60/0xb0)
[<c043d21c>] (platform_drv_probe) from [<c043b078>] (driver_probe_device+0x24c/0x440)
[<c043b078>] (driver_probe_device) from [<c043b5e8>] (__device_attach_driver+0xc0/0x120)
[<c043b5e8>] (__device_attach_driver) from [<c043901c>] (bus_for_each_drv+0x6c/0x98)
[<c043901c>] (bus_for_each_drv) from [<c043ad20>] (__device_attach+0xac/0x138)
[<c043ad20>] (__device_attach) from [<c043b664>] (device_initial_probe+0x1c/0x20)
[<c043b664>] (device_initial_probe) from [<c043a074>] (bus_probe_device+0x94/0x9c)
[<c043a074>] (bus_probe_device) from [<c043a610>] (deferred_probe_work_func+0x80/0xcc)
[<c043a610>] (deferred_probe_work_func) from [<c01381d0>] (process_one_work+0x158/0x454)
[<c01381d0>] (process_one_work) from [<c013854c>] (worker_thread+0x38/0x510)
[<c013854c>] (worker_thread) from [<c013e154>] (kthread+0xe8/0x104)
[<c013e154>] (kthread) from [<c0108638>] (ret_from_fork+0x14/0x3c)

Signed-off-by: Krzysztof Adamski <krzysztof.adamski@tieto.com>
Reported-by: Jon Hunter <jonathanh@nvidia.com>
Acked-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-25 10:48:16 +09:00
Mark Brown ece497ae37 Merge branch 'fix/core' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-core 2016-02-25 10:48:11 +09:00
Krzysztof Adamski daad134d66 regulator: core: Request GPIO before creating sysfs entries
regulator_attr_is_visible (which is a .is_visible callback of
regulator_dev_group attribute_grpup) checks rdev->ena_pin to decide if
"status" file should be present in sysfs. This field is set at the end
of regulator_ena_gpio_request so it has to be called before
device_register() otherwise this test will always fail, causing "status"
file to not be visible.

Since regulator_attr_is_visible also tests for is_enabled() op, this
problem is only visible for regulators that does not define this
callback, like regulator-fixed.c.

Signed-off-by: Krzysztof Adamski <krzysztof.adamski@tieto.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-22 19:51:05 +09:00
Rabin Vincent 0258382bf3 regulator: gpio: don't print error on EPROBE_DEFER
Don't print out an error with the driver sees EPROBE_DEFER when
attempting to get the gpio.  These errors are usually transient; the
probe will be retried later.

Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-21 02:09:34 +09:00
Axel Lin 4434cee9b6 regulator: ad5398: Fix return value of ad5398_write_reg
i2c_master_send() returns the number of bytes written on success.
So current code returns 2 if ad5398_write_reg() success.
This return value is propagated to .set_current_limit, .enable and .disable
callbacks of regulator_ops. This can be a problem, for example, if the
users test if the return value of regulator_set_current_limit() is 0.
Fix it by making ad5398_write_reg() return 0 on success.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 01:02:34 +09:00
Laxman Dewangan 5b1c20286f regulator: max77620: add regulator driver for max77620/max20024
MAXIM Semiconductor's PMIC, MAX77620 and MAX20024 have the
multiple DCDC and LDOs. This supplies the power to different
components of the system.
Also these rails has configuration for ramp time, flexible
power sequence, slew rate etc.

Add regulator driver to access these rails via regulator APIs.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mallikarjun Kasoju <mkasoju@nvidia.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-20 01:01:17 +09:00
Chen-Yu Tsai e0bbb38c2f regulator: axp20x: Use of_match name as default regulator name
Originally the helper macros used uppercase regulator names, which
are primarily used to expand to the regulator ID enum, as the default
names. This is aestheticly unpleasent.

Since the of_match bits are the same, just lowercase, use that as the
default names instead.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-15 20:02:43 +00:00
Chen Feng 4618119b9b regulator: hi655x: enable regulator for hi655x PMIC
Add the regulator driver for hi655x PMIC.

Signed-off-by: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Fei Wang <w.f@huawei.com>
Signed-off-by: Xinwei Kong <kong.kongxinwei@hisilicon.com>
Reviewed-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-15 19:54:55 +00:00
Bernhard Walle d4930cf0ae regulator: ltc3589: Make IRQ optional
It's perfectly valid to use the LTC3589 without an interrupt pin
connected to it. Currently, the driver probing fails when client->irq
is 0 (which means "no interrupt"). Don't register the interrupt
handler in that case but successfully finish the device probing instead.

Signed-off-by: Bernhard Walle <bernhard@bwalle.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-12 22:35:00 +00:00
Javier Martinez Canillas 96173cc6a4 regulator: Rename files for max77686 and max77802 drivers
The max77686 and max77802 regulator drivers are for sub-devices of a MFD
driver for some PMIC blocks. But the same object file name (max77686.o)
was used for both the common MFD driver and the max77686 regulator one.

This confuses kbuild if both drivers are built as module causing the MFD
driver to not be copied when installing the modules.

Also, max77{686,802} are a quite generic name for MFD subdevices drivers
so it is better to rename them to max77{686,802}-regulator like it's the
case for most regulator drivers.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-12 12:15:51 +00:00
Paul Kocialkowski 7e6213f434 regulator: lp872x: Add enable GPIO pin support
LP872x regulators are made active via the EN pin, which might be hooked to a
GPIO. This adds support for driving the GPIO high when the driver is in use.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-05 18:57:09 +00:00
Paul Kocialkowski 690f44badf regulator: lp872x: Remove warning about invalid DVS GPIO
Some devices don't hook the DVS pin to a GPIO but to ground or VCC.
In those cases, it is not a problem to have no DVS GPIO provided, as the current
code will already switch to software-only DVS selection:

When the DVS GPIO is invalid, lp872x_init_dvs jumps to the set_default_dvs_mode
label, which instructs the chip not to use the DVS pin at all and do it all in
software instead (by clearing the LP8720_EXT_DVS_M bit in the
LP872X_GENERAL_CFG register).

That is reflected later in the code, when setting the bucks (the DVS pin only
applies to the bucks) by checking for the LP8720_EXT_DVS_M bit on the
LP872X_GENERAL_CFG register (in lp872x_select_buck_vout_addr) to decide whether
to use software or hardware DVS selection.

Thus, there is no need to print a warning when the DVS GPIO is invalid.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-05 18:57:08 +00:00
Wenyou Yang 38c0996104 regulator: act8945a: add regulator driver for ACT8945A
This patch adds new regulator driver to support ACT8945A MFD
chip's regulators.

The ACT8945A has three step-down DC/DC converters and four
low-dropout regulators.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-05 18:18:47 +00:00
Chen-Yu Tsai 13d57e6435 regulator: axp20x: Use linear voltage ranges for AXP20X LDO4
AXP20X datasheet lists the possible voltage settings for LDO4, so
it was implemented using a voltage table. Upon closer examination,
the valid voltages can be mapped into 3 linear ranges.

Move AXP20X LDO4 to use linear ranges. The supporting code can be
reused with later AXP8xx PMICs, which have a number of regulators
that have 2 linear ranges.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-03 17:15:08 +00:00
Chen-Yu Tsai 94c39041ae regulator: axp20x: Remove voltage readout support for switch regulators
Switch-type regulators, such as DC1SW on AXP22X, are a secondary output
from DCDC1. They are just an on/off switch, and the driver should not
try to read its voltage directly from the DCDC1 control registers.

Instead, the core will pass down the voltage from the regulator supply
chain.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-02-03 17:15:08 +00:00
Charles Keepax 6333ef46bb regulator: core: Rely on regulator_dev_release to free constraints
As we now free the constraints in regulator_dev_release we will still
call free on the constraints pointer even if we went down an error
path in regulator_register, because it is only allocated after the
device_register. As such we no longer need to free rdev->constraints
on the error paths, so this patch removes said frees.

Fixes: 29f5f4860a ("regulator: core: Move more deallocation into class unregister")
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-27 14:41:42 +00:00
Linus Torvalds 4b43ea2a7c regulator: Update for v4.5
Aside from a fix for a spurious warning (which caused more problems than
 it fixed in the fixing really) this is all driver updates, including new
 drivers for Dialog PV88060/90 and TI LM363x and TPS65086 devices.  The
 qcom_smd driver has had PM8916 and PMA8084 support added.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWlUWiAAoJECTWi3JdVIfQtywH/0joibyUbL34arXcPNCUUhlo
 UnhTgT1kfOoS01ODt9gU49X4/8SRL9HdjcrIV8yTz4Ldb8by8Rd3ZrkO//9zs7BF
 5PIqIzEw6FT/Ovsj8Tc35irccMSrwtTIGRrA8zrM/WtWQWcIUWFxMw+j/lewIvvH
 jHZNTTLL5XemObSTfvzhbS6PZ8RcvRVXLNJjZYYO5xAEHNg3i5Hxao5p3QKzVJ8m
 P5n4jSiTY/pVePcs9dzzQTGjlzkE11KX7DBxnmXOSPZsArSaRIC53DCmqu/JoG+o
 3JJBkmRx7IJb0651hclFaUl8Wl56FSst+zigeAj82b301xpVR30iG3xiwYK/AT8=
 =NQ6n
 -----END PGP SIGNATURE-----

Merge tag 'regulator-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "Aside from a fix for a spurious warning (which caused more problems
  than it fixed in the fixing really) this is all driver updates,
  including new drivers for Dialog PV88060/90 and TI LM363x and TPS65086
  devices.  The qcom_smd driver has had PM8916 and PMA8084 support
  added"

* tag 'regulator-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (36 commits)
  regulator: core: remove some dead code
  regulator: core: use dev_to_rdev
  regulator: lp872x: Get rid of duplicate reference to DVS GPIO
  regulator: lp872x: Add missing of_match in regulators descriptions
  regulator: axp20x: Fix GPIO LDO enable value for AXP22x
  regulator: lp8788: constify regulator_ops structures
  regulator: wm8*: constify regulator_ops structures
  regulator: da9*: constify regulator_ops structures
  regulator: mt6311: Use REGCACHE_RBTREE
  regulator: tps65917/palmas: Add bypass ops for LDOs with bypass capability
  regulator: qcom-smd: Add support for PMA8084
  regulator: qcom-smd: Add PM8916 support
  soc: qcom: documentation: Update SMD/RPM Docs
  regulator: pv88090: logical vs bitwise AND typo
  regulator: pv88090: Fix irq leak
  regulator: pv88090: new regulator driver
  regulator: wm831x-ldo: Use platform_register/unregister_drivers()
  regulator: wm831x-dcdc: Use platform_register/unregister_drivers()
  regulator: lp8788-ldo: Use platform_register/unregister_drivers()
  regulator: core: Fix nested locking of supplies
  ...
2016-01-15 12:14:47 -08:00
Wolfram Sang 0f48eedacf regulator: da9210: fix lockdep warning
Commit 70cfef2626 ("regulator: Add lockdep asserts to help detecting
locking misuse") successfully created this WARN, let's fix it:

[    1.218660] WARNING: CPU: 0 PID: 553 at drivers/regulator/core.c:3646 regulator_notifier_call_chain+0x5c/0x88()
...
[    1.220278] [<c0246c20>] (regulator_notifier_call_chain) from [<c02498b4>] (da9210_irq_handler+0x74/0x10c)
[    1.220412]  r7:c0080cac r6:eb1daa00 r5:e64bbf10 r4:00000002
[    1.220547] [<c0249840>] (da9210_irq_handler) from [<c0080cd8>] (irq_thread_fn+0x2c/0x44)
...

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-15 18:09:35 +00:00
zhangqing ab7cad3311 regulator: fan53555: fill set_suspend_enable/disable callback
Setting the set_suspend_enable/disable callback to support
enable and disable the dcdc when system is suspend.

Signed-off-by: zhangqing <zhangqing@rock-chips.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-15 18:08:20 +00:00
Mark Brown d3bd4e0a5f Merge remote-tracking branch 'regulator/topic/wm831x' into regulator-next 2016-01-12 18:26:12 +00:00
Mark Brown 78ae902552 Merge remote-tracking branches 'regulator/topic/pv88090', 'regulator/topic/qcom-smd', 'regulator/topic/tps6105x', 'regulator/topic/tps65086' and 'regulator/topic/tps65218' into regulator-next 2016-01-12 18:26:10 +00:00
Mark Brown 3fbd90bf6b Merge remote-tracking branches 'regulator/topic/lp8788', 'regulator/topic/mt6311', 'regulator/topic/optional', 'regulator/topic/palmas' and 'regulator/topic/pv88060' into regulator-next 2016-01-12 18:26:07 +00:00
Mark Brown 8bd31df8de Merge remote-tracking branches 'regulator/topic/const', 'regulator/topic/lm363x', 'regulator/topic/lockdep' and 'regulator/topic/lp872x' into regulator-next 2016-01-12 18:26:05 +00:00
Mark Brown 9fa295742d Merge remote-tracking branch 'regulator/topic/core' into regulator-next 2016-01-12 18:26:05 +00:00
Mark Brown 353915f0b4 Merge remote-tracking branches 'regulator/fix/axp20x' and 'regulator/fix/mt6311' into regulator-linus 2016-01-12 18:26:03 +00:00
Dan Carpenter 70dc6daff0 regulator: core: remove some dead code
Originally queue_delayed_work() used to negative error codes or 0 and 1
on success depending if the work was queued or not.  It caused a lot of
bugs where people treated all non-zero returns as failures so we changed
it to return bool instead in d4283e9378 ('workqueue: make queueing
functions return bool').  Now it never returns failure.

Checking for negative values causes a static checker warning since it is
impossible based on the bool type.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-07 15:41:02 +00:00
Geliang Tang 83080a1408 regulator: core: use dev_to_rdev
Use dev_to_rdev() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2016-01-05 14:20:50 +00:00
Paul Kocialkowski 8a99cc6ff5 regulator: lp872x: Get rid of duplicate reference to DVS GPIO
The lp872x structure holds a reference to the DVS GPIO, but it is never actually
used anywhere, since a first reference exists from the lp872x_dvs structure.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-23 12:12:46 +00:00
Paul Kocialkowski 1f97fe4777 regulator: lp872x: Add missing of_match in regulators descriptions
In order to select the regulators via of_find_regulator_by_node (and thus use
them in devicetree), defining of_match for each regulator is required.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-23 12:12:46 +00:00
Chen-Yu Tsai 3cb99e2ea9 regulator: axp20x: Fix GPIO LDO enable value for AXP22x
The enable/disable values for GPIO LDOs are reversed. It seems no one
noticed as AXP22x support was introduced recently, and no one was using
the GPIO LDOs, either because no designs actually use them or board
support hasn't caught up.

Fixes: 1b82b4e4f9 ("regulator: axp20x: Add support for AXP22X regulators")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
2015-12-23 00:05:31 +00:00
Julia Lawall 95dfead1dd regulator: lp8788: constify regulator_ops structures
The regulator_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Milo Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-23 00:01:23 +00:00
Julia Lawall b0d6dd3ba3 regulator: wm8*: constify regulator_ops structures
The regulator_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-23 00:00:00 +00:00
Julia Lawall 71242b49a0 regulator: da9*: constify regulator_ops structures
The regulator_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-12-22 23:59:57 +00:00