[O][PATCH 18/21] UBUNTU: SAUCE: phy: qcom-qmp-combo: drop regulator loads
Juerg Haefliger
juerg.haefliger at canonical.com
Tue Sep 3 08:40:07 UTC 2024
From: Johan Hovold <johan+linaro at kernel.org>
Drivers should not be specifying active-mode regulator loads unless
supporting an idle mode where the load is reduced during runtime.
This effectively reverts commit 85936d4f3815 ("phy: qcom-qmp: add
regulator_set_load to dp phy").
Link: https://lore.kernel.org/r/YuPps+cvVAMugWmy@sirena.org.uk
Signed-off-by: Johan Hovold <johan+linaro at kernel.org>
(cherry picked from commit 85f127f537adb8886e5caeb72a78d4aa15049708 github.com/jhovold/linux)
Signed-off-by: Juerg Haefliger <juerg.haefliger at canonical.com>
---
drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 40 +++++------------------
1 file changed, 9 insertions(+), 31 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
index 7b00945f7191..3d3e68aa0774 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
@@ -1425,17 +1425,6 @@ static const struct qmp_phy_init_tbl x1e80100_usb43dp_pcs_usb_tbl[] = {
QMP_PHY_INIT_CFG(QPHY_V6_PCS_USB3_RXEQTRAINING_DFE_TIME_S2, 0x07),
};
-/* list of regulators */
-struct qmp_regulator_data {
- const char *name;
- unsigned int enable_load;
-};
-
-static struct qmp_regulator_data qmp_phy_vreg_l[] = {
- { .name = "vdda-phy", .enable_load = 21800 },
- { .name = "vdda-pll", .enable_load = 36000 },
-};
-
static const u8 qmp_dp_v3_pre_emphasis_hbr3_hbr2[4][4] = {
{ 0x00, 0x0c, 0x15, 0x1a },
{ 0x02, 0x0e, 0x16, 0xff },
@@ -1591,7 +1580,7 @@ struct qmp_phy_cfg {
const char * const *reset_list;
int num_resets;
/* regulators to be requested */
- const struct qmp_regulator_data *vreg_list;
+ const char * const *vreg_list;
int num_vregs;
/* array of registers with different offsets */
@@ -1700,6 +1689,11 @@ static const char * const sc7180_usb3phy_reset_l[] = {
"phy",
};
+/* list of regulators */
+static const char * const qmp_phy_vreg_l[] = {
+ "vdda-phy", "vdda-pll",
+};
+
static const struct qmp_combo_offsets qmp_combo_offsets_v3 = {
.com = 0x0000,
.txa = 0x1200,
@@ -3090,32 +3084,16 @@ static int qmp_combo_vreg_init(struct qmp_combo *qmp)
const struct qmp_phy_cfg *cfg = qmp->cfg;
struct device *dev = qmp->dev;
int num = cfg->num_vregs;
- int ret, i;
+ int i;
qmp->vregs = devm_kcalloc(dev, num, sizeof(*qmp->vregs), GFP_KERNEL);
if (!qmp->vregs)
return -ENOMEM;
for (i = 0; i < num; i++)
- qmp->vregs[i].supply = cfg->vreg_list[i].name;
+ qmp->vregs[i].supply = cfg->vreg_list[i];
- ret = devm_regulator_bulk_get(dev, num, qmp->vregs);
- if (ret) {
- dev_err(dev, "failed at devm_regulator_bulk_get\n");
- return ret;
- }
-
- for (i = 0; i < num; i++) {
- ret = regulator_set_load(qmp->vregs[i].consumer,
- cfg->vreg_list[i].enable_load);
- if (ret) {
- dev_err(dev, "failed to set load at %s\n",
- qmp->vregs[i].supply);
- return ret;
- }
- }
-
- return 0;
+ return devm_regulator_bulk_get(dev, num, qmp->vregs);
}
static int qmp_combo_reset_init(struct qmp_combo *qmp)
--
2.43.0
More information about the kernel-team
mailing list