[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yz2eIslwcXKNaOfi@sirena.org.uk>
Date: Wed, 5 Oct 2022 16:09:22 +0100
From: Mark Brown <broonie@...nel.org>
To: Alexandre Mergnat <amergnat@...libre.com>
Cc: Lee Jones <lee@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
Rob Herring <robh+dt@...nel.org>,
Liam Girdwood <lgirdwood@...il.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Chen Zhong <chen.zhong@...iatek.com>,
linux-mediatek@...ts.infradead.org, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
Rob Herring <robh@...nel.org>, linux-kernel@...r.kernel.org,
linux-input@...r.kernel.org, Fabien Parent <fparent@...libre.com>
Subject: Re: [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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists