Re: [PATCH v4 07/25] scsi: ufs: mediatek: Rework 0.9V regulator

Nicolas Frattaroli
2025-12-23T16:14:07Z

On Tuesday, 23 December 2025 10:35:39 Central European Standard Time Peter Wang (王信友) wrote:
> On Thu, 2025-12-18 at 13:54 +0100, Nicolas Frattaroli wrote:
> >
> > +static int ufs_mtk_get_supplies(struct ufs_mtk_host *host)
> > +{
> > + struct device *dev = host->hba->dev;
> > + const struct ufs_mtk_soc_data *data =
> > of_device_get_match_data(dev);
> > +
> > + if (!data || !data->has_avdd09)
> > + return 0;
> >
>
>
> Hi Nicolas,
>
> It seems that has_avdd09 is not necessary, because if the
> platform does not support avdd09, it will return an error
> (-ENODEV) and bypass the avdd09 flow, right?
>
> Thanks
> Peter
>
>
>
>

Hi,

that would allow compatibles that are not allowed to have an avdd09
regulator by the binding (because the SoC doesn't have that pin) to
have one specified in the device tree get picked up. This would then
cause those devices with such a device tree to enter
ufs_mtk_va09_pwr_ctrl(), which is not what we want. While we could
blame this on the DT being wrong in that case, I think it's better
if we avoid such a situation entirely.

Kind regards,
Nicolas Frattaroli