Skip to content

Commit 6dfae59

Browse files
committed
Merge remote-tracking branch 'regulator/for-next' into tmp
2 parents 1ba0b52 + 24bd2af commit 6dfae59

File tree

11 files changed

+435
-50
lines changed

11 files changed

+435
-50
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Monolithic Power Systems MP8867/MP8869 voltage regulator
2+
3+
Required properties:
4+
- compatible: Must be one of the following.
5+
"mps,mp8867"
6+
"mps,mp8869"
7+
- reg: I2C slave address.
8+
- enable-gpios: enable gpios.
9+
- mps,fb-voltage-divider: An array of two integers containing the resistor
10+
values R1 and R2 of the feedback voltage divider in kilo ohms.
11+
12+
Any property defined as part of the core regulator binding, defined in
13+
./regulator.txt, can also be used.
14+
15+
Example:
16+
17+
vcpu: regulator@62 {
18+
compatible = "mps,mp8869";
19+
regulator-name = "vcpu";
20+
regulator-min-microvolt = <700000>;
21+
regulator-max-microvolt = <850000>;
22+
regulator-always-on;
23+
regulator-boot-on;
24+
enable-gpios = <&porta 1 GPIO_ACTIVE_LOW>;
25+
mps,fb-voltage-divider = <80 240>;
26+
reg = <0x62>;
27+
};

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Regulator nodes are identified by their compatible:
2626
"qcom,rpm-pm8994-regulators"
2727
"qcom,rpm-pm8998-regulators"
2828
"qcom,rpm-pma8084-regulators"
29+
"qcom,rpm-pmi8994-regulators"
2930
"qcom,rpm-pmi8998-regulators"
3031
"qcom,rpm-pms405-regulators"
3132

@@ -143,6 +144,15 @@ Regulator nodes are identified by their compatible:
143144
Definition: reference to regulator supplying the input pin, as
144145
described in the data sheet
145146

147+
- vdd_s1-supply:
148+
- vdd_s2-supply:
149+
- vdd_s3-supply:
150+
- vdd_bst_byp-supply:
151+
Usage: optional (pmi8994 only)
152+
Value type: <phandle>
153+
Definition: reference to regulator supplying the input pin, as
154+
described in the data sheet
155+
146156
- vdd_s1-supply:
147157
- vdd_s2-supply:
148158
- vdd_s3-supply:
@@ -259,6 +269,9 @@ pma8084:
259269
l6, l7, l8, l9, l10, l11, l12, l13, l14, l15, l16, l17, l18, l19, l20,
260270
l21, l22, l23, l24, l25, l26, l27, lvs1, lvs2, lvs3, lvs4, 5vs1
261271

272+
pmi8994:
273+
s1, s2, s3, boost-bypass
274+
262275
pmi8998:
263276
bob
264277

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/regulator/vqmmc-ipq4019-regulator.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Qualcomm IPQ4019 VQMMC SD LDO regulator
8+
9+
maintainers:
10+
- Robert Marko <[email protected]>
11+
12+
description: |
13+
Qualcomm IPQ4019 SoC-s feature a built a build SD/EMMC controller,
14+
in order to support both 1.8 and 3V I/O voltage levels an LDO
15+
controller is also embedded.
16+
17+
allOf:
18+
- $ref: "regulator.yaml#"
19+
20+
properties:
21+
compatible:
22+
const: qcom,vqmmc-ipq4019-regulator
23+
24+
reg:
25+
maxItems: 1
26+
27+
required:
28+
- compatible
29+
- reg
30+
31+
examples:
32+
- |
33+
regulator@1948000 {
34+
compatible = "qcom,vqmmc-ipq4019-regulator";
35+
reg = <0x01948000 0x4>;
36+
regulator-name = "vqmmc";
37+
regulator-min-microvolt = <1500000>;
38+
regulator-max-microvolt = <3000000>;
39+
regulator-always-on;
40+
status = "disabled";
41+
};
42+
...

drivers/regulator/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,13 @@ config REGULATOR_MP8859
635635
Say M here if you want to include support for the regulator as a
636636
module. The module will be named "mp8859".
637637

638+
config REGULATOR_MP886X
639+
tristate "MPS MP8869 regulator driver"
640+
depends on I2C && (OF || COMPILE_TEST)
641+
select REGMAP_I2C
642+
help
643+
This driver supports the MP8869 voltage regulator.
644+
638645
config REGULATOR_MPQ7920
639646
tristate "Monolithic MPQ7920 PMIC"
640647
depends on I2C && OF

drivers/regulator/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ obj-$(CONFIG_REGULATOR_MC13XXX_CORE) += mc13xxx-regulator-core.o
8080
obj-$(CONFIG_REGULATOR_MCP16502) += mcp16502.o
8181
obj-$(CONFIG_REGULATOR_MP5416) += mp5416.o
8282
obj-$(CONFIG_REGULATOR_MP8859) += mp8859.o
83+
obj-$(CONFIG_REGULATOR_MP886X) += mp886x.o
8384
obj-$(CONFIG_REGULATOR_MPQ7920) += mpq7920.o
8485
obj-$(CONFIG_REGULATOR_MT6311) += mt6311-regulator.o
8586
obj-$(CONFIG_REGULATOR_MT6323) += mt6323-regulator.o

drivers/regulator/core.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1849,7 +1849,6 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
18491849
{
18501850
struct regulator_dev *rdev;
18511851
struct regulator *regulator;
1852-
const char *devname = dev ? dev_name(dev) : "deviceless";
18531852
struct device_link *link;
18541853
int ret;
18551854

@@ -1887,9 +1886,7 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
18871886
* enabled, even if it isn't hooked up, and just
18881887
* provide a dummy.
18891888
*/
1890-
dev_warn(dev,
1891-
"%s supply %s not found, using dummy regulator\n",
1892-
devname, id);
1889+
dev_warn(dev, "supply %s not found, using dummy regulator\n", id);
18931890
rdev = dummy_regulator_rdev;
18941891
get_device(&rdev->dev);
18951892
break;

drivers/regulator/da9063-regulator.c

Lines changed: 4 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ struct da9063_regulator_info {
100100
.desc.vsel_mask = DA9063_V##regl_name##_MASK, \
101101
.desc.linear_min_sel = DA9063_V##regl_name##_BIAS, \
102102
.sleep = BFIELD(DA9063_REG_V##regl_name##_A, DA9063_LDO_SL), \
103+
.suspend = BFIELD(DA9063_REG_##regl_name##_CONT, DA9063_LDO_CONF), \
103104
.suspend_sleep = BFIELD(DA9063_REG_V##regl_name##_B, DA9063_LDO_SL), \
104105
.suspend_vsel_reg = DA9063_REG_V##regl_name##_B
105106

@@ -124,6 +125,7 @@ struct da9063_regulator_info {
124125
.desc.vsel_mask = DA9063_VBUCK_MASK, \
125126
.desc.linear_min_sel = DA9063_VBUCK_BIAS, \
126127
.sleep = BFIELD(DA9063_REG_V##regl_name##_A, DA9063_BUCK_SL), \
128+
.suspend = BFIELD(DA9063_REG_##regl_name##_CONT, DA9063_BUCK_CONF), \
127129
.suspend_sleep = BFIELD(DA9063_REG_V##regl_name##_B, DA9063_BUCK_SL), \
128130
.suspend_vsel_reg = DA9063_REG_V##regl_name##_B, \
129131
.mode = BFIELD(DA9063_REG_##regl_name##_CFG, DA9063_BUCK_MODE_MASK)
@@ -232,7 +234,6 @@ static int da9063_buck_set_mode(struct regulator_dev *rdev, unsigned int mode)
232234
static unsigned int da9063_buck_get_mode(struct regulator_dev *rdev)
233235
{
234236
struct da9063_regulator *regl = rdev_get_drvdata(rdev);
235-
struct regmap_field *field;
236237
unsigned int val;
237238
int ret;
238239

@@ -253,18 +254,7 @@ static unsigned int da9063_buck_get_mode(struct regulator_dev *rdev)
253254
return REGULATOR_MODE_NORMAL;
254255
}
255256

256-
/* Detect current regulator state */
257-
ret = regmap_field_read(regl->suspend, &val);
258-
if (ret < 0)
259-
return 0;
260-
261-
/* Read regulator mode from proper register, depending on state */
262-
if (val)
263-
field = regl->suspend_sleep;
264-
else
265-
field = regl->sleep;
266-
267-
ret = regmap_field_read(field, &val);
257+
ret = regmap_field_read(regl->sleep, &val);
268258
if (ret < 0)
269259
return 0;
270260

@@ -301,21 +291,9 @@ static int da9063_ldo_set_mode(struct regulator_dev *rdev, unsigned int mode)
301291
static unsigned int da9063_ldo_get_mode(struct regulator_dev *rdev)
302292
{
303293
struct da9063_regulator *regl = rdev_get_drvdata(rdev);
304-
struct regmap_field *field;
305294
int ret, val;
306295

307-
/* Detect current regulator state */
308-
ret = regmap_field_read(regl->suspend, &val);
309-
if (ret < 0)
310-
return 0;
311-
312-
/* Read regulator mode from proper register, depending on state */
313-
if (val)
314-
field = regl->suspend_sleep;
315-
else
316-
field = regl->sleep;
317-
318-
ret = regmap_field_read(field, &val);
296+
ret = regmap_field_read(regl->sleep, &val);
319297
if (ret < 0)
320298
return 0;
321299

@@ -475,72 +453,61 @@ static const struct da9063_regulator_info da9063_regulator_info[] = {
475453
da9063_buck_a_limits,
476454
DA9063_REG_BUCK_ILIM_C, DA9063_BCORE1_ILIM_MASK),
477455
DA9063_BUCK_COMMON_FIELDS(BCORE1),
478-
.suspend = BFIELD(DA9063_REG_DVC_1, DA9063_VBCORE1_SEL),
479456
},
480457
{
481458
DA9063_BUCK(DA9063, BCORE2, 300, 10, 1570,
482459
da9063_buck_a_limits,
483460
DA9063_REG_BUCK_ILIM_C, DA9063_BCORE2_ILIM_MASK),
484461
DA9063_BUCK_COMMON_FIELDS(BCORE2),
485-
.suspend = BFIELD(DA9063_REG_DVC_1, DA9063_VBCORE2_SEL),
486462
},
487463
{
488464
DA9063_BUCK(DA9063, BPRO, 530, 10, 1800,
489465
da9063_buck_a_limits,
490466
DA9063_REG_BUCK_ILIM_B, DA9063_BPRO_ILIM_MASK),
491467
DA9063_BUCK_COMMON_FIELDS(BPRO),
492-
.suspend = BFIELD(DA9063_REG_DVC_1, DA9063_VBPRO_SEL),
493468
},
494469
{
495470
DA9063_BUCK(DA9063, BMEM, 800, 20, 3340,
496471
da9063_buck_b_limits,
497472
DA9063_REG_BUCK_ILIM_A, DA9063_BMEM_ILIM_MASK),
498473
DA9063_BUCK_COMMON_FIELDS(BMEM),
499-
.suspend = BFIELD(DA9063_REG_DVC_1, DA9063_VBMEM_SEL),
500474
},
501475
{
502476
DA9063_BUCK(DA9063, BIO, 800, 20, 3340,
503477
da9063_buck_b_limits,
504478
DA9063_REG_BUCK_ILIM_A, DA9063_BIO_ILIM_MASK),
505479
DA9063_BUCK_COMMON_FIELDS(BIO),
506-
.suspend = BFIELD(DA9063_REG_DVC_2, DA9063_VBIO_SEL),
507480
},
508481
{
509482
DA9063_BUCK(DA9063, BPERI, 800, 20, 3340,
510483
da9063_buck_b_limits,
511484
DA9063_REG_BUCK_ILIM_B, DA9063_BPERI_ILIM_MASK),
512485
DA9063_BUCK_COMMON_FIELDS(BPERI),
513-
.suspend = BFIELD(DA9063_REG_DVC_1, DA9063_VBPERI_SEL),
514486
},
515487
{
516488
DA9063_BUCK(DA9063, BCORES_MERGED, 300, 10, 1570,
517489
da9063_bcores_merged_limits,
518490
DA9063_REG_BUCK_ILIM_C, DA9063_BCORE1_ILIM_MASK),
519491
/* BCORES_MERGED uses the same register fields as BCORE1 */
520492
DA9063_BUCK_COMMON_FIELDS(BCORE1),
521-
.suspend = BFIELD(DA9063_REG_DVC_1, DA9063_VBCORE1_SEL),
522493
},
523494
{
524495
DA9063_BUCK(DA9063, BMEM_BIO_MERGED, 800, 20, 3340,
525496
da9063_bmem_bio_merged_limits,
526497
DA9063_REG_BUCK_ILIM_A, DA9063_BMEM_ILIM_MASK),
527498
/* BMEM_BIO_MERGED uses the same register fields as BMEM */
528499
DA9063_BUCK_COMMON_FIELDS(BMEM),
529-
.suspend = BFIELD(DA9063_REG_DVC_1, DA9063_VBMEM_SEL),
530500
},
531501
{
532502
DA9063_LDO(DA9063, LDO3, 900, 20, 3440),
533-
.suspend = BFIELD(DA9063_REG_DVC_1, DA9063_VLDO3_SEL),
534503
.oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO3_LIM),
535504
},
536505
{
537506
DA9063_LDO(DA9063, LDO7, 900, 50, 3600),
538-
.suspend = BFIELD(DA9063_REG_LDO7_CONT, DA9063_VLDO7_SEL),
539507
.oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO7_LIM),
540508
},
541509
{
542510
DA9063_LDO(DA9063, LDO8, 900, 50, 3600),
543-
.suspend = BFIELD(DA9063_REG_LDO8_CONT, DA9063_VLDO8_SEL),
544511
.oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO8_LIM),
545512
},
546513
{
@@ -549,36 +516,29 @@ static const struct da9063_regulator_info da9063_regulator_info[] = {
549516
},
550517
{
551518
DA9063_LDO(DA9063, LDO11, 900, 50, 3600),
552-
.suspend = BFIELD(DA9063_REG_LDO11_CONT, DA9063_VLDO11_SEL),
553519
.oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO11_LIM),
554520
},
555521

556522
/* The following LDOs are present only on DA9063, not on DA9063L */
557523
{
558524
DA9063_LDO(DA9063, LDO1, 600, 20, 1860),
559-
.suspend = BFIELD(DA9063_REG_DVC_1, DA9063_VLDO1_SEL),
560525
},
561526
{
562527
DA9063_LDO(DA9063, LDO2, 600, 20, 1860),
563-
.suspend = BFIELD(DA9063_REG_DVC_1, DA9063_VLDO2_SEL),
564528
},
565529
{
566530
DA9063_LDO(DA9063, LDO4, 900, 20, 3440),
567-
.suspend = BFIELD(DA9063_REG_DVC_2, DA9063_VLDO4_SEL),
568531
.oc_event = BFIELD(DA9063_REG_STATUS_D, DA9063_LDO4_LIM),
569532
},
570533
{
571534
DA9063_LDO(DA9063, LDO5, 900, 50, 3600),
572-
.suspend = BFIELD(DA9063_REG_LDO5_CONT, DA9063_VLDO5_SEL),
573535
},
574536
{
575537
DA9063_LDO(DA9063, LDO6, 900, 50, 3600),
576-
.suspend = BFIELD(DA9063_REG_LDO6_CONT, DA9063_VLDO6_SEL),
577538
},
578539

579540
{
580541
DA9063_LDO(DA9063, LDO10, 900, 50, 3600),
581-
.suspend = BFIELD(DA9063_REG_LDO10_CONT, DA9063_VLDO10_SEL),
582542
},
583543
};
584544

0 commit comments

Comments
 (0)