Commit Graph

3660 Commits

Author SHA1 Message Date
Wolfram Sang 973af54c52
regulator: da9063: platform_data is gone, depend on OF
With OF being the only configuration possibility left, depend on it to
simplify some code.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Steve Twiss <stwiss.opensource@diasemi.com>
Tested-by: Steve Twiss <stwiss.opensource@diasemi.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-20 15:26:12 +01:00
Wolfram Sang 824bd1be3e
regulator: da9063: move definitions out of a header into the driver
Those definitions are only used within the driver meanwhile, so put them
there.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Steve Twiss <stwiss.opensource@diasemi.com>
Tested-by: Steve Twiss <stwiss.opensource@diasemi.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-20 15:25:57 +01:00
Wolfram Sang 662307294f
regulator: da9063: remove platform_data support
There are no in-kernel users anymore, so remove this outdated interface.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Steve Twiss <stwiss.opensource@diasemi.com>
Tested-by: Steve Twiss <stwiss.opensource@diasemi.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-20 15:25:42 +01:00
Eric Jeong a867bde3dd
regulator: slg51000: add slg51000 regulator driver
Adding regulator driver for the device Dialog SLG51000.

The SLG51000 device contains seven compact and customizable low
dropout regulators and is designed for high performance camera modules
and other small multi-rail applications.

Signed-off-by: Eric Jeong <eric.jeong.opensource@diasemi.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-13 11:07:43 +01:00
Axel Lin 3df4235ac4
regulator: max77650: Convert MAX77651 SBB1 to pickable linear range
The pickable linear range is suitable for The MAX77651 SBB1.
According to MAX77651 TV_SBB1 Code Table:
Use BIT[1:0] as range selectors.
Use BIT[5:2] as selectors for each linear range.

The MAX77651 SBB1 supports up to selector 57, selector 58 ~ 63 are RSVD,
thus set n_voltage to 58.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-08 17:32:55 +09:00
Axel Lin 68ce3a4461
regulator: core: Slightly improve readability of _regulator_get_enable_time
The logic is equivalent, but it looks more straightforward this way:
If rdev->desc->ops->enable_time is set, call it.
Otherwise fallback to return rdev->desc->enable_time.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-08 17:32:28 +09:00
Mark Brown e2a23affe6
Merge branch 'regulator-5.2' into regulator-next 2019-05-06 22:52:14 +09:00
Jorge Ramirez-Ortiz 4982094451
regulator: core: simplify return value on suported_voltage
All the current clients of this API  assume that 0 corresponds
to a failure and non-zero to a pass therefore ignoring the need to
handle a negative error code.

This commit modifies the API to follow that standard since returning a
negative (EINVAL) doesn't seem to provide enough value to justify
the need to handle it.

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-03 15:34:26 +09:00
Axel Lin fd2f02f972
regulator: da9xxx: Switch to SPDX identifier
Convert Dialog Semiconductor DA9xxx regulator drivers to SPDX identifier.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-03 15:07:39 +09:00
Axel Lin 311a68a51a
regulator: stm32-pwr: Remove unneeded .min_uV and .list_volage
For fixed regulator, setting .n_voltages = 1 and .fixed_uV is enough,
no need to set .min_uV and .list_volage.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-03 15:07:15 +09:00
Axel Lin 7bcbdbe01f
regulator: stm32-pwr: Remove unneeded *desc from struct stm32_pwr_reg
Just use rdev->desc instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-03 15:06:51 +09:00
Axel Lin e219c2b3dc
regulator: ab3100: Set fixed_uV instead of min_uV for fixed regulators
Slightly better readability by setting fixed_uV instead of min_uV.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-03 15:06:31 +09:00
Axel Lin 95602d7d77
regulator: ab3100: Constify regulator_ops and ab3100_regulator_desc
These regulator_ops variables and ab3100_regulator_desc array never need
to be modified, make them const so compiler can put them to .rodata.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-03 15:06:16 +09:00
Axel Lin 0ae3b061df
regulator: pv880x0: Switch to SPDX identifier
Convert Powerventure Semiconductor PV88060/PV88080/PV88090 regulator
drivers to SPDX identifier.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-03 15:05:52 +09:00
Axel Lin 8b90852006
regulator: hi6xxx: Switch to SPDX identifier
Convert HiSilicon hi6xxx PMIC drivers to SPDX identifier.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-02 11:16:40 +09:00
Axel Lin c5e911add1
regulator: vexpress: Switch to SPDX identifier
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-02 11:16:18 +09:00
Axel Lin eeb1b2355a
regulator: vexpress: Get rid of struct vexpress_regulator
The *regdev and *regmap can be replaced by local variables in probe().
Only desc of struct vexpress_regulator is really need, so just use
struct regulator_desc directly and remove struct vexpress_regulator.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-05-02 11:16:04 +09:00
Axel Lin fb9bf5c8f1
regulator: sky81452: Switch to SPDX identifier
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-26 10:38:27 +01:00
Axel Lin c7e3ddd129
regulator: sky81452: Constify sky81452_reg_ops
sky81452_reg_ops is never changed, make it const.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-26 10:38:26 +01:00
Axel Lin 5d7ebba38b
regulator: sy8106a: Get rid of struct sy8106a
All the fields in struct sy8106a are only used in sy8106a_i2c_probe(), so
use local variables instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-26 10:38:25 +01:00
Jorge Ramirez-Ortiz b9816363c0
regulator: core: do not report EPROBE_DEFER as error but as debug
Temporary failures to get a regulator (EPROBE_DEFER) should be logged
as debug information instead of errors.

Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-26 10:38:24 +01:00
Axel Lin fe669cb95e
regulator: mt63xx: Switch to SPDX identifier
Convert MediaTek mt63xx PMIC drivers to SPDX identifier.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-26 10:38:23 +01:00
Axel Lin 6a1beee2fe
regulator: fan53555: Switch to SPDX identifier
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-26 10:38:22 +01:00
Axel Lin a69929c7aa
regulator: fan53555: Clean up unneeded fields from struct fan53555_device_info
The *regmap and *rdev can be replaced by local variables.
The slew_rate is no longer used since commit dd7e71fbee
("regulator: fan53555: use set_ramp_delay to set the ramp up slew rate").

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-26 10:38:21 +01:00
Axel Lin b2745697bf
regulator: ltc3589: Switch to SPDX identifier
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-26 10:38:20 +01:00
Axel Lin 63c7c2962a
regulator: ltc3589: Get rid of struct ltc3589_regulator
After converting to use simplified DT parsing, the struct ltc3589_regulator
only has a desc member. So let's remove struct ltc3589_regulator and use
struct regulator_desc instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-26 10:38:20 +01:00
Axel Lin ce62ba3afd
regulator: ltc3589: Convert to use simplified DT parsing
Use regulator core's simplified DT parsing code to simplify the driver
implementation.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-26 10:38:19 +01:00
Axel Lin 734008e714
regulator: max77620: Fix regulator info setting for max20024
Current code always set pmic->rinfo[id] = &max77620_regs_info[id];
It should set to either max77620_regs_info or max20024_regs_info
depends on the chip_id.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-25 20:05:43 +01:00
Linus Walleij 78927aa40b
regulator: core: Actually put the gpiod after use
I went to great lengths to hand over the management of the GPIO
descriptors to the regulator core, and some stray rebased
oneliner in the old patch must have been assuming the devices
were still doing devres management of it.

We handed the management over to the regulator core, so of
course the regulator core shall issue gpiod_put() when done.

Sorry for the descriptor leak.

Fixes: 541d052d72 ("regulator: core: Only support passing enable GPIO descriptors")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-25 20:04:56 +01:00
Axel Lin 362af73650
regulator: wm8400: Switch to SPDX identifier
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-17 17:41:00 +01:00
Axel Lin 87dbc5eb3c
regulator: wm8350: Switch to SPDX identifier
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-17 17:40:44 +01:00
Axel Lin 3cad5fc89a
regulator: wm831x: Switch to SPDX identifier
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-17 17:40:29 +01:00
Axel Lin dfc0c82b33
regulator: arizona: Switch to SPDX identifier
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-17 17:40:14 +01:00
Axel Lin e8d59d9a79
regulator: wm8994: Switch to SPDX identifier
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-17 17:39:58 +01:00
Wei Yongjun dc62f951a6
regulator: stm32-pwr: Fix return value check in stm32_pwr_regulator_probe()
In case of error, the function of_iomap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.

Fixes: 6cdae8173f ("regulator: Add support for stm32 power regulators")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-17 17:33:45 +01:00
kbuild test robot 82f26185a9
regulator: ready_mask_table[] can be static
Fixes: 6cdae8173f ("regulator: Add support for stm32 power regulators")
Signed-off-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-17 17:32:15 +01:00
Axel Lin fd1a4da3bf
regulator: tps80031: Switch to SPDX identifier
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-16 17:30:56 +01:00
Axel Lin 4b77a49cb8
regulator: tps80031: Constify regulator_ops and tps80031_dcdc_voltages array
These regulator_ops variables and tps80031_dcdc_voltages array never need
to be modified, make them const so compiler can put them to .rodata.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-16 17:30:41 +01:00
Axel Lin de110f3873
regulator: tps80031: Remove unused *rdev from struct tps80031_regulator
The ri-rdev is assigend but not used, so remove it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-16 17:30:25 +01:00
Pascal PAILLET-LME 6cdae8173f
regulator: Add support for stm32 power regulators
Add support for 1V1 1V8 USB3V3 power regulators.

Signed-off-by: Pascal Paillet <p.paillet@st.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-15 10:58:41 +01:00
Axel Lin 0dceab3334
regulator: max8998: Factor out struct voltage_map_desc
The struct voltage_map_desc is used for storing min/max/step fileds, and
then setup the min_uV, uV_step and n_voltages fields for regulator_desc.
Introduce MAX8998_LINEAR_REG/MAX8998_OTHERS_REG macro to setup these filds
directly in regulator_desc to simplify the code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-15 09:45:15 +01:00
Axel Lin 7d695f20c2
regulator: max8998: Constify regulator_ops
These regulator_ops variables never need to be modified, make them const so
compiler can put them to .rodata.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-15 09:44:58 +01:00
Axel Lin 7a8b0e66df
regulator: tps6524x: Remove *rdev[N_REGULATORS] from struct tps6524x
Current code is using devm_regulator_register() so we don't need to store
*rdev for clean up, use a local variable instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-15 09:44:41 +01:00
Axel Lin 357db0279a
regulator: tps6524x: Constify regulator_ops
The regulator_ops is never changed, make it const.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-15 09:44:25 +01:00
Axel Lin 7cfcecfb82
regulator: tps65218: Convert to use regulator_get_current_limit_regmap
Use regulator_get_current_limit_regmap helper to save some code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-15 09:44:09 +01:00
Axel Lin 7c6b8e3b9f
regulator: ab8500: Remove *regulator from struct ab8500_regulator_info
Current code is using devm_regulator_register() so we don't need to save
*regulator for clean up, use a local variable instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-15 09:43:58 +01:00
Axel Lin 6d66d9952e
regulator: ab8500: Constify regulator_ops
These regulator_ops variables never need to be modified, make them const so
compiler can put them to .rodata.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-15 09:43:47 +01:00
Axel Lin 8e5be4f7e1
regulator: ab8500-ext: Constify ab8500_ext_regulator_ops
ab8500_ext_regulator_ops never need to be modified, make it const so
compiler can put it to .rodata.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-15 09:43:31 +01:00
Axel Lin 48cb9737ed
regulator: ab8500-ext: Convert to use simplified DT parsing
Use regulator core's simplified DT parsing code to simplify the driver
implementation.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-15 09:43:20 +01:00
Axel Lin 80a9c22a9d
regulator: ab8500-ext: Remove *rdev from struct ab8500_ext_regulator_info
Current code is using devm_regulator_register() so we don't need to save
*rdev for clean up, use a local variable instead.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
2019-04-15 09:43:09 +01:00