lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGXv+5ELHjc_egKVyNn4kqGfoj0jRxcmzP7H5VnE3dSv-YcERw@mail.gmail.com>
Date: Fri, 1 Aug 2025 15:30:53 +0800
From: Chen-Yu Tsai <wenst@...omium.org>
To: "niklaus.liu" <niklaus.liu@...iatek.com>
Cc: Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, 
	Conor Dooley <conor+dt@...nel.org>, Stephen Boyd <sboyd@...nel.org>, 
	Matthias Brugger <matthias.bgg@...il.com>, 
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>, 
	Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>, 
	Flora Fu <flora.fu@...iatek.com>, Alexandre Mergnat <amergnat@...libre.com>, 
	Hsin-Hsiung Wang <hsin-hsiung.wang@...iatek.com>, devicetree@...r.kernel.org, 
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, 
	linux-mediatek@...ts.infradead.org, 
	Project_Global_Chrome_Upstream_Group@...iatek.com
Subject: Re: [PATCH 3/3] regulator: Modify mt6315 regulator mode mask

On Fri, Aug 1, 2025 at 3:20 PM niklaus.liu <niklaus.liu@...iatek.com> wrote:
>
> Modify mt6315 regulator mode mask, compatible with all 6315 models
>
> Signed-off-by: niklaus.liu <niklaus.liu@...iatek.com>
> ---
>  drivers/regulator/mt6315-regulator.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/regulator/mt6315-regulator.c b/drivers/regulator/mt6315-regulator.c
> index 2608a6652d77..092ff748fe21 100644
> --- a/drivers/regulator/mt6315-regulator.c
> +++ b/drivers/regulator/mt6315-regulator.c
> @@ -218,8 +218,10 @@ static int mt6315_regulator_probe(struct spmi_device *pdev)
>         struct regmap *regmap;
>         struct mt6315_chip *chip;
>         struct mt_regulator_init_data *init_data;
> +       struct device_node *node = pdev->dev.of_node;
>         struct regulator_config config = {};
>         struct regulator_dev *rdev;
> +       unsigned int val = 0;
>         int i;
>
>         regmap = devm_regmap_init_spmi_ext(pdev, &mt6315_regmap_config);
> @@ -247,6 +249,10 @@ static int mt6315_regulator_probe(struct spmi_device *pdev)
>                 init_data->modeset_mask[MT6315_VBUCK1] = BIT(MT6315_VBUCK1);
>                 break;
>         }
> +
> +       if (!of_property_read_u32(node, "buck1-modeset-mask", &val))
> +               init_data->modeset_mask[MT6315_VBUCK1] = val;
> +

This needs a matching change to the DT bindings.

However, please take a look at Angelo's recent series [1] for MT8196
PMICs that also adds variants of the MT6316 series regulators and how
it adds compatible strings for various parts to cover 2-phase, 3-phase,
and 4-phase settings.

Now personally I think a better way would be if we could somehow read back
a) the part number, or b) the multi-phase settings from the chip itself,
and derive `modeset_mask` automatically. Is that possible? Can MediaTek
share this information?


ChenYu

[1] https://lore.kernel.org/all/20250715140224.206329-1-angelogioacchino.delregno@collabora.com/


>         for (i = MT6315_VBUCK2; i < MT6315_VBUCK_MAX; i++)
>                 init_data->modeset_mask[i] = BIT(i);
>
> --
> 2.46.0
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ