linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Lysov <arzamas-16@mail.ee>
To: linux-i2c@vger.kernel.org, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org
Cc: qii.wang@mediatek.com
Subject: [PATCH 2/2] i2c: mediatek: remove mt6577 support
Date: Thu, 20 Jan 2022 21:58:53 +0300	[thread overview]
Message-ID: <20220120185853.24266-3-arzamas-16@mail.ee> (raw)
In-Reply-To: <20220120185853.24266-1-arzamas-16@mail.ee>

The mt6577 compatibility was introduced back in 2014 in commit 8452c80d5b4b
("I2C: mediatek: Add driver for MediaTek I2C controller") by Xudong Chen.

The i2c-mt65xx driver relies on DMA since it was first introduced. mt6577 does
not support DMA [1] for I2C and doesn't have dedicated DMA engines for I2C.
Moreover, the entire mt65xx Cortex-A9 SoC family (mt6515, mt6517, mt6575,
and mt6577) which share the same I2C IP doesn't support I2C DMA at all which
makes this particular driver incompatible with these SoCs.

The existing code used mt6577 as a "generic" configuration to be used with
other SoCs such as mt6589 (for quirks), and mt2701/mt6797/mt7623 (in general).

This patch makes mt2701 (which is *actually* supported by this driver) a new
placeholder for generic Mediatek I2C bus configuration.

[1] see references in
https://lists.infradead.org/pipermail/linux-mediatek/2021-October/030333.html

Signed-off-by: Boris Lysov <arzamas-16@mail.ee>
---
 drivers/i2c/busses/i2c-mt65xx.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/i2c/busses/i2c-mt65xx.c b/drivers/i2c/busses/i2c-mt65xx.c
index 9ea427f53083..24c94e58dc08 100644
--- a/drivers/i2c/busses/i2c-mt65xx.c
+++ b/drivers/i2c/busses/i2c-mt65xx.c
@@ -298,7 +298,7 @@ static const struct i2c_spec_values fast_mode_plus_spec = {
 	.min_su_dat_ns = 50 + I2C_FAST_MODE_PLUS_BUFFER,
 };
 
-static const struct i2c_adapter_quirks mt6577_i2c_quirks = {
+static const struct i2c_adapter_quirks mt2701_i2c_quirks = {
 	.flags = I2C_AQ_COMB_WRITE_THEN_READ,
 	.max_num_msgs = 1,
 	.max_write_len = 255,
@@ -315,35 +315,35 @@ static const struct i2c_adapter_quirks mt8183_i2c_quirks = {
 	.flags = I2C_AQ_NO_ZERO_LEN,
 };
 
-static const struct mtk_i2c_compatible mt2712_compat = {
+static const struct mtk_i2c_compatible mt2701_compat = {
+	.quirks = &mt2701_i2c_quirks,
 	.regs = mt_i2c_regs_v1,
 	.pmic_i2c = 0,
 	.dcm = 1,
-	.auto_restart = 1,
-	.aux_len_reg = 1,
-	.timing_adjust = 1,
+	.auto_restart = 0,
+	.aux_len_reg = 0,
+	.timing_adjust = 0,
 	.dma_sync = 0,
 	.ltiming_adjust = 0,
 	.apdma_sync = 0,
-	.max_dma_support = 33,
+	.max_dma_support = 32,
 };
 
-static const struct mtk_i2c_compatible mt6577_compat = {
-	.quirks = &mt6577_i2c_quirks,
+static const struct mtk_i2c_compatible mt2712_compat = {
 	.regs = mt_i2c_regs_v1,
 	.pmic_i2c = 0,
 	.dcm = 1,
-	.auto_restart = 0,
-	.aux_len_reg = 0,
-	.timing_adjust = 0,
+	.auto_restart = 1,
+	.aux_len_reg = 1,
+	.timing_adjust = 1,
 	.dma_sync = 0,
 	.ltiming_adjust = 0,
 	.apdma_sync = 0,
-	.max_dma_support = 32,
+	.max_dma_support = 33,
 };
 
 static const struct mtk_i2c_compatible mt6589_compat = {
-	.quirks = &mt6577_i2c_quirks,
+	.quirks = &mt2701_i2c_quirks,
 	.regs = mt_i2c_regs_v1,
 	.pmic_i2c = 1,
 	.dcm = 0,
@@ -412,8 +412,8 @@ static const struct mtk_i2c_compatible mt8192_compat = {
 };
 
 static const struct of_device_id mtk_i2c_of_match[] = {
+	{ .compatible = "mediatek,mt2701-i2c", .data = &mt2701_compat },
 	{ .compatible = "mediatek,mt2712-i2c", .data = &mt2712_compat },
-	{ .compatible = "mediatek,mt6577-i2c", .data = &mt6577_compat },
 	{ .compatible = "mediatek,mt6589-i2c", .data = &mt6589_compat },
 	{ .compatible = "mediatek,mt7622-i2c", .data = &mt7622_compat },
 	{ .compatible = "mediatek,mt8173-i2c", .data = &mt8173_compat },
-- 
2.20.1


  parent reply	other threads:[~2022-01-20 18:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-20 18:58 [PATCH 0/2] i2c: mediatek: remove mt6577 support Boris Lysov
2022-01-20 18:58 ` [PATCH 1/2] dt-bindings: i2c: i2c-mt65xx: " Boris Lysov
2022-04-17  2:20   ` Wolfram Sang
2022-01-20 18:58 ` Boris Lysov [this message]
2022-04-17  2:21   ` [PATCH 2/2] i2c: mediatek: " Wolfram Sang
2022-03-01 15:19 ` [PATCH 0/2] " Wolfram Sang
2022-03-18 11:09   ` Wolfram Sang
2022-04-16 15:10     ` Boris Lysov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220120185853.24266-3-arzamas-16@mail.ee \
    --to=arzamas-16@mail.ee \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=qii.wang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).