Commit c29ff107 authored by Bjorn Andersson's avatar Bjorn Andersson Committed by Marcel Holtmann

Bluetooth: hci_qca: Update regulator_set_load() usage

Since the introduction of '5451781d ("regulator: core: Only count
load for enabled consumers")' in v5.0, the requested load of a regulator
consumer is only accounted for when said consumer is voted enabled.

So there's no need to vote for load ever time the regulator is
enabled or disabled.
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent cde9dde6
...@@ -1395,13 +1395,6 @@ static int qca_enable_regulator(struct qca_vreg vregs, ...@@ -1395,13 +1395,6 @@ static int qca_enable_regulator(struct qca_vreg vregs,
if (ret) if (ret)
return ret; return ret;
if (vregs.load_uA)
ret = regulator_set_load(regulator,
vregs.load_uA);
if (ret)
return ret;
return regulator_enable(regulator); return regulator_enable(regulator);
} }
...@@ -1411,8 +1404,6 @@ static void qca_disable_regulator(struct qca_vreg vregs, ...@@ -1411,8 +1404,6 @@ static void qca_disable_regulator(struct qca_vreg vregs,
{ {
regulator_disable(regulator); regulator_disable(regulator);
regulator_set_voltage(regulator, 0, vregs.max_uV); regulator_set_voltage(regulator, 0, vregs.max_uV);
if (vregs.load_uA)
regulator_set_load(regulator, 0);
} }
...@@ -1464,18 +1455,30 @@ static int qca_power_setup(struct hci_uart *hu, bool on) ...@@ -1464,18 +1455,30 @@ static int qca_power_setup(struct hci_uart *hu, bool on)
static int qca_init_regulators(struct qca_power *qca, static int qca_init_regulators(struct qca_power *qca,
const struct qca_vreg *vregs, size_t num_vregs) const struct qca_vreg *vregs, size_t num_vregs)
{ {
struct regulator_bulk_data *bulk;
int ret;
int i; int i;
qca->vreg_bulk = devm_kcalloc(qca->dev, num_vregs, bulk = devm_kcalloc(qca->dev, num_vregs, sizeof(*bulk), GFP_KERNEL);
sizeof(struct regulator_bulk_data), if (!bulk)
GFP_KERNEL);
if (!qca->vreg_bulk)
return -ENOMEM; return -ENOMEM;
for (i = 0; i < num_vregs; i++) for (i = 0; i < num_vregs; i++)
qca->vreg_bulk[i].supply = vregs[i].name; bulk[i].supply = vregs[i].name;
ret = devm_regulator_bulk_get(qca->dev, num_vregs, bulk);
if (ret < 0)
return ret;
return devm_regulator_bulk_get(qca->dev, num_vregs, qca->vreg_bulk); for (i = 0; i < num_vregs; i++) {
ret = regulator_set_load(bulk[i].consumer, vregs[i].load_uA);
if (ret)
return ret;
}
qca->vreg_bulk = bulk;
return 0;
} }
static int qca_serdev_probe(struct serdev_device *serdev) static int qca_serdev_probe(struct serdev_device *serdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment