[PATCH v3 5/8] regulator: mt6359: Add support for MT6359 regulator

Mark Brown broonie at kernel.org
Tue Nov 24 12:07:32 EST 2020


On Mon, Nov 23, 2020 at 11:48:07AM +0800, Hsin-Hsiung Wang wrote:

> +static int mt6359_get_linear_voltage_sel(struct regulator_dev *rdev)
> +{
> +	struct mt6359_regulator_info *info = rdev_get_drvdata(rdev);
> +	int ret, regval;
> +
> +	ret = regmap_read(rdev->regmap, info->da_vsel_reg, &regval);
> +	if (ret != 0) {
> +		dev_err(&rdev->dev,
> +			"Failed to get mt6359 Buck %s vsel reg: %d\n",
> +			info->desc.name, ret);
> +		return ret;
> +	}
> +
> +	ret = (regval >> info->da_vsel_shift) & info->da_vsel_mask;
> +
> +	return ret;
> +}

This looks like it could just be regmap_get_voltage_sel_regmap()?
Otherwise the driver looks good.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20201124/39d8a49e/attachment.sig>


More information about the Linux-mediatek mailing list