devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] i2c: Add support for MT6878 I2C controllers
@ 2025-09-20 15:31 Igor Belwon
  2025-09-20 15:31 ` [PATCH 1/2] dt-bindings: i2c: i2c-mt65xx: Document MediaTek MT6878 I2C Igor Belwon
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Igor Belwon @ 2025-09-20 15:31 UTC (permalink / raw)
  To: Qii Wang, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: ~postmarketos/upstreaming, linux-i2c, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, Igor Belwon

Hi all,

This patchest adds support for the i2c units found in the MediaTek 
MT6878 SoC. These units use the new v3 register offset scheme 
(differing only in OFFSET_SLAVE_ADDR).

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
---
Igor Belwon (2):
      dt-bindings: i2c: i2c-mt65xx: Document MediaTek MT6878 I2C
      i2c: mediatek: add support for MT6878 SoC

 Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml |  1 +
 drivers/i2c/busses/i2c-mt65xx.c                       | 14 ++++++++++++++
 2 files changed, 15 insertions(+)
---
base-commit: 846bd2225ec3cfa8be046655e02b9457ed41973e
change-id: 20250920-mt6878-i2c-bringup-640d48cbf66b

Best regards,
-- 
Igor Belwon <igor.belwon@mentallysanemainliners.org>


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

* [PATCH 1/2] dt-bindings: i2c: i2c-mt65xx: Document MediaTek MT6878 I2C
  2025-09-20 15:31 [PATCH 0/2] i2c: Add support for MT6878 I2C controllers Igor Belwon
@ 2025-09-20 15:31 ` Igor Belwon
  2025-09-22  7:55   ` AngeloGioacchino Del Regno
  2025-09-20 15:31 ` [PATCH 2/2] i2c: mediatek: add support for MT6878 SoC Igor Belwon
  2025-09-20 17:10 ` [PATCH 0/2] i2c: Add support for MT6878 I2C controllers Igor Belwon
  2 siblings, 1 reply; 6+ messages in thread
From: Igor Belwon @ 2025-09-20 15:31 UTC (permalink / raw)
  To: Qii Wang, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: ~postmarketos/upstreaming, linux-i2c, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, Igor Belwon

Document the I2C controllers found in the MediaTek MT6878 SoC, by adding
a new compatible string for the controllers.

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
---
 Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml
index 23fe8ff76645e440c19469999ae9a86b7fdabe68..b0d7dd0dd8fdd7b0dba14d11f75c8f0b7ac15f58 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml
+++ b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml
@@ -22,6 +22,7 @@ properties:
       - const: mediatek,mt2712-i2c
       - const: mediatek,mt6577-i2c
       - const: mediatek,mt6589-i2c
+      - const: mediatek,mt6878-i2c
       - const: mediatek,mt7622-i2c
       - const: mediatek,mt7981-i2c
       - const: mediatek,mt7986-i2c

-- 
2.51.0


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

* [PATCH 2/2] i2c: mediatek: add support for MT6878 SoC
  2025-09-20 15:31 [PATCH 0/2] i2c: Add support for MT6878 I2C controllers Igor Belwon
  2025-09-20 15:31 ` [PATCH 1/2] dt-bindings: i2c: i2c-mt65xx: Document MediaTek MT6878 I2C Igor Belwon
@ 2025-09-20 15:31 ` Igor Belwon
  2025-09-22  7:54   ` AngeloGioacchino Del Regno
  2025-09-20 17:10 ` [PATCH 0/2] i2c: Add support for MT6878 I2C controllers Igor Belwon
  2 siblings, 1 reply; 6+ messages in thread
From: Igor Belwon @ 2025-09-20 15:31 UTC (permalink / raw)
  To: Qii Wang, Andi Shyti, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: ~postmarketos/upstreaming, linux-i2c, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek, Igor Belwon

Add support for the I2C units found in the MediaTek MT6878 SoC.
Just like other recent MediaTek SoCs, it uses the v3 register offsets
(which differ from v2 only by OFFSET_SLAVE_ADDR being
0x94 instead of 0x4).

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
---
 drivers/i2c/busses/i2c-mt65xx.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
index ab456c3717db18eef74226de0ee88c49228796f5..085702aee006a6dd0ac89d1382a12fbac2d91c55 100644
--- a/drivers/i2c/busses/i2c-mt65xx.c
+++ b/drivers/i2c/busses/i2c-mt65xx.c
@@ -402,6 +402,19 @@ static const struct mtk_i2c_compatible mt6589_compat = {
 	.max_dma_support = 32,
 };
 
+static const struct mtk_i2c_compatible mt6878_compat = {
+	.regs = mt_i2c_regs_v3,
+	.pmic_i2c = 0,
+	.dcm = 0,
+	.auto_restart = 1,
+	.aux_len_reg = 1,
+	.timing_adjust = 1,
+	.dma_sync = 0,
+	.ltiming_adjust = 1,
+	.apdma_sync = 1,
+	.max_dma_support = 36,
+};
+
 static const struct mtk_i2c_compatible mt7622_compat = {
 	.quirks = &mt7622_i2c_quirks,
 	.regs = mt_i2c_regs_v1,
@@ -525,6 +538,7 @@ static const struct of_device_id mtk_i2c_of_match[] = {
 	{ .compatible = "mediatek,mt2712-i2c", .data = &mt2712_compat },
 	{ .compatible = "mediatek,mt6577-i2c", .data = &mt6577_compat },
 	{ .compatible = "mediatek,mt6589-i2c", .data = &mt6589_compat },
+	{ .compatible = "mediatek,mt6878-i2c", .data = &mt6878_compat },
 	{ .compatible = "mediatek,mt7622-i2c", .data = &mt7622_compat },
 	{ .compatible = "mediatek,mt7981-i2c", .data = &mt7981_compat },
 	{ .compatible = "mediatek,mt7986-i2c", .data = &mt7986_compat },

-- 
2.51.0


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

* Re: [PATCH 0/2] i2c: Add support for MT6878 I2C controllers
  2025-09-20 15:31 [PATCH 0/2] i2c: Add support for MT6878 I2C controllers Igor Belwon
  2025-09-20 15:31 ` [PATCH 1/2] dt-bindings: i2c: i2c-mt65xx: Document MediaTek MT6878 I2C Igor Belwon
  2025-09-20 15:31 ` [PATCH 2/2] i2c: mediatek: add support for MT6878 SoC Igor Belwon
@ 2025-09-20 17:10 ` Igor Belwon
  2 siblings, 0 replies; 6+ messages in thread
From: Igor Belwon @ 2025-09-20 17:10 UTC (permalink / raw)
  To: Igor Belwon, Qii Wang, Andi Shyti, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger,
	AngeloGioacchino Del Regno
  Cc: ~postmarketos/upstreaming, linux-i2c, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek

On Sat Sep 20, 2025 at 5:31 PM CEST, Igor Belwon wrote:
> Hi all,
>
> This patchest adds support for the i2c units found in the MediaTek 
> MT6878 SoC. These units use the new v3 register offset scheme 
> (differing only in OFFSET_SLAVE_ADDR).
>
> Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
> ---

Hi,

Please DROP this patchset from the queue.

This patchset can be simplified into one commit (only bindings changes),
as the compatible data is 1:1 from mt8188.

Sincere apologies,
Igor

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

* Re: [PATCH 2/2] i2c: mediatek: add support for MT6878 SoC
  2025-09-20 15:31 ` [PATCH 2/2] i2c: mediatek: add support for MT6878 SoC Igor Belwon
@ 2025-09-22  7:54   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 6+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-09-22  7:54 UTC (permalink / raw)
  To: Igor Belwon, Qii Wang, Andi Shyti, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger
  Cc: ~postmarketos/upstreaming, linux-i2c, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek

Il 20/09/25 17:31, Igor Belwon ha scritto:
> Add support for the I2C units found in the MediaTek MT6878 SoC.
> Just like other recent MediaTek SoCs, it uses the v3 register offsets
> (which differ from v2 only by OFFSET_SLAVE_ADDR being
> 0x94 instead of 0x4).
> 

That's exactly the same as mt8188_compat, so you don't need to add new
platform data for this SoC.

This means that this patch is not needed.

Cheers,
Angelo

> Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
> ---
>   drivers/i2c/busses/i2c-mt65xx.c | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
> index ab456c3717db18eef74226de0ee88c49228796f5..085702aee006a6dd0ac89d1382a12fbac2d91c55 100644
> --- a/drivers/i2c/busses/i2c-mt65xx.c
> +++ b/drivers/i2c/busses/i2c-mt65xx.c
> @@ -402,6 +402,19 @@ static const struct mtk_i2c_compatible mt6589_compat = {
>   	.max_dma_support = 32,
>   };
>   
> +static const struct mtk_i2c_compatible mt6878_compat = {
> +	.regs = mt_i2c_regs_v3,
> +	.pmic_i2c = 0,
> +	.dcm = 0,
> +	.auto_restart = 1,
> +	.aux_len_reg = 1,
> +	.timing_adjust = 1,
> +	.dma_sync = 0,
> +	.ltiming_adjust = 1,
> +	.apdma_sync = 1,
> +	.max_dma_support = 36,
> +};
> +
>   static const struct mtk_i2c_compatible mt7622_compat = {
>   	.quirks = &mt7622_i2c_quirks,
>   	.regs = mt_i2c_regs_v1,
> @@ -525,6 +538,7 @@ static const struct of_device_id mtk_i2c_of_match[] = {
>   	{ .compatible = "mediatek,mt2712-i2c", .data = &mt2712_compat },
>   	{ .compatible = "mediatek,mt6577-i2c", .data = &mt6577_compat },
>   	{ .compatible = "mediatek,mt6589-i2c", .data = &mt6589_compat },
> +	{ .compatible = "mediatek,mt6878-i2c", .data = &mt6878_compat },
>   	{ .compatible = "mediatek,mt7622-i2c", .data = &mt7622_compat },
>   	{ .compatible = "mediatek,mt7981-i2c", .data = &mt7981_compat },
>   	{ .compatible = "mediatek,mt7986-i2c", .data = &mt7986_compat },
> 


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

* Re: [PATCH 1/2] dt-bindings: i2c: i2c-mt65xx: Document MediaTek MT6878 I2C
  2025-09-20 15:31 ` [PATCH 1/2] dt-bindings: i2c: i2c-mt65xx: Document MediaTek MT6878 I2C Igor Belwon
@ 2025-09-22  7:55   ` AngeloGioacchino Del Regno
  0 siblings, 0 replies; 6+ messages in thread
From: AngeloGioacchino Del Regno @ 2025-09-22  7:55 UTC (permalink / raw)
  To: Igor Belwon, Qii Wang, Andi Shyti, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Matthias Brugger
  Cc: ~postmarketos/upstreaming, linux-i2c, devicetree, linux-kernel,
	linux-arm-kernel, linux-mediatek

Il 20/09/25 17:31, Igor Belwon ha scritto:
> Document the I2C controllers found in the MediaTek MT6878 SoC, by adding
> a new compatible string for the controllers.
> 

Sorry but this is not right :-)

compatible = "mediatek,mt6878-i2c", "mediatek,mt8188-i2c"

That's what you need.

Cheers,
Angelo

> Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
> ---
>   Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml
> index 23fe8ff76645e440c19469999ae9a86b7fdabe68..b0d7dd0dd8fdd7b0dba14d11f75c8f0b7ac15f58 100644
> --- a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml
> +++ b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml
> @@ -22,6 +22,7 @@ properties:
>         - const: mediatek,mt2712-i2c
>         - const: mediatek,mt6577-i2c
>         - const: mediatek,mt6589-i2c
> +      - const: mediatek,mt6878-i2c
>         - const: mediatek,mt7622-i2c
>         - const: mediatek,mt7981-i2c
>         - const: mediatek,mt7986-i2c
> 



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

end of thread, other threads:[~2025-09-22  7:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-20 15:31 [PATCH 0/2] i2c: Add support for MT6878 I2C controllers Igor Belwon
2025-09-20 15:31 ` [PATCH 1/2] dt-bindings: i2c: i2c-mt65xx: Document MediaTek MT6878 I2C Igor Belwon
2025-09-22  7:55   ` AngeloGioacchino Del Regno
2025-09-20 15:31 ` [PATCH 2/2] i2c: mediatek: add support for MT6878 SoC Igor Belwon
2025-09-22  7:54   ` AngeloGioacchino Del Regno
2025-09-20 17:10 ` [PATCH 0/2] i2c: Add support for MT6878 I2C controllers Igor Belwon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).