From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A0B6738B14F; Mon, 8 Jun 2026 20:15:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780949759; cv=none; b=koI2V8rhvzV2hSXlZC39qSQTpifZAyXrhSY78sM5d3urTdNrKcm5HOtCYs5yRLFiqnFHcancqDJCoPzO+ahWaYpYm0mn12z5FTND7muX0DkB1nE6OrxrZWBUf+XDFtcq6Q09sCAqMHaVUqECbEikJjVMZ3dmzHv7ksDPz0fuRiE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780949759; c=relaxed/simple; bh=oKYb6LCUppaqwNQQ+wOXdh4JlFYSE9N2QGGOLYjruJg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=agkpnAiMX669KrpS5pmYxC/x+T5N9R6z0aPTUxT4Q0p68ZWgSXgkjdQCbNmWnu8kOZkT491FBk0lmyoM5ZP/9kRu6CWwzzYiyInnFZTKcsWZGoF5W/PjcccVzYbEmop9AW5eFgMtP7FUHkbN2hwHLfUNZRRo1z+I+lfZfOZrq74= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gXIYcO5D; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gXIYcO5D" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E0CB61F00893; Mon, 8 Jun 2026 20:15:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780949758; bh=mh56t27ra29Va8lAVpeTTbD/G1/Tzq5CpT5YVX3cqTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gXIYcO5DFSANpmU98Tq2eI0pXH6HN02F3ijYTgkcYgpzFYE3apDUDGHlbHKNECEwz HWhraPrVI4AGFm3tUITZKa8V5C51u5OoCZUPYC6Z6izhZfqfmAQyyMIHD3ZiRxlkRj 6DYQpNvQlK8UegnS2tgOEaEeWiTRa8UFt1dOSzsdSsT1ISUOjHIydKp+sEXo4OyVHo IUh8rfdmFFwY34xC1GJ4y26KnegQ9QfUBsEzJpt+hX7mlmq4Rh6DIAvTH26nKdkjfr zCq5oKEcVLRQrNRskBDB1vXZcK1+3EybYcoInuaQE8fdUjTR35MwIAwiQYTeMdzSx4 niL6tOiKpcMug== From: Claudiu Beznea To: wsa+renesas@sang-engineering.com, tommaso.merciai.xr@bp.renesas.com, alexandre.belloni@bootlin.com, Frank.Li@nxp.com, p.zabel@pengutronix.de Cc: claudiu.beznea@kernel.org, claudiu.beznea@tuxon.dev, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Claudiu Beznea , stable@vger.kernel.org Subject: [PATCH v3 02/17] i3c: renesas: Restore STDBR and EXTBR registers on resume Date: Mon, 8 Jun 2026 23:15:28 +0300 Message-ID: <20260608201543.804902-3-claudiu.beznea@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260608201543.804902-1-claudiu.beznea@kernel.org> References: <20260608201543.804902-1-claudiu.beznea@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Claudiu Beznea The Renesas RZ/G3S supports a power saving state where power to the most SoC componentes (including I3C) is lost. The STDBR and EXTBR are configured in initialization phase though the struct i3c_master_controller_ops::bus_init. Set them on resume function as well to keep the same state of the controller after a suspend with power loss and a similar initialization sequence as in bus_init. Fixes: e7218986319b ("i3c: renesas: Add suspend/resume support") Cc: stable@vger.kernel.org Reviewed-by: Frank Li Signed-off-by: Claudiu Beznea --- Changes in v3: - none Changes in v2: - collected tags drivers/i3c/master/renesas-i3c.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/i3c/master/renesas-i3c.c b/drivers/i3c/master/renesas-i3c.c index 6e7ece2e0b4e..88a16efe096d 100644 --- a/drivers/i3c/master/renesas-i3c.c +++ b/drivers/i3c/master/renesas-i3c.c @@ -260,6 +260,7 @@ struct renesas_i3c { u32 dyn_addr; u32 i2c_STDBR; u32 i3c_STDBR; + u32 extbr; unsigned long rate; u8 addrs[RENESAS_I3C_MAX_DEVS]; struct renesas_i3c_xferqueue xferqueue; @@ -607,10 +608,9 @@ static int renesas_i3c_bus_init(struct i3c_master_controller *m) renesas_writel(i3c->regs, STDBR, i3c->i3c_STDBR); /* Extended Bit Rate setting */ - renesas_writel(i3c->regs, EXTBR, EXTBR_EBRLO(od_low_ticks) | - EXTBR_EBRHO(od_high_ticks) | - EXTBR_EBRLP(pp_low_ticks) | - EXTBR_EBRHP(pp_high_ticks)); + i3c->extbr = EXTBR_EBRLO(od_low_ticks) | EXTBR_EBRHO(od_high_ticks) | + EXTBR_EBRLP(pp_low_ticks) | EXTBR_EBRHP(pp_high_ticks); + renesas_writel(i3c->regs, EXTBR, i3c->extbr); renesas_writel(i3c->regs, REFCKCTL, REFCKCTL_IREFCKS(cks)); i3c->refclk_div = cks; @@ -1468,6 +1468,8 @@ static int renesas_i3c_resume_noirq(struct device *dev) goto err_tresetn; /* Re-store I3C registers value. */ + renesas_writel(i3c->regs, STDBR, i3c->i3c_STDBR); + renesas_writel(i3c->regs, EXTBR, i3c->extbr); renesas_writel(i3c->regs, REFCKCTL, REFCKCTL_IREFCKS(i3c->refclk_div)); renesas_writel(i3c->regs, MSDVAD, MSDVAD_MDYADV | -- 2.43.0