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

Message ID 20221122-mt8365-i2c-support-v6-2-e1009c8afd53@baylibre.com
State New
Headers
Series Add MediaTek MT8365 I2C support |

Commit Message

Alexandre Mergnat March 28, 2023, 9:04 a.m. UTC
  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 <amergnat@baylibre.com>
---
 arch/arm64/boot/dts/mediatek/mt8365-evk.dts | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
  

Comments

AngeloGioacchino Del Regno March 28, 2023, 10:04 a.m. UTC | #1
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 <amergnat@baylibre.com>
> ---
>   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 <angelogioacchino.delregno@collabora.com>
  
Alexandre Mergnat March 28, 2023, 1:10 p.m. UTC | #2
Le mar. 28 mars 2023 à 12:05, AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> 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 <amergnat@baylibre.com>
> > ---
> >   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/20230327-cleanup-pinctrl-binding-v1-0-b695e32e4f2e@baylibre.com/
  
Matthias Brugger March 30, 2023, 5:14 p.m. UTC | #3
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 <amergnat@baylibre.com>
>> ---
>>   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 <angelogioacchino.delregno@collabora.com>
> 
>
  
Alexandre Mergnat March 31, 2023, 12:23 p.m. UTC | #4
Thanks Angelo and Matthis for your time !

Alex

Le jeu. 30 mars 2023 à 19:14, Matthias Brugger
<matthias.bgg@gmail.com> 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 <amergnat@baylibre.com>
> >> ---
> >>   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 <angelogioacchino.delregno@collabora.com>
> >
> >
  

Patch

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>,