Skip to content

Commit a21da94

Browse files
committed
Merge branch 'regulator-5.5' into regulator-next
2 parents c642e87 + c15d5a6 commit a21da94

40 files changed

+566
-226
lines changed

Documentation/devicetree/bindings/mfd/da9062.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ Sub-nodes:
6666
details of individual regulator device can be found in:
6767
Documentation/devicetree/bindings/regulator/regulator.txt
6868

69+
regulator-initial-mode may be specified for buck regulators using mode values
70+
from include/dt-bindings/regulator/dlg,da9063-regulator.h.
71+
6972
- rtc : This node defines settings required for the Real-Time Clock associated
7073
with the DA9062. There are currently no entries in this binding, however
7174
compatible = "dlg,da9062-rtc" should be added if a node is created.
@@ -96,6 +99,7 @@ Example:
9699
regulator-max-microvolt = <1570000>;
97100
regulator-min-microamp = <500000>;
98101
regulator-max-microamp = <2000000>;
102+
regulator-initial-mode = <DA9063_BUCK_MODE_SYNC>;
99103
regulator-boot-on;
100104
};
101105
DA9062_LDO1: ldo1 {

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ properties:
5050
description: startup time in microseconds
5151
$ref: /schemas/types.yaml#/definitions/uint32
5252

53+
off-on-delay-us:
54+
description: off delay time in microseconds
55+
$ref: /schemas/types.yaml#/definitions/uint32
56+
5357
enable-active-high:
5458
description:
5559
Polarity of GPIO is Active high. If this property is missing,

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Supported regulator node names:
2828
PM8150L: smps1 - smps8, ldo1 - ldo11, bob, flash, rgb
2929
PM8998: smps1 - smps13, ldo1 - ldo28, lvs1 - lvs2
3030
PMI8998: bob
31+
PM6150: smps1 - smps5, ldo1 - ldo19
32+
PM6150L: smps1 - smps8, ldo1 - ldo11, bob
3133

3234
========================
3335
First Level Nodes - PMIC
@@ -43,6 +45,8 @@ First Level Nodes - PMIC
4345
"qcom,pm8150l-rpmh-regulators"
4446
"qcom,pm8998-rpmh-regulators"
4547
"qcom,pmi8998-rpmh-regulators"
48+
"qcom,pm6150-rpmh-regulators"
49+
"qcom,pm6150l-rpmh-regulators"
4650

4751
- qcom,pmic-id
4852
Usage: required

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Regulator nodes are identified by their compatible:
2222
"qcom,rpm-pm8841-regulators"
2323
"qcom,rpm-pm8916-regulators"
2424
"qcom,rpm-pm8941-regulators"
25+
"qcom,rpm-pm8950-regulators"
2526
"qcom,rpm-pm8994-regulators"
2627
"qcom,rpm-pm8998-regulators"
2728
"qcom,rpm-pma8084-regulators"
@@ -54,6 +55,26 @@ Regulator nodes are identified by their compatible:
5455
Definition: reference to regulator supplying the input pin, as
5556
described in the data sheet
5657

58+
- vdd_s1-supply:
59+
- vdd_s2-supply:
60+
- vdd_s3-supply:
61+
- vdd_s4-supply:
62+
- vdd_s4-supply:
63+
- vdd_s5-supply:
64+
- vdd_s6-supply:
65+
- vdd_l1_l19-supply:
66+
- vdd_l2_l23-supply:
67+
- vdd_l3-supply:
68+
- vdd_l4_l5_l6_l7_l16-supply:
69+
- vdd_l8_l11_l12_l17_l22-supply:
70+
- vdd_l9_l10_l13_l14_l15_l18-supply:
71+
- vdd_l20-supply:
72+
- vdd_l21-supply:
73+
Usage: optional (pm8950 only)
74+
Value type: <phandle>
75+
Definition: reference to regulator supplying the input pin, as
76+
described in the data sheet
77+
5778
- vdd_s1-supply:
5879
- vdd_s2-supply:
5980
- vdd_s3-supply:

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ Qualcomm SPMI Regulators
44
Usage: required
55
Value type: <string>
66
Definition: must be one of:
7+
"qcom,pm8004-regulators"
78
"qcom,pm8005-regulators"
89
"qcom,pm8841-regulators"
910
"qcom,pm8916-regulators"
1011
"qcom,pm8941-regulators"
12+
"qcom,pm8950-regulators"
1113
"qcom,pm8994-regulators"
1214
"qcom,pmi8994-regulators"
1315
"qcom,pms405-regulators"
@@ -72,6 +74,26 @@ Qualcomm SPMI Regulators
7274
Definition: Reference to regulator supplying the input pin, as
7375
described in the data sheet.
7476

77+
- vdd_s1-supply:
78+
- vdd_s2-supply:
79+
- vdd_s3-supply:
80+
- vdd_s4-supply:
81+
- vdd_s4-supply:
82+
- vdd_s5-supply:
83+
- vdd_s6-supply:
84+
- vdd_l1_l19-supply:
85+
- vdd_l2_l23-supply:
86+
- vdd_l3-supply:
87+
- vdd_l4_l5_l6_l7_l16-supply:
88+
- vdd_l8_l11_l12_l17_l22-supply:
89+
- vdd_l9_l10_l13_l14_l15_l18-supply:
90+
- vdd_l20-supply:
91+
- vdd_l21-supply:
92+
Usage: optional (pm8950 only)
93+
Value type: <phandle>
94+
Definition: reference to regulator supplying the input pin, as
95+
described in the data sheet
96+
7597
- vdd_s1-supply:
7698
- vdd_s2-supply:
7799
- vdd_s3-supply:
@@ -139,6 +161,9 @@ The regulator node houses sub-nodes for each regulator within the device. Each
139161
sub-node is identified using the node's name, with valid values listed for each
140162
of the PMICs below.
141163

164+
pm8005:
165+
s2, s5
166+
142167
pm8005:
143168
s1, s2, s3, s4
144169

Documentation/devicetree/bindings/regulator/regulator.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ properties:
3838
type: boolean
3939

4040
regulator-boot-on:
41-
description: bootloader/firmware enabled regulator
41+
description: bootloader/firmware enabled regulator.
42+
It's expected that this regulator was left on by the bootloader.
43+
If the bootloader didn't leave it on then OS should turn it on
44+
at boot but shouldn't prevent it from being turned off later.
45+
This property is intended to only be used for regulators where
46+
software cannot read the state of the regulator.
4247
type: boolean
4348

4449
regulator-allow-bypass:

drivers/gpio/gpiolib-devres.c

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -185,12 +185,11 @@ struct gpio_desc *devm_gpiod_get_from_of_node(struct device *dev,
185185
EXPORT_SYMBOL_GPL(devm_gpiod_get_from_of_node);
186186

187187
/**
188-
* devm_fwnode_get_index_gpiod_from_child - get a GPIO descriptor from a
189-
* device's child node
188+
* devm_fwnode_gpiod_get_index - get a GPIO descriptor from a given node
190189
* @dev: GPIO consumer
190+
* @fwnode: firmware node containing GPIO reference
191191
* @con_id: function within the GPIO consumer
192192
* @index: index of the GPIO to obtain in the consumer
193-
* @child: firmware node (child of @dev)
194193
* @flags: GPIO initialization flags
195194
* @label: label to attach to the requested GPIO
196195
*
@@ -200,35 +199,21 @@ EXPORT_SYMBOL_GPL(devm_gpiod_get_from_of_node);
200199
* On successful request the GPIO pin is configured in accordance with
201200
* provided @flags.
202201
*/
203-
struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev,
204-
const char *con_id, int index,
205-
struct fwnode_handle *child,
206-
enum gpiod_flags flags,
207-
const char *label)
202+
struct gpio_desc *devm_fwnode_gpiod_get_index(struct device *dev,
203+
struct fwnode_handle *fwnode,
204+
const char *con_id, int index,
205+
enum gpiod_flags flags,
206+
const char *label)
208207
{
209-
char prop_name[32]; /* 32 is max size of property name */
210208
struct gpio_desc **dr;
211209
struct gpio_desc *desc;
212-
unsigned int i;
213210

214211
dr = devres_alloc(devm_gpiod_release, sizeof(struct gpio_desc *),
215212
GFP_KERNEL);
216213
if (!dr)
217214
return ERR_PTR(-ENOMEM);
218215

219-
for (i = 0; i < ARRAY_SIZE(gpio_suffixes); i++) {
220-
if (con_id)
221-
snprintf(prop_name, sizeof(prop_name), "%s-%s",
222-
con_id, gpio_suffixes[i]);
223-
else
224-
snprintf(prop_name, sizeof(prop_name), "%s",
225-
gpio_suffixes[i]);
226-
227-
desc = fwnode_get_named_gpiod(child, prop_name, index, flags,
228-
label);
229-
if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT))
230-
break;
231-
}
216+
desc = fwnode_gpiod_get_index(fwnode, con_id, index, flags, label);
232217
if (IS_ERR(desc)) {
233218
devres_free(dr);
234219
return desc;
@@ -239,7 +224,7 @@ struct gpio_desc *devm_fwnode_get_index_gpiod_from_child(struct device *dev,
239224

240225
return desc;
241226
}
242-
EXPORT_SYMBOL_GPL(devm_fwnode_get_index_gpiod_from_child);
227+
EXPORT_SYMBOL_GPL(devm_fwnode_gpiod_get_index);
243228

244229
/**
245230
* devm_gpiod_get_index_optional - Resource-managed gpiod_get_index_optional()

drivers/gpio/gpiolib.c

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4355,6 +4355,54 @@ static int platform_gpio_count(struct device *dev, const char *con_id)
43554355
return count;
43564356
}
43574357

4358+
/**
4359+
* fwnode_gpiod_get_index - obtain a GPIO from firmware node
4360+
* @fwnode: handle of the firmware node
4361+
* @con_id: function within the GPIO consumer
4362+
* @index: index of the GPIO to obtain for the consumer
4363+
* @flags: GPIO initialization flags
4364+
* @label: label to attach to the requested GPIO
4365+
*
4366+
* This function can be used for drivers that get their configuration
4367+
* from opaque firmware.
4368+
*
4369+
* The function properly finds the corresponding GPIO using whatever is the
4370+
* underlying firmware interface and then makes sure that the GPIO
4371+
* descriptor is requested before it is returned to the caller.
4372+
*
4373+
* Returns:
4374+
* On successful request the GPIO pin is configured in accordance with
4375+
* provided @flags.
4376+
*
4377+
* In case of error an ERR_PTR() is returned.
4378+
*/
4379+
struct gpio_desc *fwnode_gpiod_get_index(struct fwnode_handle *fwnode,
4380+
const char *con_id, int index,
4381+
enum gpiod_flags flags,
4382+
const char *label)
4383+
{
4384+
struct gpio_desc *desc;
4385+
char prop_name[32]; /* 32 is max size of property name */
4386+
unsigned int i;
4387+
4388+
for (i = 0; i < ARRAY_SIZE(gpio_suffixes); i++) {
4389+
if (con_id)
4390+
snprintf(prop_name, sizeof(prop_name), "%s-%s",
4391+
con_id, gpio_suffixes[i]);
4392+
else
4393+
snprintf(prop_name, sizeof(prop_name), "%s",
4394+
gpio_suffixes[i]);
4395+
4396+
desc = fwnode_get_named_gpiod(fwnode, prop_name, index, flags,
4397+
label);
4398+
if (!IS_ERR(desc) || (PTR_ERR(desc) != -ENOENT))
4399+
break;
4400+
}
4401+
4402+
return desc;
4403+
}
4404+
EXPORT_SYMBOL_GPL(fwnode_gpiod_get_index);
4405+
43584406
/**
43594407
* gpiod_count - return the number of GPIOs associated with a device / function
43604408
* or -ENOENT if no GPIO has been assigned to the requested function

drivers/mfd/tps6105x.c

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,32 @@ static int tps6105x_add_device(struct tps6105x *tps6105x,
9191
PLATFORM_DEVID_AUTO, cell, 1, NULL, 0, NULL);
9292
}
9393

94+
static struct tps6105x_platform_data *tps6105x_parse_dt(struct device *dev)
95+
{
96+
struct device_node *np = dev->of_node;
97+
struct tps6105x_platform_data *pdata;
98+
struct device_node *child;
99+
100+
if (!np)
101+
return ERR_PTR(-EINVAL);
102+
if (of_get_available_child_count(np) > 1) {
103+
dev_err(dev, "cannot support multiple operational modes");
104+
return ERR_PTR(-EINVAL);
105+
}
106+
pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
107+
if (!pdata)
108+
return ERR_PTR(-ENOMEM);
109+
pdata->mode = TPS6105X_MODE_SHUTDOWN;
110+
for_each_available_child_of_node(np, child) {
111+
if (child->name && !of_node_cmp(child->name, "regulator"))
112+
pdata->mode = TPS6105X_MODE_VOLTAGE;
113+
else if (child->name && !of_node_cmp(child->name, "led"))
114+
pdata->mode = TPS6105X_MODE_TORCH;
115+
}
116+
117+
return pdata;
118+
}
119+
94120
static int tps6105x_probe(struct i2c_client *client,
95121
const struct i2c_device_id *id)
96122
{
@@ -99,9 +125,11 @@ static int tps6105x_probe(struct i2c_client *client,
99125
int ret;
100126

101127
pdata = dev_get_platdata(&client->dev);
102-
if (!pdata) {
103-
dev_err(&client->dev, "missing platform data\n");
104-
return -ENODEV;
128+
if (!pdata)
129+
pdata = tps6105x_parse_dt(&client->dev);
130+
if (IS_ERR(pdata)) {
131+
dev_err(&client->dev, "No platform data or DT found");
132+
return PTR_ERR(pdata);
105133
}
106134

107135
tps6105x = devm_kmalloc(&client->dev, sizeof(*tps6105x), GFP_KERNEL);

drivers/regulator/Kconfig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -841,10 +841,10 @@ config REGULATOR_SKY81452
841841
will be called sky81452-regulator.
842842

843843
config REGULATOR_SLG51000
844-
tristate "Dialog Semiconductor SLG51000 regulators"
845-
depends on I2C
846-
select REGMAP_I2C
847-
help
844+
tristate "Dialog Semiconductor SLG51000 regulators"
845+
depends on I2C
846+
select REGMAP_I2C
847+
help
848848
Say y here to support for the Dialog Semiconductor SLG51000.
849849
The SLG51000 is seven compact and customizable low dropout
850850
regulators.

0 commit comments

Comments
 (0)