Skip to contentSkip to conversation

i2c: designware: Don't warn about missing get_clk_rate_khz

PATCH Applied Heikki Krogerus 3 participants 3 messages May 13, 2025 – May 15, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: designware: Don't warn about missing get_clk_rate_khz

Converting the WARN_ON() to a dev_dbg() message in i2c_dw_clk_rate().

That removes the need to supply a dummy implementation for the callback (or alternatively a dummy clk device) when the fallback path is preferred where the existing values already in the clock registers are used - when a firmware has programmed the clock registers.

The fallback path was introduced in commit 4fec76e0985c ("i2c: designware: Fix wrong setting for {ss,fs,hs}_{h,l}cnt registers").

---
 drivers/i2c/busses/i2c-designware-common.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-common.c +3 -1
index 8eb7bd640f8d..5b1e8f74c4ac 100644
@@ -572,8 +572,10 @@ u32 i2c_dw_clk_rate(struct dw_i2c_dev *dev)
 	 * Clock is not necessary if we got LCNT/HCNT values directly from
 	 * the platform code.
 	 */
-	if (WARN_ON_ONCE(!dev->get_clk_rate_khz))
+	if (!dev->get_clk_rate_khz) {
+		dev_dbg_once(dev->dev, "Callback get_clk_rate_khz() is not defined\n");
 		return 0;
+	}
 	return dev->get_clk_rate_khz(dev);
 }
 
Signature · 1 line
2.47.2
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Heikki Krogerus

Converting the WARN_ON() to a dev_dbg() message in i2c_dw_clk_rate().

That removes the need to supply a dummy implementation for the callback (or alternatively a dummy clk device) when the fallback path is preferred where the existing values already in the clock registers are used - when a firmware has programmed the clock registers.

Quoted 9 lines

The fallback path was introduced in commit 4fec76e0985c ("i2c: designware: Fix wrong setting for {ss,fs,hs}_{h,l}cnt registers").

---
  drivers/i2c/busses/i2c-designware-common.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
maintainer Applied
#2 lore raw
In reply to Heikki Krogerus

Hi Heikki,

Quoted 9 lines · Heikki Krogerus

Converting the WARN_ON() to a dev_dbg() message in i2c_dw_clk_rate().

That removes the need to supply a dummy implementation for the callback (or alternatively a dummy clk device) when the fallback path is preferred where the existing values already in the clock registers are used - when a firmware has programmed the clock registers.

Quoted 5 lines

The fallback path was introduced in commit 4fec76e0985c ("i2c: designware: Fix wrong setting for {ss,fs,hs}_{h,l}cnt registers").

merged to i2c/i2c-host.

Thanks,
Andi