Skip to content

Commit 85cc575

Browse files
committed
Merge tag 'regulator-fix-v6.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fixes from Mark Brown: "The main change here is a revert for a cleanup that was done in the core, attempting to resolve some confusion about how we handle systems where we've somehow managed to end up with both platform data and device tree data for the same device. Unfortunately it turns out there are actually a few systems that deliberately do this and were broken by the change so we've just reverted it. There's also a new Qualcomm device ID" * tag 'regulator-fix-v6.14-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: core: let dt properties override driver init_data regulator: qcom_smd: Add l2, l5 sub-node to mp5496 regulator
2 parents f9af8e7 + 35e21de commit 85cc575

File tree

2 files changed

+28
-35
lines changed

2 files changed

+28
-35
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ description:
2222
Each sub-node is identified using the node's name, with valid values listed
2323
for each of the pmics below.
2424

25-
For mp5496, s1, s2
25+
For mp5496, s1, s2, l2, l5
2626

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

drivers/regulator/core.c

Lines changed: 27 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5774,43 +5774,36 @@ regulator_register(struct device *dev,
57745774
goto clean;
57755775
}
57765776

5777-
if (config->init_data) {
5778-
/*
5779-
* Providing of_match means the framework is expected to parse
5780-
* DT to get the init_data. This would conflict with provided
5781-
* init_data, if set. Warn if it happens.
5782-
*/
5783-
if (regulator_desc->of_match)
5784-
dev_warn(dev, "Using provided init data - OF match ignored\n");
5777+
/*
5778+
* DT may override the config->init_data provided if the platform
5779+
* needs to do so. If so, config->init_data is completely ignored.
5780+
*/
5781+
init_data = regulator_of_get_init_data(dev, regulator_desc, config,
5782+
&rdev->dev.of_node);
57855783

5784+
/*
5785+
* Sometimes not all resources are probed already so we need to take
5786+
* that into account. This happens most the time if the ena_gpiod comes
5787+
* from a gpio extender or something else.
5788+
*/
5789+
if (PTR_ERR(init_data) == -EPROBE_DEFER) {
5790+
ret = -EPROBE_DEFER;
5791+
goto clean;
5792+
}
5793+
5794+
/*
5795+
* We need to keep track of any GPIO descriptor coming from the
5796+
* device tree until we have handled it over to the core. If the
5797+
* config that was passed in to this function DOES NOT contain
5798+
* a descriptor, and the config after this call DOES contain
5799+
* a descriptor, we definitely got one from parsing the device
5800+
* tree.
5801+
*/
5802+
if (!cfg->ena_gpiod && config->ena_gpiod)
5803+
dangling_of_gpiod = true;
5804+
if (!init_data) {
57865805
init_data = config->init_data;
57875806
rdev->dev.of_node = of_node_get(config->of_node);
5788-
5789-
} else {
5790-
init_data = regulator_of_get_init_data(dev, regulator_desc,
5791-
config,
5792-
&rdev->dev.of_node);
5793-
5794-
/*
5795-
* Sometimes not all resources are probed already so we need to
5796-
* take that into account. This happens most the time if the
5797-
* ena_gpiod comes from a gpio extender or something else.
5798-
*/
5799-
if (PTR_ERR(init_data) == -EPROBE_DEFER) {
5800-
ret = -EPROBE_DEFER;
5801-
goto clean;
5802-
}
5803-
5804-
/*
5805-
* We need to keep track of any GPIO descriptor coming from the
5806-
* device tree until we have handled it over to the core. If the
5807-
* config that was passed in to this function DOES NOT contain a
5808-
* descriptor, and the config after this call DOES contain a
5809-
* descriptor, we definitely got one from parsing the device
5810-
* tree.
5811-
*/
5812-
if (!cfg->ena_gpiod && config->ena_gpiod)
5813-
dangling_of_gpiod = true;
58145807
}
58155808

58165809
ww_mutex_init(&rdev->mutex, &regulator_ww_class);

0 commit comments

Comments
 (0)