2022-01-06 06:54:24

by Johnson Wang

[permalink] [raw]
Subject: [PATCH 1/4] mfd: Add support for the MediaTek MT6366 PMIC

This adds support for the MediaTek MT6366 PMIC. This is a
multifunction device with the following sub modules:

- Regulator
- RTC
- Codec
- Interrupt

It is interfaced to the host controller using SPI interface
by a proprietary hardware called PMIC wrapper or pwrap.
MT6366 MFD is a child device of the pwrap.

Signed-off-by: Johnson Wang <[email protected]>
---
drivers/mfd/mt6358-irq.c | 1 +
include/linux/mfd/mt6358/registers.h | 7 +++++++
include/linux/mfd/mt6397/core.h | 1 +
3 files changed, 9 insertions(+)

diff --git a/drivers/mfd/mt6358-irq.c b/drivers/mfd/mt6358-irq.c
index 83f3ffbdbb4c..ea5e452510eb 100644
--- a/drivers/mfd/mt6358-irq.c
+++ b/drivers/mfd/mt6358-irq.c
@@ -212,6 +212,7 @@ int mt6358_irq_init(struct mt6397_chip *chip)

switch (chip->chip_id) {
case MT6358_CHIP_ID:
+ case MT6366_CHIP_ID:
chip->irq_data = &mt6358_irqd;
break;

diff --git a/include/linux/mfd/mt6358/registers.h b/include/linux/mfd/mt6358/registers.h
index 201139b12140..3d33517f178c 100644
--- a/include/linux/mfd/mt6358/registers.h
+++ b/include/linux/mfd/mt6358/registers.h
@@ -94,6 +94,10 @@
#define MT6358_BUCK_VCORE_CON0 0x1488
#define MT6358_BUCK_VCORE_DBG0 0x149e
#define MT6358_BUCK_VCORE_DBG1 0x14a0
+#define MT6358_BUCK_VCORE_SSHUB_CON0 0x14a4
+#define MT6358_BUCK_VCORE_SSHUB_CON1 0x14a6
+#define MT6358_BUCK_VCORE_SSHUB_ELR0 MT6358_BUCK_VCORE_SSHUB_CON1
+#define MT6358_BUCK_VCORE_SSHUB_DBG1 MT6358_BUCK_VCORE_DBG1
#define MT6358_BUCK_VCORE_ELR0 0x14aa
#define MT6358_BUCK_VGPU_CON0 0x1508
#define MT6358_BUCK_VGPU_DBG0 0x151e
@@ -169,6 +173,9 @@
#define MT6358_LDO_VSRAM_OTHERS_CON0 0x1ba6
#define MT6358_LDO_VSRAM_OTHERS_DBG0 0x1bc0
#define MT6358_LDO_VSRAM_OTHERS_DBG1 0x1bc2
+#define MT6358_LDO_VSRAM_OTHERS_SSHUB_CON0 0x1bc4
+#define MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1 0x1bc6
+#define MT6358_LDO_VSRAM_OTHERS_SSHUB_DBG1 MT6358_LDO_VSRAM_OTHERS_DBG1
#define MT6358_LDO_VSRAM_GPU_CON0 0x1bc8
#define MT6358_LDO_VSRAM_GPU_DBG0 0x1be2
#define MT6358_LDO_VSRAM_GPU_DBG1 0x1be4
diff --git a/include/linux/mfd/mt6397/core.h b/include/linux/mfd/mt6397/core.h
index 56f210eebc54..1cf78726503b 100644
--- a/include/linux/mfd/mt6397/core.h
+++ b/include/linux/mfd/mt6397/core.h
@@ -14,6 +14,7 @@ enum chip_id {
MT6323_CHIP_ID = 0x23,
MT6358_CHIP_ID = 0x58,
MT6359_CHIP_ID = 0x59,
+ MT6366_CHIP_ID = 0x66,
MT6391_CHIP_ID = 0x91,
MT6397_CHIP_ID = 0x97,
};
--
2.18.0



2022-02-08 11:33:49

by Johnson Wang

[permalink] [raw]
Subject: Re: [PATCH 1/4] mfd: Add support for the MediaTek MT6366 PMIC

Hi Lee,
This patch intends to add MT6366 PMIC support and
there are some modifications in mfd subsystem.

Could you give us some suggestion for this patch?

Thanks for your support!

BRs,
Johnson Wang

On Thu, 2022-01-06 at 14:54 +0800, Johnson Wang wrote:
> This adds support for the MediaTek MT6366 PMIC. This is a
> multifunction device with the following sub modules:
>
> - Regulator
> - RTC
> - Codec
> - Interrupt
>
> It is interfaced to the host controller using SPI interface
> by a proprietary hardware called PMIC wrapper or pwrap.
> MT6366 MFD is a child device of the pwrap.
>
> Signed-off-by: Johnson Wang <[email protected]>
> ---
> drivers/mfd/mt6358-irq.c | 1 +
> include/linux/mfd/mt6358/registers.h | 7 +++++++
> include/linux/mfd/mt6397/core.h | 1 +
> 3 files changed, 9 insertions(+)
>
> diff --git a/drivers/mfd/mt6358-irq.c b/drivers/mfd/mt6358-irq.c
> index 83f3ffbdbb4c..ea5e452510eb 100644
> --- a/drivers/mfd/mt6358-irq.c
> +++ b/drivers/mfd/mt6358-irq.c
> @@ -212,6 +212,7 @@ int mt6358_irq_init(struct mt6397_chip *chip)
>
> switch (chip->chip_id) {
> case MT6358_CHIP_ID:
> + case MT6366_CHIP_ID:
> chip->irq_data = &mt6358_irqd;
> break;
>
> diff --git a/include/linux/mfd/mt6358/registers.h
> b/include/linux/mfd/mt6358/registers.h
> index 201139b12140..3d33517f178c 100644
> --- a/include/linux/mfd/mt6358/registers.h
> +++ b/include/linux/mfd/mt6358/registers.h
> @@ -94,6 +94,10 @@
> #define MT6358_BUCK_VCORE_CON0 0x1488
> #define MT6358_BUCK_VCORE_DBG0 0x149e
> #define MT6358_BUCK_VCORE_DBG1 0x14a0
> +#define MT6358_BUCK_VCORE_SSHUB_CON0 0x14a4
> +#define MT6358_BUCK_VCORE_SSHUB_CON1 0x14a6
> +#define
> MT6358_BUCK_VCORE_SSHUB_ELR0 MT6358_BUCK_VCORE_SSHUB_CON1
> +#define MT6358_BUCK_VCORE_SSHUB_DBG1 MT6358_BUCK_VCORE_DBG1
> #define MT6358_BUCK_VCORE_ELR0 0x14aa
> #define MT6358_BUCK_VGPU_CON0 0x1508
> #define MT6358_BUCK_VGPU_DBG0 0x151e
> @@ -169,6 +173,9 @@
> #define MT6358_LDO_VSRAM_OTHERS_CON0 0x1ba6
> #define MT6358_LDO_VSRAM_OTHERS_DBG0 0x1bc0
> #define MT6358_LDO_VSRAM_OTHERS_DBG1 0x1bc2
> +#define MT6358_LDO_VSRAM_OTHERS_SSHUB_CON0 0x1bc4
> +#define MT6358_LDO_VSRAM_OTHERS_SSHUB_CON1 0x1bc6
> +#define
> MT6358_LDO_VSRAM_OTHERS_SSHUB_DBG1 MT6358_LDO_VSRAM_OTHERS_DBG1
> #define MT6358_LDO_VSRAM_GPU_CON0 0x1bc8
> #define MT6358_LDO_VSRAM_GPU_DBG0 0x1be2
> #define MT6358_LDO_VSRAM_GPU_DBG1 0x1be4
> diff --git a/include/linux/mfd/mt6397/core.h
> b/include/linux/mfd/mt6397/core.h
> index 56f210eebc54..1cf78726503b 100644
> --- a/include/linux/mfd/mt6397/core.h
> +++ b/include/linux/mfd/mt6397/core.h
> @@ -14,6 +14,7 @@ enum chip_id {
> MT6323_CHIP_ID = 0x23,
> MT6358_CHIP_ID = 0x58,
> MT6359_CHIP_ID = 0x59,
> + MT6366_CHIP_ID = 0x66,
> MT6391_CHIP_ID = 0x91,
> MT6397_CHIP_ID = 0x97,
> };


2022-02-14 16:21:31

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 1/4] mfd: Add support for the MediaTek MT6366 PMIC

On Thu, 06 Jan 2022, Johnson Wang wrote:

> This adds support for the MediaTek MT6366 PMIC. This is a
> multifunction device with the following sub modules:
>
> - Regulator
> - RTC
> - Codec
> - Interrupt
>
> It is interfaced to the host controller using SPI interface
> by a proprietary hardware called PMIC wrapper or pwrap.
> MT6366 MFD is a child device of the pwrap.
>
> Signed-off-by: Johnson Wang <[email protected]>
> ---
> drivers/mfd/mt6358-irq.c | 1 +
> include/linux/mfd/mt6358/registers.h | 7 +++++++
> include/linux/mfd/mt6397/core.h | 1 +
> 3 files changed, 9 insertions(+)

Applied, thanks.

--
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2022-02-23 14:47:18

by Johnson Wang

[permalink] [raw]
Subject: Re: [PATCH 1/4] mfd: Add support for the MediaTek MT6366 PMIC

On Mon, 2022-02-14 at 13:39 +0000, Lee Jones wrote:
> On Thu, 06 Jan 2022, Johnson Wang wrote:
>
> > This adds support for the MediaTek MT6366 PMIC. This is a
> > multifunction device with the following sub modules:
> >
> > - Regulator
> > - RTC
> > - Codec
> > - Interrupt
> >
> > It is interfaced to the host controller using SPI interface
> > by a proprietary hardware called PMIC wrapper or pwrap.
> > MT6366 MFD is a child device of the pwrap.
> >
> > Signed-off-by: Johnson Wang <[email protected]>
> > ---
> > drivers/mfd/mt6358-irq.c | 1 +
> > include/linux/mfd/mt6358/registers.h | 7 +++++++
> > include/linux/mfd/mt6397/core.h | 1 +
> > 3 files changed, 9 insertions(+)
>
> Applied, thanks.
>

Hi Lee,

Thank you for your review and response.

However, it seems that my patches are not applied yet.
Is it possible to merge my patches into mainline?

If you have any concern, please let me know.

Thanks.

BRs,
Johnson Wang

2022-02-24 01:42:35

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 1/4] mfd: Add support for the MediaTek MT6366 PMIC

On Wed, 23 Feb 2022, Johnson Wang wrote:

> On Mon, 2022-02-14 at 13:39 +0000, Lee Jones wrote:
> > On Thu, 06 Jan 2022, Johnson Wang wrote:
> >
> > > This adds support for the MediaTek MT6366 PMIC. This is a
> > > multifunction device with the following sub modules:
> > >
> > > - Regulator
> > > - RTC
> > > - Codec
> > > - Interrupt
> > >
> > > It is interfaced to the host controller using SPI interface
> > > by a proprietary hardware called PMIC wrapper or pwrap.
> > > MT6366 MFD is a child device of the pwrap.
> > >
> > > Signed-off-by: Johnson Wang <[email protected]>
> > > ---
> > > drivers/mfd/mt6358-irq.c | 1 +
> > > include/linux/mfd/mt6358/registers.h | 7 +++++++
> > > include/linux/mfd/mt6397/core.h | 1 +
> > > 3 files changed, 9 insertions(+)
> >
> > Applied, thanks.
> >
>
> Hi Lee,
>
> Thank you for your review and response.
>
> However, it seems that my patches are not applied yet.
> Is it possible to merge my patches into mainline?

Thanks for the nudge.

I just found them on the wrong topic branch.

They are now applied to the correct branch and pushed.

The patches will arrive in -next tomorrow.

Apologies for the fuss.

--
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog