devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Nyekjaer <sean@geanix.com>
To: jic23@kernel.org, linux-iio@vger.kernel.org,
	andy.shevchenko@gmail.com, lars@metafoo.de, Nuno.Sa@analog.com,
	robh+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 1/2] iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers
Date: Wed, 28 Apr 2021 13:34:01 +0200	[thread overview]
Message-ID: <9b42101e-a48e-d01e-4cd3-51f5ebfcf7d7@geanix.com> (raw)
In-Reply-To: <20210428080107.3584120-1-sean@geanix.com>



On 28/04/2021 10.01, Sean Nyekjaer wrote:
> |static int fxls8962af_read_raw(struct iio_dev *indio_dev, + struct 
> iio_chan_spec const *chan, + int *val, int *val2, long mask) +{ + 
> struct fxls8962af_data *data = iio_priv(indio_dev); + int ret; + + 
> switch (mask) { + case IIO_CHAN_INFO_RAW: + ret = 
> iio_device_claim_direct_mode(indio_dev); + if (ret) + return ret; + + 
> switch (chan->type) { + case IIO_TEMP: + ret = 
> fxls8962af_get_temp(data, val); + break; + case IIO_ACCEL: + ret = 
> fxls8962af_get_axis(data, chan, val); + break; + default: + ret = 
> -EINVAL; + } + + iio_device_release_direct_mode(indio_dev); + return ret;|
|Maybe I should remove iio_device_claim_direct_mode() and release(),
there is actually nothing in the datasheet that block us from reading 
temp and raw
axis data with streaming enabled to the internal fifo.
We have a use-case for reading temperature data while streaming 
accelerometer data.

Could I just check for ||iio_buffer_enabled||() and skip the drdy and 
power_on/off in
||fxls8962af_get_temp() and ||fxls8962af_get_axis()||?

/Sean
|

  parent reply	other threads:[~2021-04-28 11:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28  8:01 [PATCH v3 1/2] iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers Sean Nyekjaer
2021-04-28  8:01 ` [PATCH v3 2/2] dt-bindings: iio: accel: fxls8962af: add bindings Sean Nyekjaer
2021-04-28 11:34 ` Sean Nyekjaer [this message]
2021-04-28 13:59   ` [PATCH v3 1/2] iio: accel: add support for FXLS8962AF/FXLS8964AF accelerometers Jonathan Cameron
2021-04-28 14:19 ` Jonathan Cameron
2021-04-29  5:53   ` Sean Nyekjaer

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=9b42101e-a48e-d01e-4cd3-51f5ebfcf7d7@geanix.com \
    --to=sean@geanix.com \
    --cc=Nuno.Sa@analog.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=robh+dt@kernel.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).