mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Crispin <john@phrozen.org>
To: Stephen Boyd <sboyd@kernel.org>,
	Brian Masney <bmasney+clk@redhat.com>,
	Jerome Brunet <jbrunet+clk@baylibre.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>
Cc: Christian Marangi <ansuelsmth@gmail.com>,
	lei.dong@airoha.com, Linqi.zhang@airoha.com,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org,
	Lorenzo Bianconi <lorenzo@kernel.org>,
	Rajeev.kumar@airoha.com, upstream@airoha.com,
	Weifeng.xu@airoha.com, zhengping.zhang@airoha.com
Subject: [PATCH 2/2] clk: en7523: add a reset operation
Date: Wed, 11 Nov 2026 09:56:50 +0100	[thread overview]
Message-ID: <20261111085650.632025-3-john@phrozen.org> (raw)
In-Reply-To: <20261111085650.632025-1-john@phrozen.org>

The reset controller implements assert, deassert and status but not
reset, so device_reset() fails with -ENOTSUPP. The i2c-mt7621 driver
calls it at probe and after a transfer timeout. Every I2C bus that
references an SCU reset, as on the EN7581 and the AN7589, therefore
logs "I2C reset failed!" and is never reset.

Add a reset operation that asserts and then deasserts the line, as the
MT7621 reset controller does for the same I2C block.

Signed-off-by: John Crispin <john@phrozen.org>
---
 drivers/clk/clk-en7523.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/clk/clk-en7523.c b/drivers/clk/clk-en7523.c
index 8f63482cbb7b..eb893259d470 100644
--- a/drivers/clk/clk-en7523.c
+++ b/drivers/clk/clk-en7523.c
@@ -818,6 +818,18 @@ static int en7523_reset_deassert(struct reset_controller_dev *rcdev,
 	return en7523_reset_update(rcdev, id, false);
 }
 
+static int en7523_reset_reset(struct reset_controller_dev *rcdev,
+			      unsigned long id)
+{
+	int ret;
+
+	ret = en7523_reset_assert(rcdev, id);
+	if (ret)
+		return ret;
+
+	return en7523_reset_deassert(rcdev, id);
+}
+
 static int en7523_reset_status(struct reset_controller_dev *rcdev,
 			       unsigned long id)
 {
@@ -847,6 +859,7 @@ static int en7523_reset_xlate(struct reset_controller_dev *rcdev,
 }
 
 static const struct reset_control_ops en7581_reset_ops = {
+	.reset = en7523_reset_reset,
 	.assert = en7523_reset_assert,
 	.deassert = en7523_reset_deassert,
 	.status = en7523_reset_status,
-- 
2.34.1


      parent reply	other threads:[~2026-11-11  8:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11  8:56 [PATCH 0/2] clk: en7523: two fixes for the EN7581 clock and reset driver John Crispin
2026-11-11  8:56 ` [PATCH 1/2] clk: en7523: do not sleep in the EN7581 PCIe clock disable John Crispin
2026-11-11  8:56 ` John Crispin [this message]

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=20261111085650.632025-3-john@phrozen.org \
    --to=john@phrozen.org \
    --cc=Linqi.zhang@airoha.com \
    --cc=Rajeev.kumar@airoha.com \
    --cc=Weifeng.xu@airoha.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=ansuelsmth@gmail.com \
    --cc=bmasney+clk@redhat.com \
    --cc=jbrunet+clk@baylibre.com \
    --cc=lei.dong@airoha.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.de \
    --cc=sboyd@kernel.org \
    --cc=upstream@airoha.com \
    --cc=zhengping.zhang@airoha.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

all inboxes | Powered by JetHome®