2023-03-28 09:08:46

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v6 0/2] Add MediaTek MT8365 I2C support

Hi,
This patch series adds I2C support for MT8365-EVK board.
The I2C-0 is enabled, it can be used through the board pin header,
as described directly on the PCB.

This series depends to another one which add support for
MT8365 SoC and EVK board. Link [1]
This dependancy has been applied by Matthias Brugger [3]

One patch has been cherry-picked from [2], so I've addressed the comment
and kept the trailer.

Regards,
Alex

[1]: https://lore.kernel.org/linux-mediatek/[email protected]/
[2]: https://lore.kernel.org/all/[email protected]/
[3]: https://lore.kernel.org/all/[email protected]/

Signed-off-by: Alexandre Mergnat <[email protected]>
---
Changes in v6:
- Remove mediatek,pull-up-adv which is a deprecated pin-control property.
- Link to v5: https://lore.kernel.org/r/[email protected]

Changes in v5:
- Remove mediatek,drive-strength-adv which is a deprecated pin-control property.
- Link to v4: https://lore.kernel.org/r/[email protected]

Changes in v4:
- Fix some properties order.
- Remove the useless properties.
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Rebased to v6.3-rc1.
- Move i2c3 node to be consistent with the SoC address order.
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Drop the patch which do useless change in i2c-mt65xx.c driver.
- Change 2 lines compatible/reg in oneline.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Alexandre Mergnat (2):
arm64: dts: mediatek: add i2c support for mt8365 SoC
arm64: dts: mediatek: enable i2c0 for mt8365-evk board

arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 15 +++++++++
arch/arm64/boot/dts/mediatek/mt8365.dtsi | 48 +++++++++++++++++++++++++++++
2 files changed, 63 insertions(+)
---
base-commit: 5c6b974d24c21a6aa5d8b524067d7d9bc7fcc4f2
change-id: 20221122-mt8365-i2c-support-fc048da261ea

Best regards,
--
Alexandre Mergnat <[email protected]>


2023-03-28 09:09:56

by Alexandre Mergnat

[permalink] [raw]
Subject: [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board

Enable the I2C0 bus provides communication with:
- The integrated RT9466 Switching Battery Charger.
- The integrated MT6691 LP4X buck for VDDQ.
- The integrated MT6691 LP4X buck for VDD2.
- The pin header, to plug external I2C devices.

Signed-off-by: Alexandre Mergnat <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
index 4683704ea235..adc79ba14b33 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
@@ -87,6 +87,13 @@ optee_reserved: optee@43200000 {
};
};

+&i2c0 {
+ clock-frequency = <100000>;
+ pinctrl-0 = <&i2c0_pins>;
+ pinctrl-names = "default";
+ status = "okay";
+};
+
&pio {
gpio_keys: gpio-keys-pins {
pins {
@@ -96,6 +103,14 @@ pins {
};
};

+ i2c0_pins: i2c0-pins {
+ pins {
+ bias-pull-up;
+ pinmux = <MT8365_PIN_57_SDA0__FUNC_SDA0_0>,
+ <MT8365_PIN_58_SCL0__FUNC_SCL0_0>;
+ };
+ };
+
uart0_pins: uart0-pins {
pins {
pinmux = <MT8365_PIN_35_URXD0__FUNC_URXD0>,

--
2.25.1

Subject: Re: [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board

Il 28/03/23 11:04, Alexandre Mergnat ha scritto:
> Enable the I2C0 bus provides communication with:
> - The integrated RT9466 Switching Battery Charger.
> - The integrated MT6691 LP4X buck for VDDQ.
> - The integrated MT6691 LP4X buck for VDD2.
> - The pin header, to plug external I2C devices.
>
> Signed-off-by: Alexandre Mergnat <[email protected]>
> ---
> arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> index 4683704ea235..adc79ba14b33 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> @@ -87,6 +87,13 @@ optee_reserved: optee@43200000 {
> };
> };
>
> +&i2c0 {
> + clock-frequency = <100000>;
> + pinctrl-0 = <&i2c0_pins>;
> + pinctrl-names = "default";
> + status = "okay";
> +};
> +
> &pio {
> gpio_keys: gpio-keys-pins {
> pins {
> @@ -96,6 +103,14 @@ pins {
> };
> };
>
> + i2c0_pins: i2c0-pins {
> + pins {
> + bias-pull-up;

I prefer seeing pinmux first, any other properties last....
If Matthias can please fix that while applying...

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>


2023-03-28 13:13:13

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board

Le mar. 28 mars 2023 à 12:05, AngeloGioacchino Del Regno
<[email protected]> a écrit :
>
> Il 28/03/23 11:04, Alexandre Mergnat ha scritto:
> > Enable the I2C0 bus provides communication with:
> > - The integrated RT9466 Switching Battery Charger.
> > - The integrated MT6691 LP4X buck for VDDQ.
> > - The integrated MT6691 LP4X buck for VDD2.
> > - The pin header, to plug external I2C devices.
> >
> > Signed-off-by: Alexandre Mergnat <[email protected]>
> > ---
> > arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> > index 4683704ea235..adc79ba14b33 100644
> > --- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> > +++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> > @@ -87,6 +87,13 @@ optee_reserved: optee@43200000 {
> > };
> > };
> >
> > +&i2c0 {
> > + clock-frequency = <100000>;
> > + pinctrl-0 = <&i2c0_pins>;
> > + pinctrl-names = "default";
> > + status = "okay";
> > +};
> > +
> > &pio {
> > gpio_keys: gpio-keys-pins {
> > pins {
> > @@ -96,6 +103,14 @@ pins {
> > };
> > };
> >
> > + i2c0_pins: i2c0-pins {
> > + pins {
> > + bias-pull-up;
>
> I prefer seeing pinmux first, any other properties last....

Here the pinctrl binding cleanup [1]

Regards,
Alex

[1]: https://lore.kernel.org/all/[email protected]/

2023-03-30 17:22:32

by Matthias Brugger

[permalink] [raw]
Subject: Re: [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board



On 28/03/2023 12:04, AngeloGioacchino Del Regno wrote:
> Il 28/03/23 11:04, Alexandre Mergnat ha scritto:
>> Enable the I2C0 bus provides communication with:
>> - The integrated RT9466 Switching Battery Charger.
>> - The integrated MT6691 LP4X buck for VDDQ.
>> - The integrated MT6691 LP4X buck for VDD2.
>> - The pin header, to plug external I2C devices.
>>
>> Signed-off-by: Alexandre Mergnat <[email protected]>
>> ---
>>   arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 15 +++++++++++++++
>>   1 file changed, 15 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
>> b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
>> index 4683704ea235..adc79ba14b33 100644
>> --- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
>> +++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
>> @@ -87,6 +87,13 @@ optee_reserved: optee@43200000 {
>>       };
>>   };
>> +&i2c0 {
>> +    clock-frequency = <100000>;
>> +    pinctrl-0 = <&i2c0_pins>;
>> +    pinctrl-names = "default";
>> +    status = "okay";
>> +};
>> +
>>   &pio {
>>       gpio_keys: gpio-keys-pins {
>>           pins {
>> @@ -96,6 +103,14 @@ pins {
>>           };
>>       };
>> +    i2c0_pins: i2c0-pins {
>> +        pins {
>> +            bias-pull-up;
>
> I prefer seeing pinmux first, any other properties last....
> If Matthias can please fix that while applying...
>

Done and queued the whole series.

Thanks!
Matthias

> Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
>
>

2023-03-31 12:24:50

by Alexandre Mergnat

[permalink] [raw]
Subject: Re: [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board

Thanks Angelo and Matthis for your time !

Alex

Le jeu. 30 mars 2023 à 19:14, Matthias Brugger
<[email protected]> a écrit :
>
>
>
> On 28/03/2023 12:04, AngeloGioacchino Del Regno wrote:
> > Il 28/03/23 11:04, Alexandre Mergnat ha scritto:
> >> Enable the I2C0 bus provides communication with:
> >> - The integrated RT9466 Switching Battery Charger.
> >> - The integrated MT6691 LP4X buck for VDDQ.
> >> - The integrated MT6691 LP4X buck for VDD2.
> >> - The pin header, to plug external I2C devices.
> >>
> >> Signed-off-by: Alexandre Mergnat <[email protected]>
> >> ---
> >> arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 15 +++++++++++++++
> >> 1 file changed, 15 insertions(+)
> >>
> >> diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> >> b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> >> index 4683704ea235..adc79ba14b33 100644
> >> --- a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> >> +++ b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> >> @@ -87,6 +87,13 @@ optee_reserved: optee@43200000 {
> >> };
> >> };
> >> +&i2c0 {
> >> + clock-frequency = <100000>;
> >> + pinctrl-0 = <&i2c0_pins>;
> >> + pinctrl-names = "default";
> >> + status = "okay";
> >> +};
> >> +
> >> &pio {
> >> gpio_keys: gpio-keys-pins {
> >> pins {
> >> @@ -96,6 +103,14 @@ pins {
> >> };
> >> };
> >> + i2c0_pins: i2c0-pins {
> >> + pins {
> >> + bias-pull-up;
> >
> > I prefer seeing pinmux first, any other properties last....
> > If Matthias can please fix that while applying...
> >
>
> Done and queued the whole series.
>
> Thanks!
> Matthias
>
> > Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
> >
> >