mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: mediatek: mt7981: add I2C controller
@ 2024-04-05 12:55 Rafał Miłecki
  2024-06-03  7:37 ` AngeloGioacchino Del Regno
  0 siblings, 1 reply; 2+ messages in thread
From: Rafał Miłecki @ 2024-04-05 12:55 UTC (permalink / raw)
  To: Matthias Brugger, AngeloGioacchino Del Regno, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

MT7981 has one on-SoC I2C controller that differs from recent Mediatek
blocks by having a different SLAVE_ADDR register offset (thus a custom
binding compatible string).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 arch/arm64/boot/dts/mediatek/mt7981b.dtsi | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
index 8a6263cc569c..2d7f91196e64 100644
--- a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
@@ -94,6 +94,23 @@ pwm@10048000 {
 			#pwm-cells = <2>;
 		};
 
+		i2c@11007000 {
+			compatible = "mediatek,mt7981-i2c";
+			reg = <0 0x11007000 0 0x1000>,
+			      <0 0x10217080 0 0x80>;
+			interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&infracfg CLK_INFRA_I2C0_CK>,
+				 <&infracfg CLK_INFRA_AP_DMA_CK>,
+				 <&infracfg CLK_INFRA_I2C_MCK_CK>,
+				 <&infracfg CLK_INFRA_I2C_PCK_CK>;
+			clock-names = "main", "dma", "arb", "pmic";
+			clock-div = <1>;
+			clock-frequency = <100000>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		pio: pinctrl@11d00000 {
 			compatible = "mediatek,mt7981-pinctrl";
 			reg = <0 0x11d00000 0 0x1000>,
-- 
2.35.3


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

* Re: [PATCH] arm64: dts: mediatek: mt7981: add I2C controller
  2024-04-05 12:55 [PATCH] arm64: dts: mediatek: mt7981: add I2C controller Rafał Miłecki
@ 2024-06-03  7:37 ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 2+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-06-03  7:37 UTC (permalink / raw)
  To: Rafał Miłecki, Matthias Brugger, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley
  Cc: devicetree, linux-arm-kernel, linux-mediatek, linux-kernel,
	Rafał Miłecki

Il 05/04/24 14:55, Rafał Miłecki ha scritto:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> MT7981 has one on-SoC I2C controller that differs from recent Mediatek
> blocks by having a different SLAVE_ADDR register offset (thus a custom
> binding compatible string).
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>   arch/arm64/boot/dts/mediatek/mt7981b.dtsi | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
> index 8a6263cc569c..2d7f91196e64 100644
> --- a/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt7981b.dtsi
> @@ -94,6 +94,23 @@ pwm@10048000 {
>   			#pwm-cells = <2>;
>   		};
>   
> +		i2c@11007000 {
> +			compatible = "mediatek,mt7981-i2c";
> +			reg = <0 0x11007000 0 0x1000>,
> +			      <0 0x10217080 0 0x80>;
> +			interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&infracfg CLK_INFRA_I2C0_CK>,
> +				 <&infracfg CLK_INFRA_AP_DMA_CK>,
> +				 <&infracfg CLK_INFRA_I2C_MCK_CK>,
> +				 <&infracfg CLK_INFRA_I2C_PCK_CK>;
> +			clock-names = "main", "dma", "arb", "pmic";
> +			clock-div = <1>;
> +			clock-frequency = <100000>;

If you need to specify clock-div and clock-frequency, those are board-specific
properties and not soc wide.

Please remove those from there and put them in your board specific DT.

Cheers,
Angelo


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

end of thread, other threads:[~2024-06-03  7:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-05 12:55 [PATCH] arm64: dts: mediatek: mt7981: add I2C controller Rafał Miłecki
2024-06-03  7:37 ` AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®