summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/stpmic1_regulator.c
Commit message (Collapse)AuthorAgeFilesLines
* regulator: stpmic1: Fix kernel-doc notation warningsJiapeng Chong2023-11-131-1/+1
| | | | | | | | | | | | No functional modification involved. drivers/regulator/stpmic1_regulator.c:31: warning: expecting prototype for struct stpmic1. Prototype was for struct stpmic1_regulator_cfg instead. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7206 Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Link: https://lore.kernel.org/r/20231109073925.98783-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers between 4.19 and 5.4Douglas Anderson2023-03-201-0/+1
| | | | | | | | | | This follows on the change ("regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in 4.14") but changes regulators didn't exist in Linux 4.19 but did exist in Linux 5.4. Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://lore.kernel.org/r/20230316125351.3.I45bf925ca9537da5f647e2acb0ad207c0c98af81@changeid Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: Use of_property_read_bool() for boolean propertiesRob Herring2023-03-111-1/+1
| | | | | | | | | | | It is preferred to use typed property access functions (i.e. of_property_read_<type> functions) rather than low-level of_get_property/of_find_property functions for reading properties. Convert reading boolean properties to to of_property_read_bool(). Signed-off-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20230310144722.1544843-1-robh@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: add property parsing and callbacks to set protection limitsMatti Vaittinen2021-06-211-2/+18
| | | | | | | | | Add DT property parsing code and setting callback for regulator over/under voltage, over-current and temperature error limits. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/e7b8007ba9eae7076178bf3363fb942ccb1cc9a5.1622628334.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: remove locking around regulator_notifier_call_chain()Michał Mirosław2020-09-071-4/+0
| | | | | | | | | | | regulator_notifier_call_chain() doesn't need rdev lock and rdev's existence is assumed in the code anyway. Remove the locks from drivers. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/42393f66dcc4d80dcd9797be45216b4035aa96cb.1597032945.git.mirq-linux@rere.qmqm.pl Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: stpmic1_regulator: Properly document 'struct stpmic1_regulator_cfg'Lee Jones2020-06-261-1/+1
| | | | | | | | | | | | | | In kerneldoc format, data structures have to start with 'struct' else the kerneldoc tooling/parsers/validators get confused. Fixes the following W=1 kernel build warning: drivers/regulator/stpmic1_regulator.c:25: warning: cannot understand function prototype: 'struct stpmic1_regulator_cfg ' Signed-off-by: Lee Jones <lee.jones@linaro.org> Cc: Pascal Paillet <p.paillet@st.com> Link: https://lore.kernel.org/r/20200626065738.93412-5-lee.jones@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: use linear_ranges helperMatti Vaittinen2020-05-081-9/+9
| | | | | | | | | | | Change the regulator helpers to use common linear_ranges code. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Reviewed-by: Mark Brown <broonie@kernel.org> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Link: https://lore.kernel.org/r/64f01d5e381b8631a271616b7790f9d5640974fb.1588944082.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: stpmic1: Set a default ramp delay valuePascal Paillet2019-11-151-0/+6
| | | | | | | | | Set a default ramp delay value to the regulators with the worst case value. Signed-off-by: pascal paillet <p.paillet@st.com> Link: https://lore.kernel.org/r/20191113161529.27739-1-p.paillet@st.com Signed-off-by: Mark Brown <broonie@kernel.org>
* Merge branch 'regulator-5.0' into regulator-5.1 stpmic1 const/rangeMark Brown2019-02-191-2/+3
|\
| * regulator: stpmic1: Change buck1 voltage rangePascal PAILLET-LME2019-02-191-3/+4
| | | | | | | | | | | | | | Change buck1 voltage range to be conform with the data-sheet. Signed-off-by: pascal paillet <p.paillet@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: stpmic1: Add active discharge supportPascal PAILLET-LME2019-02-191-13/+55
| | | | | | | | | | | | | | Add support for active discharge for USB power switches. Signed-off-by: pascal paillet <p.paillet@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: stpmic1: Remove support for regulator pull downPascal PAILLET-LME2019-02-191-12/+0
| | | | | | | | | | | | | | | | Regulator high pull down are enabled by default so remove support in the driver. Signed-off-by: pascal paillet <p.paillet@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: stpmic1: Simplify regulators registrationPascal PAILLET-LME2019-02-191-116/+52
| | | | | | | | | | | | | | | | | | Stop using a regulator_init callback. This leads to a more simple regulator registration code. This also permits to spuress struct stpmic1_regulator. Also rename stpmic1_regulators_matches to stpmic1_matches. Signed-off-by: pascal paillet <p.paillet@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: stpmic1: Use regulator mode definition from bindingsPascal PAILLET-LME2019-02-191-3/+2
| | | | | | | | | | | | | | Get the regulator mode definition from the bindings header. Signed-off-by: pascal paillet <p.paillet@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: stpmic1: Remove regul_id and *regmap from struct stpmic1_regulatorAxel Lin2019-02-181-8/+4
| | | | | | | | | | | | | | | | | | At the context with *rdev available, regulator core provides rdev_get_id()/rdev_get_regmap() APIs to get regulator id and *regmap. So no need to store them in struct stpmic1_regulator. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | regulator: stpmic1: Add static const qualifier at peroper placesAxel Lin2019-01-231-21/+17
|/ | | | | | | | | | The regulator_linear_range arrays and stpmic1_regulator_cfgs are only accessed by this driver and the values are never changed so make them static const. regulator_ops variables can also be const. Also clean up a few empty lines in regulator_linear_range array. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: stpmic1: fix regulator_lock usagePascal PAILLET-LME2018-12-031-1/+1
| | | | | | | fix a compilation issue due to regulator_lock usage. Signed-off-by: Pascal Paillet <p.paillet@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: core: Use ww_mutex for regulators lockingDmitry Osipenko2018-11-191-2/+2
| | | | | | | | | Wait/wound mutex shall be used in order to avoid lockups on locking of coupled regulators. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Suggested-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: stpmic1: Return REGULATOR_MODE_INVALID for invalid modeAxel Lin2018-10-101-1/+1
| | | | | | | | -EINVAL is not a valid return value for .of_map_mode, return REGULATOR_MODE_INVALID instead. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: stpmic1: add stpmic1 regulator driverpascal paillet2018-10-081-0/+674
The stpmic1 PMIC embeds several regulators and switches with different capabilities. Signed-off-by: pascal paillet <p.paillet@st.com> Signed-off-by: Mark Brown <broonie@kernel.org>