public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: riic: Allow setting frequencies lower than 50KHz
@ 2025-09-23 14:18 Claudiu
  2025-09-23 19:14 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Claudiu @ 2025-09-23 14:18 UTC (permalink / raw)
  To: chris.brandt, andi.shyti, wsa
  Cc: claudiu.beznea, linux-renesas-soc, linux-i2c, linux-kernel,
	Claudiu Beznea

From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

The MR1.CKS field is 3 bits wide and all the possible values (from 0 to
7) are valid. This is true for all the SoCs currently integrated in
upstream Linux. Take into account CKS=7 which allows setting bus
frequencies lower than 50KHz. This may be useful at least for debugging.

Fixes: d982d6651419 ("i2c: riic: remove clock and frequency restrictions")
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
---
 drivers/i2c/busses/i2c-riic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-riic.c b/drivers/i2c/busses/i2c-riic.c
index 9c164a4b9bb9..b0ee9ac45a97 100644
--- a/drivers/i2c/busses/i2c-riic.c
+++ b/drivers/i2c/busses/i2c-riic.c
@@ -386,7 +386,7 @@ static int riic_init_hw(struct riic_dev *riic)
 	 */
 	total_ticks = DIV_ROUND_UP(rate, t->bus_freq_hz ?: 1);
 
-	for (cks = 0; cks < 7; cks++) {
+	for (cks = 0; cks <= 7; cks++) {
 		/*
 		 * 60% low time must be less than BRL + 2 + 1
 		 * BRL max register value is 0x1F.
-- 
2.43.0


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

* Re: [PATCH] i2c: riic: Allow setting frequencies lower than 50KHz
  2025-09-23 14:18 [PATCH] i2c: riic: Allow setting frequencies lower than 50KHz Claudiu
@ 2025-09-23 19:14 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2025-09-23 19:14 UTC (permalink / raw)
  To: Claudiu
  Cc: chris.brandt, andi.shyti, wsa, linux-renesas-soc, linux-i2c,
	linux-kernel, Claudiu Beznea

[-- Attachment #1: Type: text/plain, Size: 598 bytes --]

On Tue, Sep 23, 2025 at 05:18:26PM +0300, Claudiu wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
> 
> The MR1.CKS field is 3 bits wide and all the possible values (from 0 to
> 7) are valid. This is true for all the SoCs currently integrated in
> upstream Linux. Take into account CKS=7 which allows setting bus
> frequencies lower than 50KHz. This may be useful at least for debugging.
> 
> Fixes: d982d6651419 ("i2c: riic: remove clock and frequency restrictions")
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

Applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2025-09-23 19:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-23 14:18 [PATCH] i2c: riic: Allow setting frequencies lower than 50KHz Claudiu
2025-09-23 19:14 ` Wolfram Sang

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