Skip to content

Commit 151167d

Browse files
committed
Merge tag 'i2c-for-6.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang: "i2c host fixes: PNX used the wrong unit for timeouts, Nomadik was missing a sentinel, and RIIC was missing rounding up" * tag 'i2c-for-6.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: i2c: riic: Always round-up when calculating bus period i2c: nomadik: Add missing sentinel to match table i2c: pnx: Fix timeout in wait functions
2 parents dccbe20 + 5b6b08a commit 151167d

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

drivers/i2c/busses/i2c-nomadik.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,7 @@ static const struct of_device_id nmk_i2c_eyeq_match_table[] = {
10751075
.compatible = "mobileye,eyeq6h-i2c",
10761076
.data = (void *)NMK_I2C_EYEQ_FLAG_32B_BUS,
10771077
},
1078+
{ /* sentinel */ }
10781079
};
10791080

10801081
static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)

drivers/i2c/busses/i2c-pnx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ enum {
9595

9696
static inline int wait_timeout(struct i2c_pnx_algo_data *data)
9797
{
98-
long timeout = data->timeout;
98+
long timeout = jiffies_to_msecs(data->timeout);
9999
while (timeout > 0 &&
100100
(ioread32(I2C_REG_STS(data)) & mstatus_active)) {
101101
mdelay(1);
@@ -106,7 +106,7 @@ static inline int wait_timeout(struct i2c_pnx_algo_data *data)
106106

107107
static inline int wait_reset(struct i2c_pnx_algo_data *data)
108108
{
109-
long timeout = data->timeout;
109+
long timeout = jiffies_to_msecs(data->timeout);
110110
while (timeout > 0 &&
111111
(ioread32(I2C_REG_CTL(data)) & mcntrl_reset)) {
112112
mdelay(1);

drivers/i2c/busses/i2c-riic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ static int riic_init_hw(struct riic_dev *riic)
352352
if (brl <= (0x1F + 3))
353353
break;
354354

355-
total_ticks /= 2;
355+
total_ticks = DIV_ROUND_UP(total_ticks, 2);
356356
rate /= 2;
357357
}
358358

0 commit comments

Comments
 (0)