Commit c4d11ccb authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'regulator-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator updates from Mark Brown:
 "A small update for the regualtor API for this cycle, some small fixes
  and a bunch of new devices but none of them very big.

  The most stand out thing is the regulator-fixed-clock driver which is
  for regulators where the enable control is done by using a clock
  instead of a GPIO or register write, a novel hardware design that had
  not previously come up.

  Summary:

   - Added a keyword pattern for regulator_get_optional() since usage of
     that API generally needs extra review.

   - Operating mode and suspend state support for act8865.

   - New device support for Active Semiconductor ACT8600 chargers,
     Mediatek MT6358, Qualcomm SM8150, regulator-fixed-clock, and
     Synoptics SY20276, SY20278 and SY8824E"

* tag 'regulator-v5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: (52 commits)
  regulator: core: Fix error return for /sys access
  regulator: da9211: fix obtaining "enable" GPIO
  regulator: max77686: fix obtaining "maxim,ena" GPIO
  regulator: uniphier: Add Pro5 USB3 VBUS support
  dt-bindings: regulator: add regulator-fixed-clock binding
  regulator: fixed: add possibility to enable by clock
  regulator: s2mps11: Consistently use local variable
  regulator: lp87565: Simplify lp87565_buck_set_ramp_delay
  regulator: slg51000: use devm_gpiod_get_optional() in probe
  regulator: lp8788-ldo: make array en_mask static const, makes object smaller
  regulator: tps65132: Stop parsing DT when gpio is not found
  regulator: Defer init completion for a while after late_initcall
  regulator: add missing 'static inline' to a helper's stub
  regulator: provide regulator_bulk_set_supply_names()
  MAINTAINERS: Add keyword pattern on regulator_get_optional()
  regulator: sy8824x: add prefixes to BUCK_EN and MODE macros
  regulator: sy8824x: use c++style for the comment block near SPDX
  regulator: mt6358: Add BROKEN dependency while waiting for MFD to merge
  regulator: mt6358: Add support for MT6358 regulator
  regulator: Add document for MT6358 regulator
  ...
parents 0372fd1a c4ad8502
......@@ -34,6 +34,9 @@ Optional input supply properties:
- inl67-supply: The input supply for LDO_REG3 and LDO_REG4
Any standard regulator properties can be used to configure the single regulator.
regulator-initial-mode, regulator-allowed-modes and regulator-mode could be specified
for act8865 using mode values from dt-bindings/regulator/active-semi,8865-regulator.h
file.
The valid names for regulators are:
- for act8846:
......@@ -47,6 +50,8 @@ The valid names for regulators are:
Example:
--------
#include <dt-bindings/regulator/active-semi,8865-regulator.h>
i2c1: i2c@f0018000 {
pmic: act8865@5b {
compatible = "active-semi,act8865";
......@@ -65,9 +70,19 @@ Example:
regulator-name = "VCC_1V2";
regulator-min-microvolt = <1100000>;
regulator-max-microvolt = <1300000>;
regulator-suspend-mem-microvolt = <1150000>;
regulator-suspend-standby-microvolt = <1150000>;
regulator-always-on;
regulator-allowed-modes = <ACT8865_REGULATOR_MODE_FIXED>,
<ACT8865_REGULATOR_MODE_LOWPOWER>;
regulator-initial-mode = <ACT8865_REGULATOR_MODE_FIXED>;
regulator-state-mem {
regulator-on-in-suspend;
regulator-suspend-min-microvolt = <1150000>;
regulator-suspend-max-microvolt = <1150000>;
regulator-changeable-in-suspend;
regulator-mode = <ACT8865_REGULATOR_MODE_LOWPOWER>;
};
};
vcc_3v3_reg: DCDC_REG3 {
......@@ -82,6 +97,14 @@ Example:
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
regulator-allowed-modes = <ACT8865_REGULATOR_MODE_NORMAL>,
<ACT8865_REGULATOR_MODE_LOWPOWER>;
regulator-initial-mode = <ACT8865_REGULATOR_MODE_NORMAL>;
regulator-state-mem {
regulator-off-in-suspend;
};
};
vddfuse_reg: LDO_REG2 {
......
......@@ -19,9 +19,19 @@ description:
allOf:
- $ref: "regulator.yaml#"
if:
properties:
compatible:
contains:
const: regulator-fixed-clock
required:
- clocks
properties:
compatible:
const: regulator-fixed
enum:
- const: regulator-fixed
- const: regulator-fixed-clock
regulator-name: true
......@@ -29,6 +39,13 @@ properties:
description: gpio to use for enable control
maxItems: 1
clocks:
description:
clock to use for enable control. This binding is only available if
the compatible is chosen to regulator-fixed-clock. The clock binding
is mandatory if compatible is chosen to regulator-fixed-clock.
maxItems: 1
startup-delay-us:
description: startup time in microseconds
$ref: /schemas/types.yaml#/definitions/uint32
......
MediaTek MT6358 Regulator
All voltage regulators provided by the MT6358 PMIC are described as the
subnodes of the MT6358 regulators node. Each regulator is named according
to its regulator type, buck_<name> and ldo_<name>. The definition for each
of these nodes is defined using the standard binding for regulators at
Documentation/devicetree/bindings/regulator/regulator.txt.
The valid names for regulators are::
BUCK:
buck_vdram1, buck_vcore, buck_vpa, buck_vproc11, buck_vproc12, buck_vgpu,
buck_vs2, buck_vmodem, buck_vs1
LDO:
ldo_vdram2, ldo_vsim1, ldo_vibr, ldo_vrf12, ldo_vio18, ldo_vusb, ldo_vcamio,
ldo_vcamd, ldo_vcn18, ldo_vfe28, ldo_vsram_proc11, ldo_vcn28, ldo_vsram_others,
ldo_vsram_gpu, ldo_vxo22, ldo_vefuse, ldo_vaux18, ldo_vmch, ldo_vbif28,
ldo_vsram_proc12, ldo_vcama1, ldo_vemc, ldo_vio28, ldo_va12, ldo_vrf18,
ldo_vcn33_bt, ldo_vcn33_wifi, ldo_vcama2, ldo_vmc, ldo_vldo28, ldo_vaud28,
ldo_vsim2
Example:
pmic {
compatible = "mediatek,mt6358";
mt6358regulator: mt6358regulator {
compatible = "mediatek,mt6358-regulator";
mt6358_vdram1_reg: buck_vdram1 {
regulator-compatible = "buck_vdram1";
regulator-name = "vdram1";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <2087500>;
regulator-ramp-delay = <12500>;
regulator-enable-ramp-delay = <0>;
regulator-always-on;
};
mt6358_vcore_reg: buck_vcore {
regulator-name = "vcore";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1293750>;
regulator-ramp-delay = <6250>;
regulator-enable-ramp-delay = <200>;
regulator-always-on;
};
mt6358_vpa_reg: buck_vpa {
regulator-name = "vpa";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <3650000>;
regulator-ramp-delay = <50000>;
regulator-enable-ramp-delay = <250>;
};
mt6358_vproc11_reg: buck_vproc11 {
regulator-name = "vproc11";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1293750>;
regulator-ramp-delay = <6250>;
regulator-enable-ramp-delay = <200>;
regulator-always-on;
};
mt6358_vproc12_reg: buck_vproc12 {
regulator-name = "vproc12";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1293750>;
regulator-ramp-delay = <6250>;
regulator-enable-ramp-delay = <200>;
regulator-always-on;
};
mt6358_vgpu_reg: buck_vgpu {
regulator-name = "vgpu";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1293750>;
regulator-ramp-delay = <6250>;
regulator-enable-ramp-delay = <200>;
};
mt6358_vs2_reg: buck_vs2 {
regulator-name = "vs2";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <2087500>;
regulator-ramp-delay = <12500>;
regulator-enable-ramp-delay = <0>;
regulator-always-on;
};
mt6358_vmodem_reg: buck_vmodem {
regulator-name = "vmodem";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1293750>;
regulator-ramp-delay = <6250>;
regulator-enable-ramp-delay = <900>;
regulator-always-on;
};
mt6358_vs1_reg: buck_vs1 {
regulator-name = "vs1";
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <2587500>;
regulator-ramp-delay = <12500>;
regulator-enable-ramp-delay = <0>;
regulator-always-on;
};
mt6358_vdram2_reg: ldo_vdram2 {
regulator-name = "vdram2";
regulator-min-microvolt = <600000>;
regulator-max-microvolt = <1800000>;
regulator-enable-ramp-delay = <3300>;
};
mt6358_vsim1_reg: ldo_vsim1 {
regulator-name = "vsim1";
regulator-min-microvolt = <1700000>;
regulator-max-microvolt = <3100000>;
regulator-enable-ramp-delay = <540>;
};
mt6358_vibr_reg: ldo_vibr {
regulator-name = "vibr";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <3300000>;
regulator-enable-ramp-delay = <60>;
};
mt6358_vrf12_reg: ldo_vrf12 {
compatible = "regulator-fixed";
regulator-name = "vrf12";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-enable-ramp-delay = <120>;
};
mt6358_vio18_reg: ldo_vio18 {
compatible = "regulator-fixed";
regulator-name = "vio18";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-enable-ramp-delay = <2700>;
regulator-always-on;
};
mt6358_vusb_reg: ldo_vusb {
regulator-name = "vusb";
regulator-min-microvolt = <3000000>;
regulator-max-microvolt = <3100000>;
regulator-enable-ramp-delay = <270>;
regulator-always-on;
};
mt6358_vcamio_reg: ldo_vcamio {
compatible = "regulator-fixed";
regulator-name = "vcamio";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vcamd_reg: ldo_vcamd {
regulator-name = "vcamd";
regulator-min-microvolt = <900000>;
regulator-max-microvolt = <1800000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vcn18_reg: ldo_vcn18 {
compatible = "regulator-fixed";
regulator-name = "vcn18";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vfe28_reg: ldo_vfe28 {
compatible = "regulator-fixed";
regulator-name = "vfe28";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vsram_proc11_reg: ldo_vsram_proc11 {
regulator-name = "vsram_proc11";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1293750>;
regulator-ramp-delay = <6250>;
regulator-enable-ramp-delay = <240>;
regulator-always-on;
};
mt6358_vcn28_reg: ldo_vcn28 {
compatible = "regulator-fixed";
regulator-name = "vcn28";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vsram_others_reg: ldo_vsram_others {
regulator-name = "vsram_others";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1293750>;
regulator-ramp-delay = <6250>;
regulator-enable-ramp-delay = <240>;
regulator-always-on;
};
mt6358_vsram_gpu_reg: ldo_vsram_gpu {
regulator-name = "vsram_gpu";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1293750>;
regulator-ramp-delay = <6250>;
regulator-enable-ramp-delay = <240>;
};
mt6358_vxo22_reg: ldo_vxo22 {
compatible = "regulator-fixed";
regulator-name = "vxo22";
regulator-min-microvolt = <2200000>;
regulator-max-microvolt = <2200000>;
regulator-enable-ramp-delay = <120>;
regulator-always-on;
};
mt6358_vefuse_reg: ldo_vefuse {
regulator-name = "vefuse";
regulator-min-microvolt = <1700000>;
regulator-max-microvolt = <1900000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vaux18_reg: ldo_vaux18 {
compatible = "regulator-fixed";
regulator-name = "vaux18";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vmch_reg: ldo_vmch {
regulator-name = "vmch";
regulator-min-microvolt = <2900000>;
regulator-max-microvolt = <3300000>;
regulator-enable-ramp-delay = <60>;
};
mt6358_vbif28_reg: ldo_vbif28 {
compatible = "regulator-fixed";
regulator-name = "vbif28";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vsram_proc12_reg: ldo_vsram_proc12 {
regulator-name = "vsram_proc12";
regulator-min-microvolt = <500000>;
regulator-max-microvolt = <1293750>;
regulator-ramp-delay = <6250>;
regulator-enable-ramp-delay = <240>;
regulator-always-on;
};
mt6358_vcama1_reg: ldo_vcama1 {
regulator-name = "vcama1";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3000000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vemc_reg: ldo_vemc {
regulator-name = "vemc";
regulator-min-microvolt = <2900000>;
regulator-max-microvolt = <3300000>;
regulator-enable-ramp-delay = <60>;
regulator-always-on;
};
mt6358_vio28_reg: ldo_vio28 {
compatible = "regulator-fixed";
regulator-name = "vio28";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_va12_reg: ldo_va12 {
compatible = "regulator-fixed";
regulator-name = "va12";
regulator-min-microvolt = <1200000>;
regulator-max-microvolt = <1200000>;
regulator-enable-ramp-delay = <270>;
regulator-always-on;
};
mt6358_vrf18_reg: ldo_vrf18 {
compatible = "regulator-fixed";
regulator-name = "vrf18";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-enable-ramp-delay = <120>;
};
mt6358_vcn33_bt_reg: ldo_vcn33_bt {
regulator-name = "vcn33_bt";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3500000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vcn33_wifi_reg: ldo_vcn33_wifi {
regulator-name = "vcn33_wifi";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3500000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vcama2_reg: ldo_vcama2 {
regulator-name = "vcama2";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3000000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vmc_reg: ldo_vmc {
regulator-name = "vmc";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <3300000>;
regulator-enable-ramp-delay = <60>;
};
mt6358_vldo28_reg: ldo_vldo28 {
regulator-name = "vldo28";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <3000000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vaud28_reg: ldo_vaud28 {
compatible = "regulator-fixed";
regulator-name = "vaud28";
regulator-min-microvolt = <2800000>;
regulator-max-microvolt = <2800000>;
regulator-enable-ramp-delay = <270>;
};
mt6358_vsim2_reg: ldo_vsim2 {
regulator-name = "vsim2";
regulator-min-microvolt = <1700000>;
regulator-max-microvolt = <3100000>;
regulator-enable-ramp-delay = <540>;
};
};
};
......@@ -22,9 +22,12 @@ RPMh resource.
The names used for regulator nodes must match those supported by a given PMIC.
Supported regulator node names:
PM8005: smps1 - smps4
PM8009: smps1 - smps2, ldo1 - ldo7
PM8150: smps1 - smps10, ldo1 - ldo18
PM8150L: smps1 - smps8, ldo1 - ldo11, bob, flash, rgb
PM8998: smps1 - smps13, ldo1 - ldo28, lvs1 - lvs2
PMI8998: bob
PM8005: smps1 - smps4
========================
First Level Nodes - PMIC
......@@ -33,9 +36,13 @@ First Level Nodes - PMIC
- compatible
Usage: required
Value type: <string>
Definition: Must be one of: "qcom,pm8998-rpmh-regulators",
"qcom,pmi8998-rpmh-regulators" or
"qcom,pm8005-rpmh-regulators".
Definition: Must be one of below:
"qcom,pm8005-rpmh-regulators"
"qcom,pm8009-rpmh-regulators"
"qcom,pm8150-rpmh-regulators"
"qcom,pm8150l-rpmh-regulators"
"qcom,pm8998-rpmh-regulators"
"qcom,pmi8998-rpmh-regulators"
- qcom,pmic-id
Usage: required
......
SY8824C/SY8824E/SY20276 Voltage regulator
Required properties:
- compatible: Must be one of the following.
"silergy,sy8824c"
"silergy,sy8824e"
"silergy,sy20276"
"silergy,sy20278"
- reg: I2C slave address
Any property defined as part of the core regulator binding, defined in
./regulator.txt, can also be used.
Example:
vcore: regulator@00 {
compatible = "silergy,sy8824c";
reg = <0x66>;
regulator-name = "vcore";
regulator-min-microvolt = <800000>;
regulator-max-microvolt = <1150000>;
regulator-boot-on;
regulator-always-on;
};
......@@ -71,3 +71,10 @@ Example:
regulator-min-microvolt = <1000000>;
regulator-max-microvolt = <3000000>;
};
For twl6030 regulators/LDOs:
- ti,retain-on-reset: Does not turn off the supplies during warm
reset. Could be needed for VMMC, as TWL6030
reset sequence for this signal does not comply
with the SD specification.
......@@ -13,6 +13,7 @@ this layer. These clocks and resets should be described in each property.
Required properties:
- compatible: Should be
"socionext,uniphier-pro4-usb3-regulator" - for Pro4 SoC
"socionext,uniphier-pro5-usb3-regulator" - for Pro5 SoC
"socionext,uniphier-pxs2-usb3-regulator" - for PXs2 SoC
"socionext,uniphier-ld20-usb3-regulator" - for LD20 SoC
"socionext,uniphier-pxs3-usb3-regulator" - for PXs3 SoC
......@@ -20,12 +21,12 @@ Required properties:
- clocks: A list of phandles to the clock gate for USB3 glue layer.
According to the clock-names, appropriate clocks are required.
- clock-names: Should contain
"gio", "link" - for Pro4 SoC
"gio", "link" - for Pro4 and Pro5 SoCs
"link" - for others
- resets: A list of phandles to the reset control for USB3 glue layer.
According to the reset-names, appropriate resets are required.
- reset-names: Should contain
"gio", "link" - for Pro4 SoC
"gio", "link" - for Pro4 and Pro5 SoCs
"link" - for others
See Documentation/devicetree/bindings/regulator/regulator.txt
......
......@@ -17261,6 +17261,7 @@ F: Documentation/power/regulator/
F: drivers/regulator/
F: include/dt-bindings/regulator/
F: include/linux/regulator/
K: regulator_get_optional
VRF
M: David Ahern <dsa@cumulusnetworks.com>
......
......@@ -83,6 +83,7 @@ config REGULATOR_88PM8607
config REGULATOR_ACT8865
tristate "Active-semi act8865 voltage regulator"
depends on I2C
depends on POWER_SUPPLY
select REGMAP_I2C
help
This driver controls a active-semi act8865 voltage output
......@@ -618,6 +619,15 @@ config REGULATOR_MT6323
This driver supports the control of different power rails of device
through regulator interface.
config REGULATOR_MT6358
tristate "MediaTek MT6358 PMIC"
depends on MFD_MT6397 && BROKEN
help
Say y here to select this option to enable the power regulator of
MediaTek MT6358 PMIC.
This driver supports the control of different power rails of device
through regulator interface.
config REGULATOR_MT6380
tristate "MediaTek MT6380 PMIC"
depends on MTK_PMIC_WRAP
......@@ -906,6 +916,13 @@ config REGULATOR_SY8106A
help
This driver supports SY8106A single output regulator.
config REGULATOR_SY8824X
tristate "Silergy SY8824C/SY8824E regulator"
depends on I2C && (OF || COMPILE_TEST)
select REGMAP_I2C
help
This driver supports SY8824C single output regulator.
config REGULATOR_TPS51632
tristate "TI TPS51632 Power Regulator"
depends on I2C
......
......@@ -79,6 +79,7 @@ obj-$(CONFIG_REGULATOR_MC13XXX_CORE) += mc13xxx-regulator-core.o
obj-$(CONFIG_REGULATOR_MCP16502) += mcp16502.o
obj-$(CONFIG_REGULATOR_MT6311) += mt6311-regulator.o
obj-$(CONFIG_REGULATOR_MT6323) += mt6323-regulator.o
obj-$(CONFIG_REGULATOR_MT6358) += mt6358-regulator.o
obj-$(CONFIG_REGULATOR_MT6380) += mt6380-regulator.o
obj-$(CONFIG_REGULATOR_MT6397) += mt6397-regulator.o
obj-$(CONFIG_REGULATOR_QCOM_RPM) += qcom_rpm-regulator.o
......@@ -111,6 +112,7 @@ obj-$(CONFIG_REGULATOR_STM32_PWR) += stm32-pwr.o
obj-$(CONFIG_REGULATOR_STPMIC1) += stpmic1_regulator.o
obj-$(CONFIG_REGULATOR_STW481X_VMMC) += stw481x-vmmc.o
obj-$(CONFIG_REGULATOR_SY8106A) += sy8106a-regulator.o
obj-$(CONFIG_REGULATOR_SY8824X) += sy8824x.o
obj-$(CONFIG_REGULATOR_TI_ABB) += ti-abb-regulator.o
obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o
obj-$(CONFIG_REGULATOR_TPS62360) += tps62360-regulator.o
......
......@@ -16,8 +16,10 @@
#include <linux/regulator/act8865.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/power_supply.h>
#include <linux/regulator/of_regulator.h>
#include <linux/regmap.h>
#include <dt-bindings/regulator/active-semi,8865-regulator.h>
/*
* ACT8600 Global Register Map.
......@@ -89,35 +91,50 @@
*/
#define ACT8865_SYS_MODE 0x00
#define ACT8865_SYS_CTRL 0x01
#define ACT8865_SYS_UNLK_REGS 0x0b