summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2021-06-14regulator: rt6160: Convert to use regulator_set_ramp_delay_regmapAxel Lin
Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210603093809.1108629-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-14Merge tag 'for-5.14-regulator' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into regulator-5.14 regulator: Changes for v5.14-rc1 This adds regulator_sync_voltage_rdev(), which is used as a dependency for new Tegra power domain code.
2021-06-08regulator: fan53880: Fix vsel_mask setting for FAN53880_BUCKAxel Lin
According to the datasheet: REGISTER DETAILS − 0x02 BUCK, BUCK_OUT is BIT0 ~ BIT7. So vsel_mask for FAN53880_BUCK should be 0xFF. Fixes: e6dea51e2d41 ("regulator: fan53880: Add initial support") Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210607142907.1599905-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-08regulator: bd71815: Get rid of struct bd71815_pmicAxel Lin
The content of bd71815_regulators is never changed, no need to duplicate it, thus remove descs[BD71815_REGULATOR_CNT]. The *regmap, *dev and *rdev[BD71815_REGULATOR_CNT] are not really needed. The *gps is unused. Thus the struct bd71815_pmic can be removed. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/20210607143002.1600017-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-08regulator: ltc3589: Convert to use regulator_set_ramp_delay_regmapAxel Lin
Use regulator_set_ramp_delay_regmap instead of open-coded LTC3589_LINEAR_REG() no longer call LTC3589_REG() now. Only LTC3589_LINEAR_REG() needs to set go_bit, thus remove go_bit parameter from LTC3589_REG() macro. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210604115803.1260976-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-07regulator: mt6359: Get rid of linear_range tablesAxel Lin
The MT6359_BUCK and MT6359_LDO_LINEAR macros setup both linear settings (min_uV, uV_step, linear_min_sel) and linar_range (linear_ranges, n_linear_ranges) settings. All the linear range tables actually only has one entry. Let's simplify it by using linear instead of linear range. The linear_min_sel setting is 0 for all cases, remove it from the macros. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210606065052.1417111-3-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-07regulator: mt6359: Use unsigned int for volt_tablesAxel Lin
The regulator_desc expects "const unsigned int *volt_table", thus use unsigned int instead of u32. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210606065052.1417111-2-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-07regulator: mt6358: Use unsigned int for volt_tablesAxel Lin
The regulator_desc expects "const unsigned int *volt_table", thus use unsigned int instead of u32. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210606065052.1417111-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-07regulator: max77686: Convert to use regulator_set_ramp_delay_regmapAxel Lin
Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210605013424.1298773-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-07Merge tag 'tb-mfd-regulator-rtc-v5.14' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into regulator-5.14 Immutable branch between MFD, Regulator and RTC due for the v5.14 merge window
2021-06-04regulator: fan53555: add tcs4526Rudi Heitbaum
For rk3399pro boards the tcs4526 regulator supports the vdd_gpu regulator. The tcs4526 regulator has a chip id of <0>. Add the compatibile tcs,tcs4526 without this patch, the dmesg output is: fan53555-regulator 0-0010: Chip ID 0 not supported! fan53555-regulator 0-0010: Failed to setup device! fan53555-regulator: probe of 0-0010 failed with error -22 with this patch, the dmesg output is: vdd_gpu: supplied by vcc5v0_sys The regulators are described as: - Dedicated power management IC TCS4525 - Lithium battery protection chip TCS4526 This has been tested with a Radxa Rock Pi N10. Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com> Link: https://lore.kernel.org/r/20210602112943.GA119@5f9be87369f8 Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-03regulator: rt6245: Add support for Richtek RT6245ChiYuan Huang
Richtek RT6245 is a high-performance, synchronous step-down converter that can deliver up to 14A output current with an input supply voltage range of 4.5V to 17V. Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Link: https://lore.kernel.org/r/1622699844-19203-2-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-03regulator: bd9576: Constify the voltage tablesAxel Lin
Also use unsigned int instead of int for the voltage tables. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210525100405.2506483-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-03regulator: fan53555: Convert to use regulator_set_ramp_delay_regmapAxel Lin
Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210525124017.2550029-2-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-03regulator: fan53555: Fix missing slew_reg/mask/shift settings for FAN53526Axel Lin
The di->slew_reg/di->slew_mask/di->slew_shift was not set in current code, fix it. Fixes: f2a9eb975ab2 ("regulator: fan53555: Add support for FAN53526") Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210525124017.2550029-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-03regulator: max77802: Convert to use regulator_set_ramp_delay_regmapAxel Lin
Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210523072320.2174443-2-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-03regulator: max77802: Remove .set_ramp_delay from max77802_buck_dvs_opsAxel Lin
max77802_set_ramp_delay_2bit() returns -EINVAL when id > MAX77802_BUCK4. This was a leftover in commit b0615f1da543 ("regulator: max77802: Split regulator operations for BUCKs"). Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210523072320.2174443-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-02regulator: userspace-consumer: use DEVICE_ATTR_RO/RW macroZhen Lei
Use DEVICE_ATTR_RO/RW macro helper instead of plain DEVICE_ATTR, which makes the code a bit shorter and easier to read. Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Link: https://lore.kernel.org/r/20210602080526.11117-1-thunder.leizhen@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-02regulator: rt6160: Add support for Richtek RT6160ChiYuan Huang
Add support for Richtek RT6160 voltage regulator. It can provide up to 3A output current within the adjustable voltage from 2025mV to 5200mV. It integrate a buckboost converter to support wide input voltage range from 2200mV to 5500mV. Signed-off-by: ChiYuan Huang <cy_huang@richtek.com> Link: https://lore.kernel.org/r/1622611906-2403-2-git-send-email-u0084500@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-02regulator: core: Use DEVICE_ATTR_RO macroYueHaibing
Use DEVICE_ATTR_RO() helper instead of plain DEVICE_ATTR(), which makes the code a bit shorter and easier to read. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Link: https://lore.kernel.org/r/20210529115226.25376-1-yuehaibing@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01regulator: mt6359: Add support for MT6359P regulatorHsin-Hsiung Wang
The MT6359P is a eco version for MT6359 regulator. We add support based on MT6359 regulator driver. Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-06-01regulator: mt6359: Add support for MT6359 regulatorWen Su
The MT6359 is a regulator found on boards based on MediaTek MT6779 and probably other SoCs. It is a so called pmic and connects as a slave to SoC using SPI, wrapped inside the pmic-wrapper. Signed-off-by: Wen Su <wen.su@mediatek.com> Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-06-01mfd: Add support for the MediaTek MT6359 PMICHsin-Hsiung Wang
This adds support for the MediaTek MT6359 PMIC. This is a multifunction device with the following sub modules: - Codec - Interrupt - Regulator - RTC It is interfaced to the host controller using SPI interface by a proprietary hardware called PMIC wrapper or pwrap. MT6359 MFD is a child device of the pwrap. Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-06-01rtc: mt6397: refine RTC_TC_MTHHsin-Hsiung Wang
This patch adds RTC_TC_MTH_MASK to support new chips. Signed-off-by: Yuchen Huang <yuchen.huang@mediatek.com> Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com> Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-06-01mfd: mt6358: Refine interrupt codeHsin-Hsiung Wang
This patch refines the interrupt related code to support new chips. Signed-off-by: Hsin-Hsiung Wang <hsin-hsiung.wang@mediatek.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-06-01regulator: mcp16502: Convert to use regulator_set_ramp_delay_regmapAxel Lin
Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210526125026.82549-2-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01regulator: mcp16502: Convert to use .probe_newAxel Lin
Use the new .probe_new for mcp16502. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210526125026.82549-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01regulator: bd70528: Drop BD70528 supportMatti Vaittinen
The only known BD70528 use-cases are such that the PMIC is controlled from separate MCU which is not running Linux. I am not aware of any Linux driver users. Furthermore, it seems there is no demand for this IC. Let's ease the maintenance burden and drop the driver. We can always add it back if there is sudden need for it. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/d7271362129edceebc512b49efed9ee7c3efcb6a.1622116622.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01regulator: lp8755: Convert to use regulator_set_ramp_delay_regmapAxel Lin
Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210527144248.247992-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01regulator: mt6315: Don't ignore devm_regulator_register failureAxel Lin
Also use dev_err instead of dev_notice for messages in error conditions. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210530020543.418634-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01regulator: pca9450: Convert to use regulator_set_ramp_delay_regmapAxel Lin
Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210526122408.78156-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-06-01regulator: core: Add regulator_sync_voltage_rdev()Dmitry Osipenko
Some NVIDIA Tegra devices use a CPU soft-reset method for the reboot and in this case we need to restore the coupled voltages to the state that is suitable for hardware during boot. Add new regulator_sync_voltage_rdev() helper which is needed by regulator drivers in order to sync voltage of a coupled regulators. Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
2021-05-27regulator: bd71815: fix platform_no_drv_owner.cocci warningsZou Wei
./drivers/regulator/bd71815-regulator.c:644: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 Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zou Wei <zou_wei@huawei.com> Acked-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Message-Id: <1622109244-54739-1-git-send-email-zou_wei@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-26regulator: rk808: Convert to use regulator_set_ramp_delay_regmapAxel Lin
Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Message-Id: <20210525141203.2562884-1-axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-25regulator: rt4831: Add missing .owner field in regulator_descAxel Lin
Add missing .owner field in regulator_desc, which is used for refcounting. Signed-off-by: Axel Lin <axel.lin@ingics.com> Message-Id: <20210524123735.2363676-1-axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@sirena.org.uk>
2021-05-25regulator: mp5416: Convert to use regulator_set_ramp_delay_regmapAxel Lin
Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Message-Id: <20210522023018.2025188-1-axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@sirena.org.uk>
2021-05-25regulator: mp886x: Convert to use regulator_set_ramp_delay_regmapAxel Lin
Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Message-Id: <20210525102708.2519323-1-axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@sirena.org.uk>
2021-05-25regulator: qcom_smd: Make pm8953_lnldo linear_ranges entries properly sortedAxel Lin
For better readability, make linear_ranges entries sort by selector. Signed-off-by: Axel Lin <axel.lin@ingics.com> Message-Id: <20210520112719.1814396-1-axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@sirena.org.uk>
2021-05-24regulator: bd70528: Convert to use regulator_set_ramp_delay_regmapAxel Lin
Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/20210522124250.2121076-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-24regulator: max8973: Convert to use regulator_set_ramp_delay_regmapAxel Lin
Use regulator_set_ramp_delay_regmap instead of open-coded. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210522040814.2042397-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-24regulator: bd71815: add select to fix buildRandy Dunlap
Mend the Kconfig for REGULATOR_BD71815 to prevent build errors: riscv32-linux-ld: drivers/regulator/bd71815-regulator.o: in function `.L0 ': regulator.c:289: undefined reference to `rohm_regulator_set_dvs_levels' riscv32-linux-ld: drivers/regulator/bd71815-regulator.c:370: undefined reference to `rohm_regulator_set_dvs_levels' Fixes: 1aad39001e85 ("regulator: Support ROHM BD71815 regulators") Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Cc: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Cc: Lee Jones <lee.jones@linaro.org> Cc: Mark Brown <broonie@kernel.org> Cc: Liam Girdwood <lgirdwood@gmail.com> Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/20210523001427.13500-1-rdunlap@infradead.org Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-19regulator: fan53555: Cleanup unused define and redundant assignmentAxel Lin
TCS_VSEL_NSEL_MASK is not used so remove it. Also remove redundant assignment for di->slew_reg. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210517010318.1027949-2-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-19regulator: fan53555: Fix slew_shift setting for tcs4525Axel Lin
Fix trivial copy-paste mistake. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210517010318.1027949-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-18regulator: fan53880: Convert to use .probe_newAxel Lin
Use the new .probe_new for fan53880. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Christoph Fritz <chf.fritz@googlemail.com> Link: https://lore.kernel.org/r/20210517105325.1227393-2-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-18regulator: bd71815: Fix missing include filesAxel Lin
Include linux/of.h and linux/gpio/consumer.h to fix below errors: error: implicit declaration of function ‘of_match_ptr’ error: implicit declaration of function ‘devm_gpiod_get_from_of_node’ Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/20210518114843.1495152-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12Merge branch 'for-5.13' of ↵Mark Brown
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-5.14
2021-05-12regulator: fan53555: fix tcs4525 function namesPeter Geis
The tcs4525 is based off the fan53526. Rename the tcs4525 functions to align with this. Signed-off-by: Peter Geis <pgwipeout@gmail.com> Link: https://lore.kernel.org/r/20210511211335.2935163-4-pgwipeout@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12regulator: fan53555: only bind tcs4525 to correct chip idPeter Geis
The tcs4525 regulator has a chip id of <12>. Only allow the driver to bind to the correct chip id for safety, in accordance with the other supported devices. Signed-off-by: Peter Geis <pgwipeout@gmail.com> Link: https://lore.kernel.org/r/20210511211335.2935163-3-pgwipeout@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12regulator: fan53555: fix TCS4525 voltage calulationPeter Geis
The TCS4525 has 128 voltage steps. With the calculation set to 127 the most significant bit is disregarded which leads to a miscalculation of the voltage by about 200mv. Fix the calculation to end deadlock on the rk3566-quartz64 which uses this as the cpu regulator. Fixes: 914df8faa7d6 ("regulator: fan53555: Add TCS4525 DCDC support") Signed-off-by: Peter Geis <pgwipeout@gmail.com> Link: https://lore.kernel.org/r/20210511211335.2935163-2-pgwipeout@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-05-12Merge series "regulator: fan53555: tcs4525 fix and cleanup" from Peter Geis ↵Mark Brown
<pgwipeout@gmail.com>: The tcs4525 voltage calculation is incorrect, which leads to a deadlock on the rk3566-quartz64 board when loading cpufreq. Fix the voltage calculation to correct the deadlock. While we are at it, add a safety check and clean up the function names to be more accurate. Peter Geis (3): regulator: fan53555: fix TCS4525 voltage calulation regulator: fan53555: only bind tcs4525 to correct chip id regulator: fan53555: fix tcs4525 function names drivers/regulator/fan53555.c | 44 ++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 17 deletions(-) -- 2.25.1