Skip to content

Commit

Permalink
Merge tag 'regulator-v6.8' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/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
  ...
  • Loading branch information
torvalds committed Jan 9, 2024
2 parents 83130ff + 1cadc04 commit da96801
Show file tree
Hide file tree
Showing 30 changed files with 638 additions and 141 deletions.
7 changes: 7 additions & 0 deletions Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5544,6 +5544,13 @@
print every Nth verbose statement, where N is the value
specified.

regulator_ignore_unused
[REGULATOR]
Prevents regulator framework from disabling regulators
that are unused, due no driver claiming them. This may
be useful for debug and development, but should not be
needed on a platform with proper driver support.

relax_domain_level=
[KNL, SMP] Set scheduler's default relax_domain_level.
See Documentation/admin-guide/cgroup-v1/cpusets.rst.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ properties:
description:
Interrupt signaling a critical under-voltage event.

system-critical-regulator: true

required:
- compatible
- regulator-name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ description: |
For PM7325, smps1 - smps8, ldo1 - ldo19
For PM8005, smps1 - smps4
For PM8009, smps1 - smps2, ldo1 - ldo7
For PM8010, ldo1 - ldo7
For PM8150, smps1 - smps10, ldo1 - ldo18
For PM8150L, smps1 - smps8, ldo1 - ldo11, bob, flash, rgb
For PM8350, smps1 - smps12, ldo1 - ldo10
Expand All @@ -68,6 +69,7 @@ properties:
- qcom,pm8005-rpmh-regulators
- qcom,pm8009-rpmh-regulators
- qcom,pm8009-1-rpmh-regulators
- qcom,pm8010-rpmh-regulators
- qcom,pm8150-rpmh-regulators
- qcom,pm8150l-rpmh-regulators
- qcom,pm8350-rpmh-regulators
Expand Down Expand Up @@ -238,6 +240,18 @@ allOf:
"^vdd-l[1-47]-supply$": true
"^vdd-s[1-2]-supply$": true

- if:
properties:
compatible:
enum:
- qcom,pm8010-rpmh-regulators
then:
properties:
vdd-l1-l2-supply: true
vdd-l3-l4-supply: true
patternProperties:
"^vdd-l[5-7]-supply$": true

- if:
properties:
compatible:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ description:
For pm8916, s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
l12, l13, l14, l15, l16, l17, l18

For pm8937, s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10,
l11, l12, l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23

For pm8941, s1, s2, s3, s4, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
l12, l13, l14, l15, l16, l17, l18, l19, l20, l21, l22, l23, l24, lvs1, lvs2,
lvs3, 5vs1, 5vs2
Expand Down Expand Up @@ -92,6 +95,7 @@ properties:
- qcom,rpm-pm8841-regulators
- qcom,rpm-pm8909-regulators
- qcom,rpm-pm8916-regulators
- qcom,rpm-pm8937-regulators
- qcom,rpm-pm8941-regulators
- qcom,rpm-pm8950-regulators
- qcom,rpm-pm8953-regulators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ properties:
- qcom,pm8841-regulators
- qcom,pm8909-regulators
- qcom,pm8916-regulators
- qcom,pm8937-regulators
- qcom,pm8941-regulators
- qcom,pm8950-regulators
- qcom,pm8994-regulators
Expand Down Expand Up @@ -291,6 +292,24 @@ allOf:
patternProperties:
"^vdd_s[1-3]-supply$": true

- if:
properties:
compatible:
contains:
enum:
- qcom,pm8937-regulators
then:
properties:
vdd_l1_l19-supply: true
vdd_l20_l21-supply: true
vdd_l2_l23-supply: true
vdd_l3-supply: true
vdd_l4_l5_l6_l7_l16-supply: true
vdd_l8_l11_l12_l17_l22-supply: true
vdd_l9_l10_l13_l14_l15_l18-supply: true
patternProperties:
"^vdd_s[1-6]-supply$": true

- if:
properties:
compatible:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ unevaluatedProperties: false

examples:
- |
pm8150b {
pmic {
#address-cells = <1>;
#size-cells = <0>;
pm8150b_vbus: usb-vbus-regulator@1100 {
usb-vbus-regulator@1100 {
compatible = "qcom,pm8150b-vbus-reg";
reg = <0x1100>;
regulator-min-microamp = <500000>;
Expand Down
13 changes: 13 additions & 0 deletions Documentation/devicetree/bindings/regulator/regulator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ properties:
description: Enable pull down resistor when the regulator is disabled.
type: boolean

system-critical-regulator:
description: Set if the regulator is critical to system stability or
functionality.
type: boolean

regulator-over-current-protection:
description: Enable over current protection.
type: boolean
Expand Down Expand Up @@ -181,6 +186,14 @@ properties:
be enabled but limit setting can be omitted. Limit is given as microvolt
offset from voltage set to regulator.

regulator-uv-less-critical-window-ms:
description: Specifies the time window (in milliseconds) following a
critical under-voltage event during which the system can continue to
operate safely while performing less critical operations. This property
provides a defined duration before a more severe reaction to the
under-voltage event is needed, allowing for certain non-urgent actions to
be carried out in preparation for potential power loss.

regulator-temp-protection-kelvin:
description: Set over temperature protection limit. This is a limit where
hardware performs emergency shutdown. Zero can be passed to disable
Expand Down
10 changes: 10 additions & 0 deletions drivers/regulator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ config REGULATOR_USERSPACE_CONSUMER

If unsure, say no.

config REGULATOR_NETLINK_EVENTS
bool "Enable support for receiving regulator events via netlink"
depends on NET
help
Enabling this option allows the kernel to broadcast regulator events using
the netlink mechanism. User-space applications can subscribe to these events
for real-time updates on various regulator events.

If unsure, say no.

config REGULATOR_88PG86X
tristate "Marvell 88PG86X voltage regulators"
depends on I2C
Expand Down
1 change: 1 addition & 0 deletions drivers/regulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


obj-$(CONFIG_REGULATOR) += core.o dummy.o fixed-helper.o helpers.o devres.o irq_helpers.o
obj-$(CONFIG_REGULATOR_NETLINK_EVENTS) += event.o
obj-$(CONFIG_OF) += of_regulator.o
obj-$(CONFIG_REGULATOR_FIXED_VOLTAGE) += fixed.o
obj-$(CONFIG_REGULATOR_VIRTUAL_CONSUMER) += virtual.o
Expand Down
8 changes: 3 additions & 5 deletions drivers/regulator/arizona-ldo1.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,12 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
return ret;
}

static int arizona_ldo1_remove(struct platform_device *pdev)
static void arizona_ldo1_remove(struct platform_device *pdev)
{
struct arizona_ldo1 *ldo1 = platform_get_drvdata(pdev);

if (ldo1->ena_gpiod)
gpiod_put(ldo1->ena_gpiod);

return 0;
}

static int madera_ldo1_probe(struct platform_device *pdev)
Expand Down Expand Up @@ -377,7 +375,7 @@ static int madera_ldo1_probe(struct platform_device *pdev)

static struct platform_driver arizona_ldo1_driver = {
.probe = arizona_ldo1_probe,
.remove = arizona_ldo1_remove,
.remove_new = arizona_ldo1_remove,
.driver = {
.name = "arizona-ldo1",
.probe_type = PROBE_FORCE_SYNCHRONOUS,
Expand All @@ -386,7 +384,7 @@ static struct platform_driver arizona_ldo1_driver = {

static struct platform_driver madera_ldo1_driver = {
.probe = madera_ldo1_probe,
.remove = arizona_ldo1_remove,
.remove_new = arizona_ldo1_remove,
.driver = {
.name = "madera-ldo1",
.probe_type = PROBE_FORCE_SYNCHRONOUS,
Expand Down
5 changes: 2 additions & 3 deletions drivers/regulator/bd9571mwv-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,9 @@ static const struct dev_pm_ops bd9571mwv_pm = {
SET_SYSTEM_SLEEP_PM_OPS(bd9571mwv_suspend, bd9571mwv_resume)
};

static int bd9571mwv_regulator_remove(struct platform_device *pdev)
static void bd9571mwv_regulator_remove(struct platform_device *pdev)
{
device_remove_file(&pdev->dev, &dev_attr_backup_mode);
return 0;
}
#define DEV_PM_OPS &bd9571mwv_pm
#else
Expand Down Expand Up @@ -357,7 +356,7 @@ static struct platform_driver bd9571mwv_regulator_driver = {
.pm = DEV_PM_OPS,
},
.probe = bd9571mwv_regulator_probe,
.remove = bd9571mwv_regulator_remove,
.remove_new = bd9571mwv_regulator_remove,
.id_table = bd9571mwv_regulator_id_table,
};
module_platform_driver(bd9571mwv_regulator_driver);
Expand Down
Loading

0 comments on commit da96801

Please sign in to comment.