diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-09-19 12:52:23 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-09-19 12:52:23 +0200 |
commit | 7f52bb9de57dc1851a83e20e53491ad8df321e4e (patch) | |
tree | e5258cf487d76b25cfdeed9f735417bd55ff9113 /drivers/i2c/busses/i2c-aspeed.c | |
parent | 839c4f596f898edc424070dc8b517381572f8502 (diff) | |
parent | e03ad65cea610b24c6991aebf432d5c6824cd002 (diff) |
Merge tag 'i2c-for-6.11-final-but-missed-it' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c fixes from Wolfram Sang:
"The Aspeed driver tracks the controller's state (stop, pending, start,
etc.). Previously, when the stop command was sent, the state was not
updated. The fix ensures the driver's state is aligned with the device
status.
The Intel SCH driver receives a new look, and among the cleanups,
there is a fix where, due to an oversight, an if/else statement was
missing the else, causing it to move forward instead of exiting the
function in case of an error.
The Qualcomm GENI I2C driver adds the IRQF_NO_AUTOEN flag to the IRQ
setup to prevent unwanted interrupts during probe.
The Xilinx XPS controller fixes TX FIFO handling to avoid missed NAKs.
Another fix ensures the controller is reinitialized when the bus
appears busy"
* tag 'i2c-for-6.11-final-but-missed-it' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: qcom-geni: Use IRQF_NO_AUTOEN flag in request_irq()
i2c: isch: Add missed 'else'
i2c: xiic: Try re-initialization on bus busy timeout
i2c: xiic: Wait for TX empty to avoid missed TX NAKs
i2c: aspeed: Update the stop sw state when the bus recovery occurs
Diffstat (limited to 'drivers/i2c/busses/i2c-aspeed.c')
-rw-r--r-- | drivers/i2c/busses/i2c-aspeed.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c index ce8c4846b7fa..2a03a221e2dd 100644 --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c @@ -170,6 +170,13 @@ struct aspeed_i2c_bus { static int aspeed_i2c_reset(struct aspeed_i2c_bus *bus); +/* precondition: bus.lock has been acquired. */ +static void aspeed_i2c_do_stop(struct aspeed_i2c_bus *bus) +{ + bus->master_state = ASPEED_I2C_MASTER_STOP; + writel(ASPEED_I2CD_M_STOP_CMD, bus->base + ASPEED_I2C_CMD_REG); +} + static int aspeed_i2c_recover_bus(struct aspeed_i2c_bus *bus) { unsigned long time_left, flags; @@ -187,7 +194,7 @@ static int aspeed_i2c_recover_bus(struct aspeed_i2c_bus *bus) command); reinit_completion(&bus->cmd_complete); - writel(ASPEED_I2CD_M_STOP_CMD, bus->base + ASPEED_I2C_CMD_REG); + aspeed_i2c_do_stop(bus); spin_unlock_irqrestore(&bus->lock, flags); time_left = wait_for_completion_timeout( @@ -391,13 +398,6 @@ static void aspeed_i2c_do_start(struct aspeed_i2c_bus *bus) } /* precondition: bus.lock has been acquired. */ -static void aspeed_i2c_do_stop(struct aspeed_i2c_bus *bus) -{ - bus->master_state = ASPEED_I2C_MASTER_STOP; - writel(ASPEED_I2CD_M_STOP_CMD, bus->base + ASPEED_I2C_CMD_REG); -} - -/* precondition: bus.lock has been acquired. */ static void aspeed_i2c_next_msg_or_stop(struct aspeed_i2c_bus *bus) { if (bus->msgs_index + 1 < bus->msgs_count) { |