i2c: Enable interrupts for QMSI shim driver

Due to an issue with the interrupt-based transfer API from QMSI driver,
the 'transfer' callback from the shim driver (i2c_qmsi_transfer) is
implemented with polling APIs. This is not ideal because we are not able
to sleep the current thread (so another task can be scheduled in) while
the i2c operation is carried out.

The interrupt issue with the QMSI driver has been solved then this patch
fixes the shim driver so it uses the interrupt-based API and adds extra
code to handle the thread synchronization.

Finally, this patch also moves all 'struct device' related definitions
from the bottom to the top of the i2c_qmsi.c file so the DEVICE_GET
macro can be used in transfer_complete() and removes the init.h include
since it is not needed anymore.

Change-Id: I7ef7ce4cea6fcc939e310e5fe12c406645f6a16e
Signed-off-by: Andre Guedes <andre.guedes@intel.com>
This commit is contained in:
Andre Guedes 2016-01-28 15:16:53 -02:00 committed by Anas Nashif
commit dacf54de68
3 changed files with 142 additions and 35 deletions

View file

@ -152,6 +152,20 @@ config I2C_DW_1_IRQ
default 1
endif # I2C_DW
if I2C_QMSI
config I2C_QMSI_0_IRQ
default 0
config I2C_QMSI_0_INT_PRIORITY
default 2
config I2C_QMSI_1_IRQ
default 1
config I2C_QMSI_1_INT_PRIORITY
default 2
endif # I2C_QMSI
endif # I2C
if CLOCK_CONTROL