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>
prev parent reply other threads:[~2015-07-23 19:53 UTC|newest]
Thread overview: 10+ 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 ` [PATCH v3 1/2] iio: light: DT binding docs for APDS9960 driver Matt Ranostay
[not found] ` <1436754043-6232-2-git-send-email-mranostay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-07-13 9:42 ` Jonathan Cameron
[not found] ` <73CF94B0-47DF-493D-8F2A-0BC26EB4DEBB-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-07-17 2:55 ` Matt Ranostay
[not found] ` <1436754043-6232-1-git-send-email-mranostay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-07-13 2:20 ` [PATCH v3 2/2] iio: light: add APDS9960 ALS + promixity driver Matt Ranostay
[not found] ` <1436754043-6232-3-git-send-email-mranostay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-07-19 10:45 ` Jonathan Cameron
[not found] ` <55AB7FBE.1060707-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2015-07-20 0:07 ` Matt Ranostay
[not found] ` <CAKzfze81==60bjdp-qd1tH5jcf=+1v6QEs+LbPsC-w00AmT+fw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-23 19:58 ` Jonathan Cameron
2015-07-20 1:56 ` Matt Ranostay
[not found] ` <CAKzfze_2wchApiDHRaCWTgRWL_eep42hOdyXHnrE4Ox6UVxK5A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-23 19:53 ` Jonathan Cameron [this message]
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-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=marex-ynQEQJNshbs@public.gmane.org \
--cc=mranostay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).