Thread (1 message) 1 message, 1 author, 2015-07-23

Re: [PATCH v3 2/2] iio: light: add APDS9960 ALS + promixity driver

From: Jonathan Cameron <hidden>
Date: 2015-07-23 19:53:11
Also in: linux-iio, linux-pm

<snip>
quoted
quoted
+static int apds9960_read_raw(struct iio_dev *indio_dev,
+                          struct iio_chan_spec const *chan,
+                          int *val, int *val2, long mask)
+{
+     struct apds9960_data *data = iio_priv(indio_dev);
+     u16 buf;
+     int ret = -EINVAL;
+
+     if (data->gesture_mode_running)
+             return -EBUSY;
+
+     switch (mask) {
+     case IIO_CHAN_INFO_RAW:
+             apds9960_set_power_state(data, true);
+             switch (chan->type) {
+             case IIO_PROXIMITY:
+                     if (chan->scan_index == -1) {
+                             ret = regmap_read(data->regmap,
+                                               chan->address, val);
+                             if (!ret)
+                                     ret = IIO_VAL_INT;
+                     } else {
If the channels don't have explicity channel mask entries for a polled
read then there will be no way of reading them anyway except through the
buffered interface.
What context do you mean by channel mask entries?
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW)  - or the processed variant.
quoted
quoted
+                             /*
+                              * Cannot poll the GESTURE channels which are
+                              * just usable with triggered buffers.
+                              */
+                             ret = -EBUSY;
+                     }
+                     break;
<snip>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help