Re: [PATCH v7 3/3] i2c: aspeed: Assert NAK when slave is busy

From
Wolfram Sang <wsa@kernel.org>
Date
2022-06-16 12:30:12
Also in
linux-arm-kernel, linux-aspeed, linux-i2c, lkml, openbmc
Reply to
Quan Nguyen, 2022-06-16
Hi Quan,
On the first occurrence of I2C_SLAVE_WRITE_REQUESTED, the address is already
received with ACK. So if slave return -EBUSY, the NAK will occur on the next
Rx byte (on I2C_SLAVE_WRITE_RECEIVED event).
This is exactly why I2C_SLAVE_WRITE_RECEIVED allows for an error code.
From the docs:

===

* I2C_SLAVE_WRITE_RECEIVED (mandatory)

  'val': bus driver delivers received byte

  'ret': 0 if the byte should be acked, some errno if the byte should be nacked

Another I2C master has sent a byte to us which needs to be set in 'val'. If 'ret'
is zero, the bus driver should ack this byte. If 'ret' is an errno, then the byte
should be nacked.

===

'ret' is used to ACK/NACK the current byte in 'val'. That's exactly what
you need, or? Does the aspeed driver not support acking the current
byte?

Attachments

Thread (24 messages) 24 messages, 5 authors, last reply 2022-07-05
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help