Skip to content

Commit 00ee929

Browse files
committed
Merge tag 'regulator-v4.14' into regulator-next
regulator: Updates for v4.14 This is an extremely quiet release for the regulator subsystem, it's all fairly minor fixes and cleanups plus a few new drivers and ddevice ID additions: - Support for MediaTek MT6380, Ricoh RC5T619 and ST Voltage Reference Buffers. # gpg: Signature made Mon 04 Sep 2017 17:51:28 BST # gpg: using RSA key ADE668AA675718B59FE29FEA24D68B725D5487D0 # gpg: issuer "[email protected]" # gpg: Good signature from "Mark Brown <[email protected]>" [unknown] # gpg: aka "Mark Brown <[email protected]>" [unknown] # gpg: aka "Mark Brown <[email protected]>" [unknown] # gpg: aka "Mark Brown <[email protected]>" [unknown] # gpg: aka "Mark Brown <[email protected]>" [unknown] # gpg: aka "Mark Brown <[email protected]>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 3F25 68AA C269 98F9 E813 A1C5 C3F4 36CA 30F5 D8EB # Subkey fingerprint: ADE6 68AA 6757 18B5 9FE2 9FEA 24D6 8B72 5D54 87D0
2 parents ddc239a + f039685 commit 00ee929

26 files changed

+813
-39
lines changed

Documentation/devicetree/bindings/regulator/mt6311-regulator.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Mediatek MT6311 Regulator Driver
1+
Mediatek MT6311 Regulator
22

33
Required properties:
44
- compatible: "mediatek,mt6311-regulator"

Documentation/devicetree/bindings/regulator/mt6323-regulator.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Mediatek MT6323 Regulator Driver
1+
Mediatek MT6323 Regulator
22

33
All voltage regulators are defined as subnodes of the regulators node. A list
44
of regulators provided by this controller are defined as subnodes of the
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
MediaTek MT6380 Regulator
2+
3+
All voltage regulators provided by the MT6380 PMIC are described as the
4+
subnodes of the MT6380 regulators node. Each regulator is named according
5+
to its regulator type, buck-<name> and ldo-<name>. The definition for each
6+
of these nodes is defined using the standard binding for regulators at
7+
Documentation/devicetree/bindings/regulator/regulator.txt.
8+
9+
The valid names for regulators are:
10+
BUCK:
11+
buck-core1, buck-vcore, buck-vrf
12+
LDO:
13+
ldo-vm ,ldo-va , ldo-vphy, ldo-vddr, ldo-vt
14+
15+
Example:
16+
17+
regulators {
18+
compatible = "mediatek,mt6380-regulator";
19+
20+
mt6380_vcpu_reg: buck-vcore1 {
21+
regulator-name = "vcore1";
22+
regulator-min-microvolt = < 600000>;
23+
regulator-max-microvolt = <1393750>;
24+
regulator-ramp-delay = <6250>;
25+
regulator-always-on;
26+
regulator-boot-on;
27+
};
28+
29+
mt6380_vcore_reg: buck-vcore {
30+
regulator-name = "vcore";
31+
regulator-min-microvolt = <600000>;
32+
regulator-max-microvolt = <1393750>;
33+
regulator-ramp-delay = <6250>;
34+
};
35+
36+
mt6380_vrf_reg: buck-vrf {
37+
regulator-name = "vrf";
38+
regulator-min-microvolt = <1200000>;
39+
regulator-max-microvolt = <1575000>;
40+
regulator-ramp-delay = <0>;
41+
regulator-always-on;
42+
regulator-boot-on;
43+
};
44+
45+
mt6380_vm_reg: ldo-vm {
46+
regulator-name = "vm";
47+
regulator-min-microvolt = <1050000>;
48+
regulator-max-microvolt = <1400000>;
49+
regulator-ramp-delay = <0>;
50+
regulator-always-on;
51+
regulator-boot-on;
52+
};
53+
54+
mt6380_va_reg: ldo-va {
55+
regulator-name = "va";
56+
regulator-min-microvolt = <2200000>;
57+
regulator-max-microvolt = <3300000>;
58+
regulator-ramp-delay = <0>;
59+
regulator-always-on;
60+
regulator-boot-on;
61+
};
62+
63+
mt6380_vphy_reg: ldo-vphy {
64+
regulator-name = "vphy";
65+
regulator-min-microvolt = <1800000>;
66+
regulator-max-microvolt = <1800000>;
67+
regulator-ramp-delay = <0>;
68+
regulator-always-on;
69+
regulator-boot-on;
70+
};
71+
72+
mt6380_vddr_reg: ldo-vddr {
73+
regulator-name = "vddr";
74+
regulator-min-microvolt = <1240000>;
75+
regulator-max-microvolt = <1840000>;
76+
regulator-ramp-delay = <0>;
77+
regulator-always-on;
78+
regulator-boot-on;
79+
};
80+
81+
mt6380_vt_reg: ldo-vt {
82+
regulator-name = "vt";
83+
regulator-min-microvolt = <2200000>;
84+
regulator-max-microvolt = <3300000>;
85+
regulator-ramp-delay = <0>;
86+
regulator-always-on;
87+
regulator-boot-on;
88+
};
89+
};

Documentation/devicetree/bindings/regulator/mt6397-regulator.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Mediatek MT6397 Regulator Driver
1+
Mediatek MT6397 Regulator
22

33
Required properties:
44
- compatible: "mediatek,mt6397-regulator"

Documentation/devicetree/bindings/regulator/pwm-regulator.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Continuous Voltage With Enable GPIO Example:
7171
* Inverted PWM logic, and the duty cycle range is limited
7272
* to 30%-70%.
7373
*/
74-
pwm-dutycycle-range <700 300>; /* */
74+
pwm-dutycycle-range = <700 300>; /* */
7575
};
7676

7777
Voltage Table Example:
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
STM32 VREFBUF - Voltage reference buffer
2+
3+
Some STM32 devices embed a voltage reference buffer which can be used as
4+
voltage reference for ADCs, DACs and also as voltage reference for external
5+
components through the dedicated VREF+ pin.
6+
7+
Required properties:
8+
- compatible: Must be "st,stm32-vrefbuf".
9+
- reg: Offset and length of VREFBUF register set.
10+
- clocks: Must contain an entry for peripheral clock.
11+
12+
Example:
13+
vrefbuf: regulator@58003C00 {
14+
compatible = "st,stm32-vrefbuf";
15+
reg = <0x58003C00 0x8>;
16+
clocks = <&rcc VREF_CK>;
17+
regulator-min-microvolt = <1500000>;
18+
regulator-max-microvolt = <2500000>;
19+
vdda-supply = <&vdda>;
20+
};

drivers/regulator/Kconfig

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,15 @@ config REGULATOR_MT6323
559559
This driver supports the control of different power rails of device
560560
through regulator interface.
561561

562+
config REGULATOR_MT6380
563+
tristate "MediaTek MT6380 PMIC"
564+
depends on MTK_PMIC_WRAP
565+
help
566+
Say y here to select this option to enable the power regulator of
567+
MediaTek MT6380 PMIC.
568+
This driver supports the control of different power rails of device
569+
through regulator interface.
570+
562571
config REGULATOR_MT6397
563572
tristate "MediaTek MT6397 PMIC"
564573
depends on MFD_MT6397
@@ -700,8 +709,8 @@ config REGULATOR_RN5T618
700709
tristate "Ricoh RN5T567/618 voltage regulators"
701710
depends on MFD_RN5T618
702711
help
703-
Say y here to support the regulators found on Ricoh RN5T567 or
704-
RN5T618 PMIC.
712+
Say y here to support the regulators found on Ricoh RN5T567,
713+
RN5T618 or RC5T619 PMIC.
705714

706715
config REGULATOR_RT5033
707716
tristate "Richtek RT5033 Regulators"
@@ -746,6 +755,18 @@ config REGULATOR_SKY81452
746755
This driver can also be built as a module. If so, the module
747756
will be called sky81452-regulator.
748757

758+
config REGULATOR_STM32_VREFBUF
759+
tristate "STMicroelectronics STM32 VREFBUF"
760+
depends on ARCH_STM32 || COMPILE_TEST
761+
help
762+
This driver supports STMicroelectronics STM32 VREFBUF (voltage
763+
reference buffer) which can be used as voltage reference for
764+
internal ADCs, DACs and also for external components through
765+
dedicated Vref+ pin.
766+
767+
This driver can also be built as a module. If so, the module
768+
will be called stm32-vrefbuf.
769+
749770
config REGULATOR_TI_ABB
750771
tristate "TI Adaptive Body Bias on-chip LDO"
751772
depends on ARCH_OMAP

drivers/regulator/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ obj-$(CONFIG_REGULATOR_MC13892) += mc13892-regulator.o
7272
obj-$(CONFIG_REGULATOR_MC13XXX_CORE) += mc13xxx-regulator-core.o
7373
obj-$(CONFIG_REGULATOR_MT6311) += mt6311-regulator.o
7474
obj-$(CONFIG_REGULATOR_MT6323) += mt6323-regulator.o
75+
obj-$(CONFIG_REGULATOR_MT6380) += mt6380-regulator.o
7576
obj-$(CONFIG_REGULATOR_MT6397) += mt6397-regulator.o
7677
obj-$(CONFIG_REGULATOR_QCOM_RPM) += qcom_rpm-regulator.o
7778
obj-$(CONFIG_REGULATOR_QCOM_SMD_RPM) += qcom_smd-regulator.o
@@ -94,6 +95,7 @@ obj-$(CONFIG_REGULATOR_S2MPA01) += s2mpa01.o
9495
obj-$(CONFIG_REGULATOR_S2MPS11) += s2mps11.o
9596
obj-$(CONFIG_REGULATOR_S5M8767) += s5m8767.o
9697
obj-$(CONFIG_REGULATOR_SKY81452) += sky81452-regulator.o
98+
obj-$(CONFIG_REGULATOR_STM32_VREFBUF) += stm32-vrefbuf.o
9799
obj-$(CONFIG_REGULATOR_STW481X_VMMC) += stw481x-vmmc.o
98100
obj-$(CONFIG_REGULATOR_TI_ABB) += ti-abb-regulator.o
99101
obj-$(CONFIG_REGULATOR_TPS6105X) += tps6105x-regulator.o

drivers/regulator/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ static struct device_node *of_get_regulator(struct device *dev, const char *supp
204204
regnode = of_parse_phandle(dev->of_node, prop_name, 0);
205205

206206
if (!regnode) {
207-
dev_dbg(dev, "Looking up %s property in node %s failed\n",
208-
prop_name, dev->of_node->full_name);
207+
dev_dbg(dev, "Looking up %s property in node %pOF failed\n",
208+
prop_name, dev->of_node);
209209
return NULL;
210210
}
211211
return regnode;

drivers/regulator/cpcap-regulator.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ struct cpcap_regulator {
123123
.enable_val = (mode_val), \
124124
.disable_val = (off_val), \
125125
.ramp_delay = (volt_trans_time), \
126+
.of_map_mode = cpcap_map_mode, \
126127
}, \
127128
.assign_reg = (assignment_reg), \
128129
.assign_mask = (assignment_mask), \
@@ -213,6 +214,18 @@ static int cpcap_regulator_disable(struct regulator_dev *rdev)
213214
return error;
214215
}
215216

217+
static unsigned int cpcap_map_mode(unsigned int mode)
218+
{
219+
switch (mode) {
220+
case CPCAP_BIT_AUDIO_NORMAL_MODE:
221+
return REGULATOR_MODE_NORMAL;
222+
case CPCAP_BIT_AUDIO_LOW_PWR:
223+
return REGULATOR_MODE_STANDBY;
224+
default:
225+
return -EINVAL;
226+
}
227+
}
228+
216229
static unsigned int cpcap_regulator_get_mode(struct regulator_dev *rdev)
217230
{
218231
int value;

drivers/regulator/da9063-regulator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ static int da9063_regulator_probe(struct platform_device *pdev)
736736
if (IS_ERR(regl_pdata) || regl_pdata->n_regulators == 0) {
737737
dev_err(&pdev->dev,
738738
"No regulators defined for the platform\n");
739-
return PTR_ERR(regl_pdata);
739+
return -ENODEV;
740740
}
741741

742742
/* Find regulators set for particular device model */

drivers/regulator/fan53555.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,8 @@ static int fan53555_regulator_probe(struct i2c_client *client,
407407

408408
di->regulator = pdata->regulator;
409409
if (client->dev.of_node) {
410-
const struct of_device_id *match;
411-
412-
match = of_match_device(of_match_ptr(fan53555_dt_ids),
413-
&client->dev);
414-
if (!match)
415-
return -ENODEV;
416-
417-
di->vendor = (unsigned long) match->data;
410+
di->vendor =
411+
(unsigned long)of_device_get_match_data(&client->dev);
418412
} else {
419413
/* if no ramp constraint set, get the pdata ramp_delay */
420414
if (!di->regulator->constraints.ramp_delay) {
@@ -476,7 +470,10 @@ static const struct i2c_device_id fan53555_id[] = {
476470
.name = "fan53555",
477471
.driver_data = FAN53555_VENDOR_FAIRCHILD
478472
}, {
479-
.name = "syr82x",
473+
.name = "syr827",
474+
.driver_data = FAN53555_VENDOR_SILERGY
475+
}, {
476+
.name = "syr828",
480477
.driver_data = FAN53555_VENDOR_SILERGY
481478
},
482479
{ },

drivers/regulator/ltc3589.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ static int ltc3589_probe(struct i2c_client *client,
539539
return 0;
540540
}
541541

542-
static struct i2c_device_id ltc3589_i2c_id[] = {
542+
static const struct i2c_device_id ltc3589_i2c_id[] = {
543543
{ "ltc3589", LTC3589 },
544544
{ "ltc3589-1", LTC3589_1 },
545545
{ "ltc3589-2", LTC3589_2 },

drivers/regulator/max1586.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static int of_get_max1586_platform_data(struct device *dev,
169169

170170
if (of_property_read_u32(np, "v3-gain",
171171
&pdata->v3_gain) < 0) {
172-
dev_err(dev, "%s has no 'v3-gain' property\n", np->full_name);
172+
dev_err(dev, "%pOF has no 'v3-gain' property\n", np);
173173
return -EINVAL;
174174
}
175175

0 commit comments

Comments
 (0)