All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Matt Ranostay <mranostay@gmail.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Marek Vašut" <marex@denx.de>,
	linux-pm@vger.kernel.org
Subject: Re: [PATCH v3 2/2] iio: light: add APDS9960 ALS + promixity driver
Date: Thu, 23 Jul 2015 20:53:11 +0100	[thread overview]
Message-ID: <55B14627.5040903@kernel.org> (raw)
In-Reply-To: <CAKzfze_2wchApiDHRaCWTgRWL_eep42hOdyXHnrE4Ox6UVxK5A@mail.gmail.com>

<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>


WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron <jic23-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Matt Ranostay <mranostay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: "linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Marek Vašut" <marex-ynQEQJNshbs@public.gmane.org>,
	linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v3 2/2] iio: light: add APDS9960 ALS + promixity driver
Date: Thu, 23 Jul 2015 20:53:11 +0100	[thread overview]
Message-ID: <55B14627.5040903@kernel.org> (raw)
In-Reply-To: <CAKzfze_2wchApiDHRaCWTgRWL_eep42hOdyXHnrE4Ox6UVxK5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

<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>

  reply	other threads:[~2015-07-23 19:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-13  2:20 [PATCH v3 0/2] iio: light: add support for APDS9660 sensor Matt Ranostay
2015-07-13  2:20 ` Matt Ranostay
2015-07-13  2:20 ` [PATCH v3 1/2] iio: light: DT binding docs for APDS9960 driver Matt Ranostay
2015-07-13  9:42   ` Jonathan Cameron
2015-07-13  9:42     ` Jonathan Cameron
2015-07-17  2:55     ` Matt Ranostay
2015-07-17  2:55       ` Matt Ranostay
2015-07-13  2:20 ` [PATCH v3 2/2] iio: light: add APDS9960 ALS + promixity driver Matt Ranostay
2015-07-13  2:20   ` Matt Ranostay
2015-07-19 10:45   ` Jonathan Cameron
2015-07-19 10:45     ` Jonathan Cameron
2015-07-20  0:07     ` Matt Ranostay
2015-07-20  0:07       ` Matt Ranostay
2015-07-23 19:58       ` Jonathan Cameron
2015-07-23 19:58         ` Jonathan Cameron
2015-07-20  1:56     ` Matt Ranostay
2015-07-23 19:53       ` Jonathan Cameron [this message]
2015-07-23 19:53         ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55B14627.5040903@kernel.org \
    --to=jic23@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=mranostay@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.