Skip to content

Commit

Permalink
Merge tag 'i2c-for-6.13-rc3' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/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
  • Loading branch information
Linus Torvalds committed Dec 15, 2024
2 parents dccbe20 + 5b6b08a commit 151167d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions drivers/i2c/busses/i2c-nomadik.c
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,7 @@ static const struct of_device_id nmk_i2c_eyeq_match_table[] = {
.compatible = "mobileye,eyeq6h-i2c",
.data = (void *)NMK_I2C_EYEQ_FLAG_32B_BUS,
},
{ /* sentinel */ }
};

static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id)
Expand Down
4 changes: 2 additions & 2 deletions drivers/i2c/busses/i2c-pnx.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ enum {

static inline int wait_timeout(struct i2c_pnx_algo_data *data)
{
long timeout = data->timeout;
long timeout = jiffies_to_msecs(data->timeout);
while (timeout > 0 &&
(ioread32(I2C_REG_STS(data)) & mstatus_active)) {
mdelay(1);
Expand All @@ -106,7 +106,7 @@ static inline int wait_timeout(struct i2c_pnx_algo_data *data)

static inline int wait_reset(struct i2c_pnx_algo_data *data)
{
long timeout = data->timeout;
long timeout = jiffies_to_msecs(data->timeout);
while (timeout > 0 &&
(ioread32(I2C_REG_CTL(data)) & mcntrl_reset)) {
mdelay(1);
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-riic.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static int riic_init_hw(struct riic_dev *riic)
if (brl <= (0x1F + 3))
break;

total_ticks /= 2;
total_ticks = DIV_ROUND_UP(total_ticks, 2);
rate /= 2;
}

Expand Down

0 comments on commit 151167d

Please sign in to comment.