On 28/09/2022 22:34, Jason Thorpe wrote:
On Sep 28, 2022, at 1:24 PM, Vincent DEFERT <vincent.defert%posteo.net@localhost> wrote: Hi, I'm working on an I2C driver for the ODROID C2 and I wonder how I should do to detect the end of a transaction. Ideally, once the transaction is started, I'd like to wait in my exec() function for a "signal" raised by the interrupt handler, so as to avoid a busy wait. Is this the correct approach? Which API should I use?I’m most familiar with the RPI’s i2c driver: sys/arch/arm/broadcom/bcm2835_bsc.c While the overall state machine structure might not suit your driver, how to use the condition variable APIs can be seen in bsciic_exec() and bsciic_signal(). -- thorpej