* [PATCH] phy: qcom-qmp-usb: Set regulator load before enabling
@ 2025-09-05 10:12 Faisal Hassan
2025-09-05 13:46 ` Dmitry Baryshkov
2025-12-23 17:44 ` Vinod Koul
0 siblings, 2 replies; 4+ messages in thread
From: Faisal Hassan @ 2025-09-05 10:12 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Dmitry Baryshkov,
Krishna Kurapati, Johan Hovold, Chenyuan Yang,
Varadarajan Narayanan, linux-arm-msm, linux-phy, linux-kernel
Cc: Faisal Hassan
Set the regulator load before enabling the regulators to ensure stable
operation and proper power management on platforms where regulators are
shared between the QMP USB PHY and other IP blocks.
Introduce a regulator data structure with explicit enable load values and
use the regulator framework's `init_load_uA` field along with
`devm_regulator_bulk_get_const()` to ensure that `regulator_set_load()` is
applied automatically before the first enable, providing consistent power
management behavior across platforms.
Signed-off-by: Faisal Hassan <faisal.hassan@oss.qualcomm.com>
---
drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 27 ++++++-------------------
1 file changed, 6 insertions(+), 21 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
index ed646a7e705b..8bc2dc975870 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
@@ -1266,7 +1266,7 @@ struct qmp_phy_cfg {
int pcs_usb_tbl_num;
/* regulators to be requested */
- const char * const *vreg_list;
+ const struct regulator_bulk_data *vreg_list;
int num_vregs;
/* array of registers with different offsets */
@@ -1344,8 +1344,9 @@ static const char * const usb3phy_reset_l[] = {
};
/* list of regulators */
-static const char * const qmp_phy_vreg_l[] = {
- "vdda-phy", "vdda-pll",
+static const struct regulator_bulk_data qmp_phy_vreg_l[] = {
+ { .supply = "vdda-phy", .init_load_uA = 21800, },
+ { .supply = "vdda-pll", .init_load_uA = 36000, },
};
static const struct qmp_usb_offsets qmp_usb_offsets_v3 = {
@@ -1986,23 +1987,6 @@ static const struct dev_pm_ops qmp_usb_pm_ops = {
qmp_usb_runtime_resume, NULL)
};
-static int qmp_usb_vreg_init(struct qmp_usb *qmp)
-{
- const struct qmp_phy_cfg *cfg = qmp->cfg;
- struct device *dev = qmp->dev;
- int num = cfg->num_vregs;
- 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];
-
- return devm_regulator_bulk_get(dev, num, qmp->vregs);
-}
-
static int qmp_usb_reset_init(struct qmp_usb *qmp,
const char *const *reset_list,
int num_resets)
@@ -2251,7 +2235,8 @@ static int qmp_usb_probe(struct platform_device *pdev)
if (!qmp->cfg)
return -EINVAL;
- ret = qmp_usb_vreg_init(qmp);
+ ret = devm_regulator_bulk_get_const(dev, qmp->cfg->num_vregs,
+ qmp->cfg->vreg_list, &qmp->vregs);
if (ret)
return ret;
--
2.17.1
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] phy: qcom-qmp-usb: Set regulator load before enabling
2025-09-05 10:12 [PATCH] phy: qcom-qmp-usb: Set regulator load before enabling Faisal Hassan
@ 2025-09-05 13:46 ` Dmitry Baryshkov
2025-12-18 4:35 ` Faisal Hassan
2025-12-23 17:44 ` Vinod Koul
1 sibling, 1 reply; 4+ messages in thread
From: Dmitry Baryshkov @ 2025-09-05 13:46 UTC (permalink / raw)
To: Faisal Hassan
Cc: Vinod Koul, Kishon Vijay Abraham I, Krishna Kurapati,
Johan Hovold, Chenyuan Yang, Varadarajan Narayanan, linux-arm-msm,
linux-phy, linux-kernel
On Fri, Sep 05, 2025 at 03:42:43PM +0530, Faisal Hassan wrote:
> Set the regulator load before enabling the regulators to ensure stable
> operation and proper power management on platforms where regulators are
> shared between the QMP USB PHY and other IP blocks.
>
> Introduce a regulator data structure with explicit enable load values and
> use the regulator framework's `init_load_uA` field along with
> `devm_regulator_bulk_get_const()` to ensure that `regulator_set_load()` is
> applied automatically before the first enable, providing consistent power
> management behavior across platforms.
>
> Signed-off-by: Faisal Hassan <faisal.hassan@oss.qualcomm.com>
> ---
> drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 27 ++++++-------------------
> 1 file changed, 6 insertions(+), 21 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] phy: qcom-qmp-usb: Set regulator load before enabling
2025-09-05 13:46 ` Dmitry Baryshkov
@ 2025-12-18 4:35 ` Faisal Hassan
0 siblings, 0 replies; 4+ messages in thread
From: Faisal Hassan @ 2025-12-18 4:35 UTC (permalink / raw)
To: Dmitry Baryshkov, Vinod Koul
Cc: Kishon Vijay Abraham I, Krishna Kurapati, Johan Hovold,
Chenyuan Yang, Varadarajan Narayanan, linux-arm-msm, linux-phy,
linux-kernel
On 9/5/2025 7:16 PM, Dmitry Baryshkov wrote:
> On Fri, Sep 05, 2025 at 03:42:43PM +0530, Faisal Hassan wrote:
>> Set the regulator load before enabling the regulators to ensure stable
>> operation and proper power management on platforms where regulators are
>> shared between the QMP USB PHY and other IP blocks.
>>
>> Introduce a regulator data structure with explicit enable load values and
>> use the regulator framework's `init_load_uA` field along with
>> `devm_regulator_bulk_get_const()` to ensure that `regulator_set_load()` is
>> applied automatically before the first enable, providing consistent power
>> management behavior across platforms.
>>
>> Signed-off-by: Faisal Hassan <faisal.hassan@oss.qualcomm.com>
>> ---
>> drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 27 ++++++-------------------
>> 1 file changed, 6 insertions(+), 21 deletions(-)
>>
>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>
>
Hi Vinod,
Gentle ping on this.
Is this ready to be applied, or do you need anything else from me?
Thanks,
Faisal
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] phy: qcom-qmp-usb: Set regulator load before enabling
2025-09-05 10:12 [PATCH] phy: qcom-qmp-usb: Set regulator load before enabling Faisal Hassan
2025-09-05 13:46 ` Dmitry Baryshkov
@ 2025-12-23 17:44 ` Vinod Koul
1 sibling, 0 replies; 4+ messages in thread
From: Vinod Koul @ 2025-12-23 17:44 UTC (permalink / raw)
To: Kishon Vijay Abraham I, Dmitry Baryshkov, Krishna Kurapati,
Johan Hovold, Chenyuan Yang, Varadarajan Narayanan, linux-arm-msm,
linux-phy, linux-kernel, Faisal Hassan
On Fri, 05 Sep 2025 15:42:43 +0530, Faisal Hassan wrote:
> Set the regulator load before enabling the regulators to ensure stable
> operation and proper power management on platforms where regulators are
> shared between the QMP USB PHY and other IP blocks.
>
> Introduce a regulator data structure with explicit enable load values and
> use the regulator framework's `init_load_uA` field along with
> `devm_regulator_bulk_get_const()` to ensure that `regulator_set_load()` is
> applied automatically before the first enable, providing consistent power
> management behavior across platforms.
>
> [...]
Applied, thanks!
[1/1] phy: qcom-qmp-usb: Set regulator load before enabling
commit: 346ba84646355d651bb301f66137ad4418381a8e
Best regards,
--
~Vinod
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-12-23 17:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-05 10:12 [PATCH] phy: qcom-qmp-usb: Set regulator load before enabling Faisal Hassan
2025-09-05 13:46 ` Dmitry Baryshkov
2025-12-18 4:35 ` Faisal Hassan
2025-12-23 17:44 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox