public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: davinci: use I2C_MAX_STANDARD_MODE_FREQ when no clock-frequency is set
@ 2025-09-13  6:25 Marcus Folkesson
  0 siblings, 0 replies; only message in thread
From: Marcus Folkesson @ 2025-09-13  6:25 UTC (permalink / raw)
  To: Bartosz Golaszewski, Andi Shyti
  Cc: linux-arm-kernel, linux-i2c, linux-kernel, Marcus Folkesson

Go for I2C_MAX_STANDARD_MODE_FREQ instead of a custom variant if no
clock-frequency property is set.

Besides, the calculation to kHz does not work for
DAVINCI_I2C_DEFAULT_BUS_FREQ as it is already specified in kHz.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
 drivers/i2c/busses/i2c-davinci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c
index 6a3d4e9e07f45ecc228943e877cde1fd9d72e8cb..c6d81efdb9e4dabeb5ac40e9fd9f1a2189619e71 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -117,8 +117,6 @@
 /* timeout for pm runtime autosuspend */
 #define DAVINCI_I2C_PM_TIMEOUT	1000	/* ms */
 
-#define DAVINCI_I2C_DEFAULT_BUS_FREQ	100
-
 struct davinci_i2c_dev {
 	struct device           *dev;
 	void __iomem		*base;
@@ -761,7 +759,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
 
 	r = device_property_read_u32(&pdev->dev, "clock-frequency", &prop);
 	if (r)
-		prop = DAVINCI_I2C_DEFAULT_BUS_FREQ;
+		prop = I2C_MAX_STANDARD_MODE_FREQ;
 
 	dev->bus_freq = prop / 1000;
 

---
base-commit: 22f20375f5b71f30c0d6896583b93b6e4bba7279
change-id: 20250913-davinci-i2c-ddcca6ac7c19

Best regards,
-- 
Marcus Folkesson <marcus.folkesson@gmail.com>


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-09-13  6:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-13  6:25 [PATCH] i2c: davinci: use I2C_MAX_STANDARD_MODE_FREQ when no clock-frequency is set Marcus Folkesson

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