OSDN Git Service

iio: light: opt3001: enable operation w/o IRQ
authorAlexander Koch <mail@alexanderkoch.net>
Sat, 16 Jan 2016 16:14:38 +0000 (17:14 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sat, 30 Jan 2016 16:26:47 +0000 (16:26 +0000)
commitac663db3678a62f69a2a73126e51a9a302b27ff2
treea2ac193d50fda7f870af9d1683fcaa4f71f2f099
parent84e8d090c57522c5f8ae59f5b922bedb929165c7
iio: light: opt3001: enable operation w/o IRQ

Enable operation of the TI OPT3001 light sensor without having an
interrupt line available to connect the INT pin to.

In this operation mode, we issue a conversion request and simply wait
for the conversion time available as timeout value, determined from
integration time configuration and the worst-case time given in the data
sheet (sect. 6.5, table on p. 5):

  short integration time (100ms): 110ms + 3ms = 113ms
   long integration time (800ms): 880ms + 3ms = 883ms

This change is transparent as behaviour defaults to using the interrupt
method if an interrupt no. is configured via device tree. Interrupt-less
operation mode is performed when no valid interrupt no. is given.

Signed-off-by: Alexander Koch <mail@alexanderkoch.net>
Signed-off-by: Michael Hornung <mhornung.linux@gmail.com>
Tested-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/opt3001.c