Re: [PATCH v2 6/9] phy: qcom: Add M31 based eUSB2 PHY driver

From: Dmitry Baryshkov
Date: Tue Mar 04 2025 - 21:46:01 EST


On Tue, Mar 04, 2025 at 01:56:39PM -0800, Melody Olvera wrote:
> From: Wesley Cheng <quic_wcheng@xxxxxxxxxxx>
>
> SM8750 utilizes an eUSB2 PHY from M31. Add the initialization
> sequences to bring it out of reset and into an operational state. This
> differs to the M31 USB driver, in that the M31 eUSB2 driver will
> require a connection to an eUSB2 repeater. This PHY driver will handle
> the initialization of the associated eUSB2 repeater when required.
>
> Signed-off-by: Wesley Cheng <quic_wcheng@xxxxxxxxxxx>
> Signed-off-by: Melody Olvera <quic_molvera@xxxxxxxxxxx>
> ---
> drivers/phy/qualcomm/Kconfig | 10 +
> drivers/phy/qualcomm/Makefile | 1 +
> drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 296 ++++++++++++++++++++++++++++++
> 3 files changed, 307 insertions(+)
>

[...]

> +
> +static int msm_m31_eusb2_write_readback(void __iomem *base, u32 offset,

m31eusb2_phy_write_readback()

> + const u32 mask, u32 val)
> +{
> + u32 write_val;
> + u32 tmp;
> +

[..]

> +
> +static const struct phy_ops m31eusb2_phy_gen_ops = {
> + .init = m31eusb2_phy_init,
> + .exit = m31eusb2_phy_exit,
> + .owner = THIS_MODULE,

Strange alignment

> +};
> +

[...]

> +
> + phy->phy = devm_phy_create(dev, NULL, &m31eusb2_phy_gen_ops);
> + if (IS_ERR(phy->phy))
> + return dev_err_probe(dev, PTR_ERR(phy->phy),
> + "failed to create phy\n");
> +
> + for (i = 0; i < M31_EUSB_NUM_VREGS; i++)
> + phy->vregs[i].supply = m31_eusb_phy_vreg_names[i];
> +
> + ret = devm_regulator_bulk_get(dev, M31_EUSB_NUM_VREGS, phy->vregs);

devm_regulator_bulk_get_const()

> + if (ret)
> + return dev_err_probe(dev, ret,
> + "failed to get regulator supplies\n");
> +
> +

[..]

> +MODULE_DESCRIPTION("eUSB2 Qualcomm M31 HSPHY driver");
> +MODULE_LICENSE("GPL");

MODULE_AUTHOR()?

>
> --
> 2.46.1
>

--
With best wishes
Dmitry