Skip to content

Commit da96801

Browse files
committed
Merge tag 'regulator-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator updates from Mark Brown: "The main updates for this release are around monitoring of regulators, largely for error handling purposes. We allow the stream of regulator events to be seen by userspace as netlink events and allow system integrators to describe individual regulators as system critical with information on how long the system is expected to last on error. The system level error handling is very much about best effort problem mitigation rather than providing something fully robust, the initial drive was to provide a mechanism for trying to avoid initiating any new writes to flash once we notice the power going out. Otherwise it's very quiet, mainly several new Qualcomm devices. - Support for marking regulators as system critical and providing information on how long the system might last with those regulators in a failure state, hooked into the existing critical shutdown error handling. - Optional support for generating netlink events for events, there are use cases for system monitoring UIs and error handling. - A command line option to leave unused controllable regulators enabled, useful for debugging. We already only disable regulators we were explicitly given permission to control. - Support for Quacomm MP5496, PM8010 and PM8937" * tag 'regulator-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (31 commits) regulator: event: Ensure atomicity for sequence number uapi: regulator: Fix typo regulator: Reuse LINEAR_RANGE() in REGULATOR_LINEAR_RANGE() dt-bindings: regulator: qcom,usb-vbus-regulator: clean up example regulator: qcom_smd: Add LDO5 MP5496 regulator regulator: qcom-rpmh: add support for pm8010 regulators regulator: dt-bindings: qcom,rpmh: add compatible for pm8010 regulator: qcom-rpmh: extend to support multiple linear voltage ranges regulator: wm8350: Convert to platform remove callback returning void regulator: virtual: Convert to platform remove callback returning void regulator: userspace-consumer: Convert to platform remove callback returning void regulator: uniphier: Convert to platform remove callback returning void regulator: stm32-vrefbuf: Convert to platform remove callback returning void regulator: db8500-prcmu: Convert to platform remove callback returning void regulator: bd9571mwv: Convert to platform remove callback returning void regulator: arizona-ldo1: Convert to platform remove callback returning void regulator: event: Add regulator netlink event support regulator: event: Add regulator netlink event support regulator: stpmic1: Fix kernel-doc notation warnings regulator: palmas: remove redundant initialization of pointer pdata ...
2 parents 83130ff + 1cadc04 commit da96801

30 files changed

+638
-141
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5544,6 +5544,13 @@
55445544
print every Nth verbose statement, where N is the value
55455545
specified.
55465546

5547+
regulator_ignore_unused
5548+
[REGULATOR]
5549+
Prevents regulator framework from disabling regulators
5550+
that are unused, due no driver claiming them. This may
5551+
be useful for debug and development, but should not be
5552+
needed on a platform with proper driver support.
5553+
55475554
relax_domain_level=
55485555
[KNL, SMP] Set scheduler's default relax_domain_level.
55495556
See Documentation/admin-guide/cgroup-v1/cpusets.rst.

Documentation/devicetree/bindings/regulator/fixed-regulator.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ properties:
105105
description:
106106
Interrupt signaling a critical under-voltage event.
107107

108+
system-critical-regulator: true
109+
108110
required:
109111
- compatible
110112
- regulator-name

Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ description: |
4242
For PM7325, smps1 - smps8, ldo1 - ldo19
4343
For PM8005, smps1 - smps4
4444
For PM8009, smps1 - smps2, ldo1 - ldo7
45+
For PM8010, ldo1 - ldo7
4546
For PM8150, smps1 - smps10, ldo1 - ldo18
4647
For PM8150L, smps1 - smps8, ldo1 - ldo11, bob, flash, rgb
4748
For PM8350, smps1 - smps12, ldo1 - ldo10
@@ -68,6 +69,7 @@ properties:
6869
- qcom,pm8005-rpmh-regulators
6970
- qcom,pm8009-rpmh-regulators
7071
- qcom,pm8009-1-rpmh-regulators
72+
- qcom,pm8010-rpmh-regulators
7173
- qcom,pm8150-rpmh-regulators
7274
- qcom,pm8150l-rpmh-regulators
7375
- qcom,pm8350-rpmh-regulators
@@ -238,6 +240,18 @@ allOf:
238240
"^vdd-l[1-47]-supply$": true
239241
"^vdd-s[1-2]-supply$": true
240242

243+
- if:
244+
properties:
245+
compatible:
246+
enum:
247+
- qcom,pm8010-rpmh-regulators
248+
then:
249+
properties:
250+
vdd-l1-l2-supply: true
251+
vdd-l3-l4-supply: true
252+
patternProperties:
253+
"^vdd-l[5-7]-supply$": true
254+
241255
- if:
242256
properties:
243257
compatible:

Documentation/devicetree/bindings/regulator/qcom,smd-rpm-regulator.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ description:
4747
For pm8916, s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
4848
l12, l13, l14, l15, l16, l17, l18
4949

50+
For pm8937, s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10,
51+
l11, l12, l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23
52+
5053
For pm8941, s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
5154
l12, l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2,
5255
lvs3, 5vs1, 5vs2
@@ -92,6 +95,7 @@ properties:
9295
- qcom,rpm-pm8841-regulators
9396
- qcom,rpm-pm8909-regulators
9497
- qcom,rpm-pm8916-regulators
98+
- qcom,rpm-pm8937-regulators
9599
- qcom,rpm-pm8941-regulators
96100
- qcom,rpm-pm8950-regulators
97101
- qcom,rpm-pm8953-regulators

Documentation/devicetree/bindings/regulator/qcom,spmi-regulator.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ properties:
2222
- qcom,pm8841-regulators
2323
- qcom,pm8909-regulators
2424
- qcom,pm8916-regulators
25+
- qcom,pm8937-regulators
2526
- qcom,pm8941-regulators
2627
- qcom,pm8950-regulators
2728
- qcom,pm8994-regulators
@@ -291,6 +292,24 @@ allOf:
291292
patternProperties:
292293
"^vdd_s[1-3]-supply$": true
293294

295+
- if:
296+
properties:
297+
compatible:
298+
contains:
299+
enum:
300+
- qcom,pm8937-regulators
301+
then:
302+
properties:
303+
vdd_l1_l19-supply: true
304+
vdd_l20_l21-supply: true
305+
vdd_l2_l23-supply: true
306+
vdd_l3-supply: true
307+
vdd_l4_l5_l6_l7_l16-supply: true
308+
vdd_l8_l11_l12_l17_l22-supply: true
309+
vdd_l9_l10_l13_l14_l15_l18-supply: true
310+
patternProperties:
311+
"^vdd_s[1-6]-supply$": true
312+
294313
- if:
295314
properties:
296315
compatible:

Documentation/devicetree/bindings/regulator/qcom,usb-vbus-regulator.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ unevaluatedProperties: false
3636

3737
examples:
3838
- |
39-
pm8150b {
39+
pmic {
4040
#address-cells = <1>;
4141
#size-cells = <0>;
42-
pm8150b_vbus: usb-vbus-regulator@1100 {
42+
43+
usb-vbus-regulator@1100 {
4344
compatible = "qcom,pm8150b-vbus-reg";
4445
reg = <0x1100>;
4546
regulator-min-microamp = <500000>;

Documentation/devicetree/bindings/regulator/regulator.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ properties:
114114
description: Enable pull down resistor when the regulator is disabled.
115115
type: boolean
116116

117+
system-critical-regulator:
118+
description: Set if the regulator is critical to system stability or
119+
functionality.
120+
type: boolean
121+
117122
regulator-over-current-protection:
118123
description: Enable over current protection.
119124
type: boolean
@@ -181,6 +186,14 @@ properties:
181186
be enabled but limit setting can be omitted. Limit is given as microvolt
182187
offset from voltage set to regulator.
183188

189+
regulator-uv-less-critical-window-ms:
190+
description: Specifies the time window (in milliseconds) following a
191+
critical under-voltage event during which the system can continue to
192+
operate safely while performing less critical operations. This property
193+
provides a defined duration before a more severe reaction to the
194+
under-voltage event is needed, allowing for certain non-urgent actions to
195+
be carried out in preparation for potential power loss.
196+
184197
regulator-temp-protection-kelvin:
185198
description: Set over temperature protection limit. This is a limit where
186199
hardware performs emergency shutdown. Zero can be passed to disable

drivers/regulator/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ config REGULATOR_USERSPACE_CONSUMER
5656

5757
If unsure, say no.
5858

59+
config REGULATOR_NETLINK_EVENTS
60+
bool "Enable support for receiving regulator events via netlink"
61+
depends on NET
62+
help
63+
Enabling this option allows the kernel to broadcast regulator events using
64+
the netlink mechanism. User-space applications can subscribe to these events
65+
for real-time updates on various regulator events.
66+
67+
If unsure, say no.
68+
5969
config REGULATOR_88PG86X
6070
tristate "Marvell 88PG86X voltage regulators"
6171
depends on I2C

drivers/regulator/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66

77
obj-$(CONFIG_REGULATOR) += core.o dummy.o fixed-helper.o helpers.o devres.o irq_helpers.o
8+
obj-$(CONFIG_REGULATOR_NETLINK_EVENTS) += event.o
89
obj-$(CONFIG_OF) += of_regulator.o
910
obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o
1011
obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o

drivers/regulator/arizona-ldo1.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,12 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
339339
return ret;
340340
}
341341

342-
static int arizona_ldo1_remove(struct platform_device *pdev)
342+
static void arizona_ldo1_remove(struct platform_device *pdev)
343343
{
344344
struct arizona_ldo1 *ldo1 = platform_get_drvdata(pdev);
345345

346346
if (ldo1->ena_gpiod)
347347
gpiod_put(ldo1->ena_gpiod);
348-
349-
return 0;
350348
}
351349

352350
static int madera_ldo1_probe(struct platform_device *pdev)
@@ -377,7 +375,7 @@ static int madera_ldo1_probe(struct platform_device *pdev)
377375

378376
static struct platform_driver arizona_ldo1_driver = {
379377
.probe = arizona_ldo1_probe,
380-
.remove = arizona_ldo1_remove,
378+
.remove_new = arizona_ldo1_remove,
381379
.driver = {
382380
.name = "arizona-ldo1",
383381
.probe_type = PROBE_FORCE_SYNCHRONOUS,
@@ -386,7 +384,7 @@ static struct platform_driver arizona_ldo1_driver = {
386384

387385
static struct platform_driver madera_ldo1_driver = {
388386
.probe = madera_ldo1_probe,
389-
.remove = arizona_ldo1_remove,
387+
.remove_new = arizona_ldo1_remove,
390388
.driver = {
391389
.name = "madera-ldo1",
392390
.probe_type = PROBE_FORCE_SYNCHRONOUS,

0 commit comments

Comments
 (0)