All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/2] Add MediaTek MT8365 I2C support
@ 2023-03-27  8:27 ` Alexandre Mergnat
  0 siblings, 0 replies; 12+ messages in thread
From: Alexandre Mergnat @ 2023-03-27  8:27 UTC (permalink / raw)
  To: Qii Wang, Rob Herring, Krzysztof Kozlowski, Matthias Brugger
  Cc: linux-i2c, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent, Rob Herring,
	AngeloGioacchino Del Regno, Alexandre Mergnat

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/20230101220149.3035048-1-bero@baylibre.com/
[2]: https://lore.kernel.org/all/20220531135026.238475-2-fparent@baylibre.com/
[3]: https://lore.kernel.org/all/ed1f9faf-cb4f-9ff1-ab6b-813035a051bd@gmail.com/

Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
Changes in v5:
- Remove mediatek,drive-strength-adv which is a deprecated pin-control property.
- Link to v4: https://lore.kernel.org/r/20221122-mt8365-i2c-support-v4-0-885ad3301d5a@baylibre.com

Changes in v4:
- Fix some properties order.
- Remove the useless properties.
- Link to v3: https://lore.kernel.org/r/20221122-mt8365-i2c-support-v3-0-ad9bb1076d7f@baylibre.com

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/20221122-mt8365-i2c-support-v2-0-e4c7c514e781@baylibre.com

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/20221122-mt8365-i2c-support-v1-0-4aeb7c54c67b@baylibre.com

---
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 | 16 ++++++++++
 arch/arm64/boot/dts/mediatek/mt8365.dtsi    | 48 +++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+)
---
base-commit: 5c6b974d24c21a6aa5d8b524067d7d9bc7fcc4f2
change-id: 20221122-mt8365-i2c-support-fc048da261ea

Best regards,
-- 
Alexandre Mergnat <amergnat@baylibre.com>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v5 0/2] Add MediaTek MT8365 I2C support
@ 2023-03-27  8:27 ` Alexandre Mergnat
  0 siblings, 0 replies; 12+ messages in thread
From: Alexandre Mergnat @ 2023-03-27  8:27 UTC (permalink / raw)
  To: Qii Wang, Rob Herring, Krzysztof Kozlowski, Matthias Brugger
  Cc: linux-i2c, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent, Rob Herring,
	AngeloGioacchino Del Regno, Alexandre Mergnat

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/20230101220149.3035048-1-bero@baylibre.com/
[2]: https://lore.kernel.org/all/20220531135026.238475-2-fparent@baylibre.com/
[3]: https://lore.kernel.org/all/ed1f9faf-cb4f-9ff1-ab6b-813035a051bd@gmail.com/

Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
Changes in v5:
- Remove mediatek,drive-strength-adv which is a deprecated pin-control property.
- Link to v4: https://lore.kernel.org/r/20221122-mt8365-i2c-support-v4-0-885ad3301d5a@baylibre.com

Changes in v4:
- Fix some properties order.
- Remove the useless properties.
- Link to v3: https://lore.kernel.org/r/20221122-mt8365-i2c-support-v3-0-ad9bb1076d7f@baylibre.com

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/20221122-mt8365-i2c-support-v2-0-e4c7c514e781@baylibre.com

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/20221122-mt8365-i2c-support-v1-0-4aeb7c54c67b@baylibre.com

---
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 | 16 ++++++++++
 arch/arm64/boot/dts/mediatek/mt8365.dtsi    | 48 +++++++++++++++++++++++++++++
 2 files changed, 64 insertions(+)
---
base-commit: 5c6b974d24c21a6aa5d8b524067d7d9bc7fcc4f2
change-id: 20221122-mt8365-i2c-support-fc048da261ea

Best regards,
-- 
Alexandre Mergnat <amergnat@baylibre.com>


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v5 1/2] arm64: dts: mediatek: add i2c support for mt8365 SoC
  2023-03-27  8:27 ` Alexandre Mergnat
@ 2023-03-27  8:27   ` Alexandre Mergnat
  -1 siblings, 0 replies; 12+ messages in thread
From: Alexandre Mergnat @ 2023-03-27  8:27 UTC (permalink / raw)
  To: Qii Wang, Rob Herring, Krzysztof Kozlowski, Matthias Brugger
  Cc: linux-i2c, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent, Rob Herring,
	AngeloGioacchino Del Regno, Alexandre Mergnat

There are four I2C master channels in MT8365 with a same HW architecture.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
 arch/arm64/boot/dts/mediatek/mt8365.dtsi | 48 ++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
index 15ac4c1f0966..b70f4d256f63 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
@@ -282,6 +282,42 @@ pwm: pwm@11006000 {
 			clock-names = "top", "main", "pwm1", "pwm2", "pwm3";
 		};
 
+		i2c0: i2c@11007000 {
+			compatible = "mediatek,mt8365-i2c", "mediatek,mt8168-i2c";
+			reg = <0 0x11007000 0 0xa0>, <0 0x11000080 0 0x80>;
+			interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_LOW>;
+			clock-div = <1>;
+			clocks = <&infracfg CLK_IFR_I2C0_AXI>, <&infracfg CLK_IFR_AP_DMA>;
+			clock-names = "main", "dma";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c1: i2c@11008000 {
+			compatible = "mediatek,mt8365-i2c", "mediatek,mt8168-i2c";
+			reg = <0 0x11008000 0 0xa0>, <0 0x11000100 0 0x80>;
+			interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_LOW>;
+			clock-div = <1>;
+			clocks = <&infracfg CLK_IFR_I2C1_AXI>, <&infracfg CLK_IFR_AP_DMA>;
+			clock-names = "main", "dma";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c2: i2c@11009000 {
+			compatible = "mediatek,mt8365-i2c", "mediatek,mt8168-i2c";
+			reg = <0 0x11009000 0 0xa0>, <0 0x11000180 0 0x80>;
+			interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_LOW>;
+			clock-div = <1>;
+			clocks = <&infracfg CLK_IFR_I2C2_AXI>, <&infracfg CLK_IFR_AP_DMA>;
+			clock-names = "main", "dma";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		spi: spi@1100a000 {
 			compatible = "mediatek,mt8365-spi", "mediatek,mt7622-spi";
 			reg = <0 0x1100a000 0 0x100>;
@@ -295,6 +331,18 @@ spi: spi@1100a000 {
 			status = "disabled";
 		};
 
+		i2c3: i2c@1100f000 {
+			compatible = "mediatek,mt8365-i2c", "mediatek,mt8168-i2c";
+			reg = <0 0x1100f000 0 0xa0>, <0 0x11000200 0 0x80>;
+			interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_LOW>;
+			clock-div = <1>;
+			clocks = <&infracfg CLK_IFR_I2C3_AXI>, <&infracfg CLK_IFR_AP_DMA>;
+			clock-names = "main", "dma";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		ssusb: usb@11201000 {
 			compatible = "mediatek,mt8365-mtu3", "mediatek,mtu3";
 			reg = <0 0x11201000 0 0x2e00>, <0 0x11203e00 0 0x0100>;

-- 
2.25.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v5 1/2] arm64: dts: mediatek: add i2c support for mt8365 SoC
@ 2023-03-27  8:27   ` Alexandre Mergnat
  0 siblings, 0 replies; 12+ messages in thread
From: Alexandre Mergnat @ 2023-03-27  8:27 UTC (permalink / raw)
  To: Qii Wang, Rob Herring, Krzysztof Kozlowski, Matthias Brugger
  Cc: linux-i2c, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent, Rob Herring,
	AngeloGioacchino Del Regno, Alexandre Mergnat

There are four I2C master channels in MT8365 with a same HW architecture.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
---
 arch/arm64/boot/dts/mediatek/mt8365.dtsi | 48 ++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
index 15ac4c1f0966..b70f4d256f63 100644
--- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi
@@ -282,6 +282,42 @@ pwm: pwm@11006000 {
 			clock-names = "top", "main", "pwm1", "pwm2", "pwm3";
 		};
 
+		i2c0: i2c@11007000 {
+			compatible = "mediatek,mt8365-i2c", "mediatek,mt8168-i2c";
+			reg = <0 0x11007000 0 0xa0>, <0 0x11000080 0 0x80>;
+			interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_LOW>;
+			clock-div = <1>;
+			clocks = <&infracfg CLK_IFR_I2C0_AXI>, <&infracfg CLK_IFR_AP_DMA>;
+			clock-names = "main", "dma";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c1: i2c@11008000 {
+			compatible = "mediatek,mt8365-i2c", "mediatek,mt8168-i2c";
+			reg = <0 0x11008000 0 0xa0>, <0 0x11000100 0 0x80>;
+			interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_LOW>;
+			clock-div = <1>;
+			clocks = <&infracfg CLK_IFR_I2C1_AXI>, <&infracfg CLK_IFR_AP_DMA>;
+			clock-names = "main", "dma";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		i2c2: i2c@11009000 {
+			compatible = "mediatek,mt8365-i2c", "mediatek,mt8168-i2c";
+			reg = <0 0x11009000 0 0xa0>, <0 0x11000180 0 0x80>;
+			interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_LOW>;
+			clock-div = <1>;
+			clocks = <&infracfg CLK_IFR_I2C2_AXI>, <&infracfg CLK_IFR_AP_DMA>;
+			clock-names = "main", "dma";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		spi: spi@1100a000 {
 			compatible = "mediatek,mt8365-spi", "mediatek,mt7622-spi";
 			reg = <0 0x1100a000 0 0x100>;
@@ -295,6 +331,18 @@ spi: spi@1100a000 {
 			status = "disabled";
 		};
 
+		i2c3: i2c@1100f000 {
+			compatible = "mediatek,mt8365-i2c", "mediatek,mt8168-i2c";
+			reg = <0 0x1100f000 0 0xa0>, <0 0x11000200 0 0x80>;
+			interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_LOW>;
+			clock-div = <1>;
+			clocks = <&infracfg CLK_IFR_I2C3_AXI>, <&infracfg CLK_IFR_AP_DMA>;
+			clock-names = "main", "dma";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		ssusb: usb@11201000 {
 			compatible = "mediatek,mt8365-mtu3", "mediatek,mtu3";
 			reg = <0 0x11201000 0 0x2e00>, <0 0x11203e00 0 0x0100>;

-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v5 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board
  2023-03-27  8:27 ` Alexandre Mergnat
@ 2023-03-27  8:27   ` Alexandre Mergnat
  -1 siblings, 0 replies; 12+ messages in thread
From: Alexandre Mergnat @ 2023-03-27  8:27 UTC (permalink / raw)
  To: Qii Wang, Rob Herring, Krzysztof Kozlowski, Matthias Brugger
  Cc: linux-i2c, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent, Rob Herring,
	AngeloGioacchino Del Regno, Alexandre Mergnat

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 | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
index 4683704ea235..35cb142004a4 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,15 @@ pins {
 		};
 	};
 
+	i2c0_pins: i2c0-pins {
+		pins {
+			bias-pull-up;
+			mediatek,pull-up-adv = <3>;
+			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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH v5 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board
@ 2023-03-27  8:27   ` Alexandre Mergnat
  0 siblings, 0 replies; 12+ messages in thread
From: Alexandre Mergnat @ 2023-03-27  8:27 UTC (permalink / raw)
  To: Qii Wang, Rob Herring, Krzysztof Kozlowski, Matthias Brugger
  Cc: linux-i2c, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent, Rob Herring,
	AngeloGioacchino Del Regno, Alexandre Mergnat

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 | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
index 4683704ea235..35cb142004a4 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,15 @@ pins {
 		};
 	};
 
+	i2c0_pins: i2c0-pins {
+		pins {
+			bias-pull-up;
+			mediatek,pull-up-adv = <3>;
+			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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH v5 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board
  2023-03-27  8:27   ` Alexandre Mergnat
@ 2023-03-27  8:45     ` AngeloGioacchino Del Regno
  -1 siblings, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-03-27  8:45 UTC (permalink / raw)
  To: Alexandre Mergnat, Qii Wang, Rob Herring, Krzysztof Kozlowski,
	Matthias Brugger
  Cc: linux-i2c, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent, Rob Herring

Il 27/03/23 10:27, 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 | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> index 4683704ea235..35cb142004a4 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,15 @@ pins {
>   		};
>   	};
>   
> +	i2c0_pins: i2c0-pins {
> +		pins {
			pinmux = ...pins...
			bias-pull-up = <your-pull-up-adv-value>;
		};

...and please do *not* use the mediatek,pull-up-adv property: this is
supposed to be there only for older devicetrees and there's a replacement
for it.... unless you have any specific reason to do so (and if you do,
you should well explain that).

Besides, if you introduce the usage of that property in any 8365 devicetree,
the previously proposed 8365 pinctrl cleanup will become a bit harder to do.

Cheers,
Angelo



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v5 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board
@ 2023-03-27  8:45     ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 12+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-03-27  8:45 UTC (permalink / raw)
  To: Alexandre Mergnat, Qii Wang, Rob Herring, Krzysztof Kozlowski,
	Matthias Brugger
  Cc: linux-i2c, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent, Rob Herring

Il 27/03/23 10:27, 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 | 16 ++++++++++++++++
>   1 file changed, 16 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> index 4683704ea235..35cb142004a4 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,15 @@ pins {
>   		};
>   	};
>   
> +	i2c0_pins: i2c0-pins {
> +		pins {
			pinmux = ...pins...
			bias-pull-up = <your-pull-up-adv-value>;
		};

...and please do *not* use the mediatek,pull-up-adv property: this is
supposed to be there only for older devicetrees and there's a replacement
for it.... unless you have any specific reason to do so (and if you do,
you should well explain that).

Besides, if you introduce the usage of that property in any 8365 devicetree,
the previously proposed 8365 pinctrl cleanup will become a bit harder to do.

Cheers,
Angelo



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v5 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board
  2023-03-27  8:45     ` AngeloGioacchino Del Regno
@ 2023-03-27 10:56       ` Alexandre Mergnat
  -1 siblings, 0 replies; 12+ messages in thread
From: Alexandre Mergnat @ 2023-03-27 10:56 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: Qii Wang, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	linux-i2c, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent, Rob Herring

Hi Angelo,

Le lun. 27 mars 2023 à 10:45, AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> a écrit :
>
> Il 27/03/23 10:27, 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 | 16 ++++++++++++++++
> >   1 file changed, 16 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> > index 4683704ea235..35cb142004a4 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,15 @@ pins {
> >               };
> >       };
> >
> > +     i2c0_pins: i2c0-pins {
> > +             pins {
>                         pinmux = ...pins...
>                         bias-pull-up = <your-pull-up-adv-value>;
>                 };
>
> ...and please do *not* use the mediatek,pull-up-adv property: this is
> supposed to be there only for older devicetrees and there's a replacement
> for it.... unless you have any specific reason to do so (and if you do,
> you should well explain that).

bias-pull-up isn't necessary currently because MT8365 doesn't use MTK
paris/moore drivers.

> Besides, if you introduce the usage of that property in any 8365 devicetree,
> the previously proposed 8365 pinctrl cleanup will become a bit harder to do.

I'm thinking of deprecating the "mediatek,pull-up-adv",
"mediatek,pull-down-adv" properties from mt8365 pinctrl binding too.

Regards,
Alex

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v5 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board
@ 2023-03-27 10:56       ` Alexandre Mergnat
  0 siblings, 0 replies; 12+ messages in thread
From: Alexandre Mergnat @ 2023-03-27 10:56 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: Qii Wang, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	linux-i2c, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent, Rob Herring

Hi Angelo,

Le lun. 27 mars 2023 à 10:45, AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com> a écrit :
>
> Il 27/03/23 10:27, 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 | 16 ++++++++++++++++
> >   1 file changed, 16 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/mediatek/mt8365-evk.dts b/arch/arm64/boot/dts/mediatek/mt8365-evk.dts
> > index 4683704ea235..35cb142004a4 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,15 @@ pins {
> >               };
> >       };
> >
> > +     i2c0_pins: i2c0-pins {
> > +             pins {
>                         pinmux = ...pins...
>                         bias-pull-up = <your-pull-up-adv-value>;
>                 };
>
> ...and please do *not* use the mediatek,pull-up-adv property: this is
> supposed to be there only for older devicetrees and there's a replacement
> for it.... unless you have any specific reason to do so (and if you do,
> you should well explain that).

bias-pull-up isn't necessary currently because MT8365 doesn't use MTK
paris/moore drivers.

> Besides, if you introduce the usage of that property in any 8365 devicetree,
> the previously proposed 8365 pinctrl cleanup will become a bit harder to do.

I'm thinking of deprecating the "mediatek,pull-up-adv",
"mediatek,pull-down-adv" properties from mt8365 pinctrl binding too.

Regards,
Alex

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v5 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board
  2023-03-27 10:56       ` Alexandre Mergnat
@ 2023-03-27 10:59         ` Alexandre Mergnat
  -1 siblings, 0 replies; 12+ messages in thread
From: Alexandre Mergnat @ 2023-03-27 10:59 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: Qii Wang, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	linux-i2c, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent, Rob Herring

> > ...and please do *not* use the mediatek,pull-up-adv property: this is
> > supposed to be there only for older devicetrees and there's a replacement
> > for it.... unless you have any specific reason to do so (and if you do,
> > you should well explain that).
>
> bias-pull-up isn't necessary currently because MT8365 doesn't use MTK

I mean mediatek,pull-up-adv. bias-pull-up can be kept.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v5 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board
@ 2023-03-27 10:59         ` Alexandre Mergnat
  0 siblings, 0 replies; 12+ messages in thread
From: Alexandre Mergnat @ 2023-03-27 10:59 UTC (permalink / raw)
  To: AngeloGioacchino Del Regno
  Cc: Qii Wang, Rob Herring, Krzysztof Kozlowski, Matthias Brugger,
	linux-i2c, devicetree, linux-arm-kernel, linux-mediatek,
	linux-kernel, Fabien Parent, Rob Herring

> > ...and please do *not* use the mediatek,pull-up-adv property: this is
> > supposed to be there only for older devicetrees and there's a replacement
> > for it.... unless you have any specific reason to do so (and if you do,
> > you should well explain that).
>
> bias-pull-up isn't necessary currently because MT8365 doesn't use MTK

I mean mediatek,pull-up-adv. bias-pull-up can be kept.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-03-27 11:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27  8:27 [PATCH v5 0/2] Add MediaTek MT8365 I2C support Alexandre Mergnat
2023-03-27  8:27 ` Alexandre Mergnat
2023-03-27  8:27 ` [PATCH v5 1/2] arm64: dts: mediatek: add i2c support for mt8365 SoC Alexandre Mergnat
2023-03-27  8:27   ` Alexandre Mergnat
2023-03-27  8:27 ` [PATCH v5 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board Alexandre Mergnat
2023-03-27  8:27   ` Alexandre Mergnat
2023-03-27  8:45   ` AngeloGioacchino Del Regno
2023-03-27  8:45     ` AngeloGioacchino Del Regno
2023-03-27 10:56     ` Alexandre Mergnat
2023-03-27 10:56       ` Alexandre Mergnat
2023-03-27 10:59       ` Alexandre Mergnat
2023-03-27 10:59         ` Alexandre Mergnat

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.