Re: [PATCH v4 2/2] net: phy: motorcomm: Add pad drive strength cfg support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +static u32 yt8531_get_ds_map(struct phy_device *phydev, u32 cur)
> +{
> +	u32 vol;
> +	int i;
> +
> +	vol = yt8531_get_ldo_vol(phydev);
> +	for (i = 0; i < ARRAY_SIZE(yt8531_ldo_vol); i++) {
> +		if (yt8531_ldo_vol[i].vol == vol && yt8531_ldo_vol[i].cur == cur)
> +			return yt8531_ldo_vol[i].ds;
> +	}
> +
> +	phydev_warn(phydev,
> +		    "No matching current value was found %d, Use default value.\n", cur);
> +
> +	return YT8531_RGMII_RX_DS_DEFAULT;

If there is a value in DT and it is invalid, return -EINVAL and fail
the probe. Only use the default if there is no value in DT.

    Andrew



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux