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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<snip>
>>> +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.
> 
>>> +                             /*
>>> +                              * Cannot poll the GESTURE channels which are
>>> +                              * just usable with triggered buffers.
>>> +                              */
>>> +                             ret = -EBUSY;
>>> +                     }
>>> +                     break;
<snip>

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux