Commit Graph

20 Commits

Author SHA1 Message Date
Jiapeng Chong e1eb745006
regulator: stpmic1: Fix kernel-doc notation warnings
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>
2023-11-13 01:26:32 +00:00
Douglas Anderson d3b81d97d5
regulator: Set PROBE_PREFER_ASYNCHRONOUS for drivers between 4.19 and 5.4
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>
2023-03-20 13:11:27 +00:00
Rob Herring 5bd73a162b
regulator: Use of_property_read_bool() for boolean properties
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>
2023-03-11 12:13:42 +00:00
Matti Vaittinen 89a6a5e56c
regulator: add property parsing and callbacks to set protection limits
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>
2021-06-21 13:08:41 +01:00
Michał Mirosław e9c142b0d2
regulator: remove locking around regulator_notifier_call_chain()
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>
2020-09-07 18:35:25 +01:00
Lee Jones ec84a7dff4
regulator: stpmic1_regulator: Properly document 'struct stpmic1_regulator_cfg'
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>
2020-06-26 15:34:20 +01:00
Matti Vaittinen 60ab7f4153
regulator: use linear_ranges helper
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>
2020-05-08 18:18:13 +01:00
Pascal Paillet 9ebde17c5d
regulator: stpmic1: Set a default ramp delay value
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>
2019-11-15 12:05:47 +00:00
Mark Brown 16646d8d3d
Merge branch 'regulator-5.0' into regulator-5.1 stpmic1 const/range 2019-02-19 11:06:41 +00:00
Pascal PAILLET-LME 48593a99a1
regulator: stpmic1: Change buck1 voltage range
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>
2019-02-19 11:04:54 +00:00
Pascal PAILLET-LME e6fff62ab8
regulator: stpmic1: Add active discharge support
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>
2019-02-19 11:02:55 +00:00
Pascal PAILLET-LME 1614f086d5
regulator: stpmic1: Remove support for regulator pull down
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>
2019-02-19 11:02:36 +00:00
Pascal PAILLET-LME 8c44e44858
regulator: stpmic1: Simplify regulators registration
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>
2019-02-19 11:02:18 +00:00
Pascal PAILLET-LME b9058da819
regulator: stpmic1: Use regulator mode definition from bindings
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>
2019-02-19 11:01:59 +00:00
Axel Lin ef541f73d1
regulator: stpmic1: Remove regul_id and *regmap from struct stpmic1_regulator
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>
2019-02-18 18:28:06 +00:00
Axel Lin 7c027c66f2
regulator: stpmic1: Add static const qualifier at peroper places
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>
2019-01-23 15:51:46 +00:00
Pascal PAILLET-LME db6e6244cb
regulator: stpmic1: fix regulator_lock usage
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>
2018-12-03 11:39:24 +00:00
Dmitry Osipenko f8702f9e4a
regulator: core: Use ww_mutex for regulators locking
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>
2018-11-19 12:33:17 +00:00
Axel Lin c18fb34ae1
regulator: stpmic1: Return REGULATOR_MODE_INVALID for invalid mode
-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>
2018-10-10 12:28:41 +01:00
pascal paillet ca55b7185b
regulator: stpmic1: add stpmic1 regulator driver
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>
2018-10-08 18:28:10 +01:00