summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Shyti <andi.shyti@kernel.org>2026-07-27 22:56:59 +0200
committerAndi Shyti <andi.shyti@kernel.org>2026-07-27 22:56:59 +0200
commit2b55ea9ef8fceb67c0930baff4cf5475df02a67d (patch)
tree554d94ba742e7f20f0ecdfc7952112febe66b97b
parentfd4495dd2d0d4b2dab7d821e77fa1282a026894d (diff)
parentd99607c888f26e8a4e9fe9772860cef4aff86bb4 (diff)
downloadlinux-next-2b55ea9ef8fceb67c0930baff4cf5475df02a67d.tar.gz
linux-next-2b55ea9ef8fceb67c0930baff4cf5475df02a67d.zip
Merge branch 'i2c/i2c-fixes' into i2c/i2c-next
-rw-r--r--drivers/i2c/busses/i2c-jz4780.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-jz4780.c b/drivers/i2c/busses/i2c-jz4780.c
index 664a5471d933..695be3b21460 100644
--- a/drivers/i2c/busses/i2c-jz4780.c
+++ b/drivers/i2c/busses/i2c-jz4780.c
@@ -141,6 +141,7 @@ struct jz4780_i2c {
void __iomem *iomem;
int irq;
struct clk *clk;
+ unsigned long clk_rate_khz;
struct i2c_adapter adap;
const struct ingenic_i2c_config *cdata;
@@ -246,7 +247,7 @@ static int jz4780_i2c_set_target(struct jz4780_i2c *i2c, unsigned char address)
static int jz4780_i2c_set_speed(struct jz4780_i2c *i2c)
{
- int dev_clk_khz = clk_get_rate(i2c->clk) / 1000;
+ int dev_clk_khz = i2c->clk_rate_khz;
int cnt_high = 0; /* HIGH period count of the SCL clock */
int cnt_low = 0; /* LOW period count of the SCL clock */
int cnt_period = 0; /* period count of the SCL clock */
@@ -796,6 +797,8 @@ static int jz4780_i2c_probe(struct platform_device *pdev)
if (IS_ERR(i2c->clk))
return PTR_ERR(i2c->clk);
+ i2c->clk_rate_khz = clk_get_rate(i2c->clk) / 1000;
+
ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency",
&clk_freq);
if (ret) {