diff mbox series

[9/9] soc: mediatek: pwrap: add support for MT6366 PMIC

Message ID 20230803074249.3065586-10-wenst@chromium.org
State New
Headers show
Series [1/9] dt-bindings: mfd: mt6397: Split out compatible for MediaTek MT6366 PMIC | expand

Commit Message

Chen-Yu Tsai Aug. 3, 2023, 7:42 a.m. UTC
The MT6366 PMIC is mostly, but not fully, compatible with MT6358. It has
a different set of regulators. Specifically, it lacks the camera related
VCAM* LDOs, but has additional VM18, VMDDR, and VSRAM_CORE LDOs.

Add a separate compatible for the MT6366 PMIC.

Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
---
 drivers/soc/mediatek/mtk-pmic-wrap.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Chen-Yu Tsai Aug. 4, 2023, 3:49 a.m. UTC | #1
On Thu, Aug 3, 2023 at 5:01 PM AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> wrote:
>
> Il 03/08/23 09:42, Chen-Yu Tsai ha scritto:
> > The MT6366 PMIC is mostly, but not fully, compatible with MT6358. It has
> > a different set of regulators. Specifically, it lacks the camera related
> > VCAM* LDOs, but has additional VM18, VMDDR, and VSRAM_CORE LDOs.
> >
> > Add a separate compatible for the MT6366 PMIC.
> >
> > Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
>
> We can express the same partial-compatibility state with bindings, adding a
> new compatible here with the same platform data doesn't really add any value...
>
> ...also because in DT we'll have something like
>         compatible = "mediatek,mt6366", "mediatek,mt6358";
>
> so if any variation of platform data in mtk-pmic-wrap will ever be needed, we
> would still be able to do that in the future without any headache.
>
> In my opinion, this commit can be dropped.

As mentioned in my reply to the mfd patch, this might not be doable. There
are limitations on both the DT bindings and mfd driver sides.

ChenYu

> P.S.: We could add a comment in the mt6366.dtsi pmic devicetree for that, too?
>
> Cheers,
> Angelo
>
> > ---
> >   drivers/soc/mediatek/mtk-pmic-wrap.c | 2 ++
> >   1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
> > index 11095b8de71a..e3c0e767033b 100644
> > --- a/drivers/soc/mediatek/mtk-pmic-wrap.c
> > +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
> > @@ -2257,6 +2257,8 @@ static const struct of_device_id of_slave_match_tbl[] = {
> >       { .compatible = "mediatek,mt6357", .data = &pmic_mt6357 },
> >       { .compatible = "mediatek,mt6358", .data = &pmic_mt6358 },
> >       { .compatible = "mediatek,mt6359", .data = &pmic_mt6359 },
> > +     /* MT6366 is mostly compatible with MT6358, except for slightly different regulators. */
> > +     { .compatible = "mediatek,mt6366", .data = &pmic_mt6358 },
> >
> >       /* The MT6380 PMIC only implements a regulator, so we bind it
> >        * directly instead of using a MFD.
>
>
diff mbox series

Patch

diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
index 11095b8de71a..e3c0e767033b 100644
--- a/drivers/soc/mediatek/mtk-pmic-wrap.c
+++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
@@ -2257,6 +2257,8 @@  static const struct of_device_id of_slave_match_tbl[] = {
 	{ .compatible = "mediatek,mt6357", .data = &pmic_mt6357 },
 	{ .compatible = "mediatek,mt6358", .data = &pmic_mt6358 },
 	{ .compatible = "mediatek,mt6359", .data = &pmic_mt6359 },
+	/* MT6366 is mostly compatible with MT6358, except for slightly different regulators. */
+	{ .compatible = "mediatek,mt6366", .data = &pmic_mt6358 },
 
 	/* The MT6380 PMIC only implements a regulator, so we bind it
 	 * directly instead of using a MFD.