* [PATCH v6 0/2] Add MediaTek MT8365 I2C support
@ 2023-03-28 9:04 Alexandre Mergnat
2023-03-28 9:04 ` [PATCH v6 1/2] arm64: dts: mediatek: add i2c support for mt8365 SoC Alexandre Mergnat
2023-03-28 9:04 ` [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board Alexandre Mergnat
0 siblings, 2 replies; 7+ messages in thread
From: Alexandre Mergnat @ 2023-03-28 9:04 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 v6:
- Remove mediatek,pull-up-adv which is a deprecated pin-control property.
- Link to v5: https://lore.kernel.org/r/20221122-mt8365-i2c-support-v5-0-6e4f3b54937f@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 | 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 <amergnat@baylibre.com>
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH v6 1/2] arm64: dts: mediatek: add i2c support for mt8365 SoC 2023-03-28 9:04 [PATCH v6 0/2] Add MediaTek MT8365 I2C support Alexandre Mergnat @ 2023-03-28 9:04 ` Alexandre Mergnat 2023-03-28 9:04 ` [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board Alexandre Mergnat 1 sibling, 0 replies; 7+ messages in thread From: Alexandre Mergnat @ 2023-03-28 9:04 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] 7+ messages in thread
* [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board 2023-03-28 9:04 [PATCH v6 0/2] Add MediaTek MT8365 I2C support Alexandre Mergnat 2023-03-28 9:04 ` [PATCH v6 1/2] arm64: dts: mediatek: add i2c support for mt8365 SoC Alexandre Mergnat @ 2023-03-28 9:04 ` Alexandre Mergnat 2023-03-28 10:04 ` AngeloGioacchino Del Regno 1 sibling, 1 reply; 7+ messages in thread From: Alexandre Mergnat @ 2023-03-28 9:04 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 | 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 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board 2023-03-28 9:04 ` [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board Alexandre Mergnat @ 2023-03-28 10:04 ` AngeloGioacchino Del Regno 2023-03-28 13:10 ` Alexandre Mergnat 2023-03-30 17:14 ` Matthias Brugger 0 siblings, 2 replies; 7+ messages in thread From: AngeloGioacchino Del Regno @ 2023-03-28 10:04 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 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> ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board 2023-03-28 10:04 ` AngeloGioacchino Del Regno @ 2023-03-28 13:10 ` Alexandre Mergnat 2023-03-30 17:14 ` Matthias Brugger 1 sibling, 0 replies; 7+ messages in thread From: Alexandre Mergnat @ 2023-03-28 13:10 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 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/ ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board 2023-03-28 10:04 ` AngeloGioacchino Del Regno 2023-03-28 13:10 ` Alexandre Mergnat @ 2023-03-30 17:14 ` Matthias Brugger 2023-03-31 12:23 ` Alexandre Mergnat 1 sibling, 1 reply; 7+ messages in thread From: Matthias Brugger @ 2023-03-30 17:14 UTC (permalink / raw) To: AngeloGioacchino Del Regno, Alexandre Mergnat, Qii Wang, Rob Herring, Krzysztof Kozlowski Cc: linux-i2c, devicetree, linux-arm-kernel, linux-mediatek, linux-kernel, Fabien Parent, Rob Herring 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> > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board 2023-03-30 17:14 ` Matthias Brugger @ 2023-03-31 12:23 ` Alexandre Mergnat 0 siblings, 0 replies; 7+ messages in thread From: Alexandre Mergnat @ 2023-03-31 12:23 UTC (permalink / raw) To: Matthias Brugger Cc: AngeloGioacchino Del Regno, Qii Wang, Rob Herring, Krzysztof Kozlowski, linux-i2c, devicetree, linux-arm-kernel, linux-mediatek, linux-kernel, Fabien Parent, Rob Herring 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> > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-03-31 12:24 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-03-28 9:04 [PATCH v6 0/2] Add MediaTek MT8365 I2C support Alexandre Mergnat 2023-03-28 9:04 ` [PATCH v6 1/2] arm64: dts: mediatek: add i2c support for mt8365 SoC Alexandre Mergnat 2023-03-28 9:04 ` [PATCH v6 2/2] arm64: dts: mediatek: enable i2c0 for mt8365-evk board Alexandre Mergnat 2023-03-28 10:04 ` AngeloGioacchino Del Regno 2023-03-28 13:10 ` Alexandre Mergnat 2023-03-30 17:14 ` Matthias Brugger 2023-03-31 12:23 ` Alexandre Mergnat
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox