lkml.org 
[lkml]   [2022]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 4/5] regulator: add mt6357 regulator
On Wed, Oct 05, 2022 at 04:57:24PM +0200, Alexandre Mergnat wrote:

> +static int mt6357_set_voltage_sel(struct regulator_dev *rdev,
> + unsigned int selector)
> +{
> + int idx, ret;
> + const u32 *pvol;
> + struct mt6357_regulator_info *info = rdev_get_drvdata(rdev);
> +
> + pvol = info->index_table;
> +
> + idx = pvol[selector];
> + ret = regmap_update_bits(rdev->regmap, info->desc.vsel_reg,
> + info->desc.vsel_mask,
> + idx << 8);
> +
> + return ret;
> +}

There's a bunch of other Mediatek drivers doing this and multiple
instances in this driver, the helper should really be factored out.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-10-05 17:10    [W:0.113 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site