Cc: Trilok Soni <soni.trilok@...>, <i2c@...>, Jean Delvare <khali@...>, Tony Lindgren <tony@...>, <drzeus-mmc@...>, <linux-kernel@...>, <amit.kucheria@...>
Two 8-bit registers for IRQ status, so total of 16 potential handlers.
Of course, I think several of those bits aren't actually used.
How could it do that?
Right. ISTR that the "sync" version waits for any active
IRQ handler to complete. That is, it's specified to cause
a self-deadlock in this call context (wait for self) ...
Evidently the "we cannot use I2C in interrupt context" comment was
excessively subtle. ;)
The whole I2C stack is synchronous; *EVERY* request to perform I/O
requires a can-sleep task context. It's not like USB or SPI, where
the IRQ handler can submit I/O requests which will complete later.
Which is why every I2C driver that needs to handle an IRQ will need
to arrange some task context ... ergo the workqueue. It's something
far more common in embedded systems than in the original "sensors"
context from which the I2C stack evolved.
It's just paranoia. If it ever *did* happen there would be
extreme confusion; it's easy to prevent, and useful to be
very explicit about this rule.
-