public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Mario Tesi <mario.tesi@st.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] iio: lsm6dsx: Support temperature channel
Date: Mon, 28 Aug 2023 17:43:32 +0100	[thread overview]
Message-ID: <20230828174332.101ecbcf@jic23-huawei> (raw)
In-Reply-To: <CACRpkdYUnpb4oo+4pBxhQqbnquDP_+w3ecGoFX18TTC9BSZFwg@mail.gmail.com>

On Sat, 12 Aug 2023 22:40:19 +0200
Linus Walleij <linus.walleij@linaro.org> wrote:

> On Sat, Aug 12, 2023 at 11:17 AM Lorenzo Bianconi <lorenzo@kernel.org> wrote:
> 
> > > > looking at the ISM330DHCX datasheet, the temperature sensor ODR is just 52Hz,
> > > > while values in 0x0A register are used only for FIFO decimation, they are not
> > > > values you can configure the sensor e.g. for read_one_shot().  
> 
> BTW looked at this and the read_one_shot() call uses
> register 0x20/0x21 as appropriate.
> 
> > > >  
> > > > > +                             .odr_avl[0] = {  26000, 0x02 },
> > > > > +                             .odr_avl[1] = {  52000, 0x03 },
> > > > > +                             .odr_len = 2,  
> > >
> > > I look at page 44, paragraph 9.6 about bits 4-5:
> > >
> > > ODR_T_BATCH_[1:0]
> > > Selects batch data rate (write frequency in FIFO) for temperature data
> > > (00: Temperature not batched in FIFO (default);
> > > 01: 1.6 Hz;
> > > 10: 12.5 Hz;
> > > 11: 52 Hz)  
> >
> > AFAIR the batch register is used to sub-sample sensor data before queueing them
> > into the FIFO (please check st_lsm6dsx_set_fifo_odr()), but it does not refer
> > to the configured sensor ODR.
> > Looking at the device application-note [0], the temperature sensor ODR depends
> > on the accel/gyro one:
> >
> > - temperature sensor ODR == accel sensor ODR if accel ODR is < 52Hz and the
> >   gyro is in power-down
> > - temperature sensor ODR = 52Hz if accel ODR > 52Hz or if the gyro is not in
> >   power-down  
> 
> We handle the TEMP along with the EXT channels in
> st_lsm6dsx_set_odr() which actually makes sure to match
> the data rate of the accelerometer.
> 
> It looks as nobody cared to look into the issue with the
> gyroscope though :/ It feels like a whole separate issue,
> I expect more channels to be affected by that...
> 
> Yours,
> Linus Walleij
FWIW this seems crazy.  Ah well, Lorenzo is the expert on these beasts.

Jonathna

  reply	other threads:[~2023-08-28 16:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-11  9:08 [PATCH 0/2] iio: imu: lsm6dsx: Support temperature and ism330dhc Linus Walleij
2023-08-11  9:08 ` [PATCH 1/2] iio: lsm6dsx: Support temperature channel Linus Walleij
2023-08-11 10:07   ` Lorenzo Bianconi
2023-08-11 18:16     ` Linus Walleij
2023-08-12  9:17       ` Lorenzo Bianconi
2023-08-12 20:40         ` Linus Walleij
2023-08-28 16:43           ` Jonathan Cameron [this message]
2023-08-29  7:30             ` Linus Walleij
2023-08-11  9:08 ` [PATCH 2/2] iio: imu: lsm6dsx: Add support for ism330dhc Linus Walleij
2023-08-11  9:40   ` Lorenzo Bianconi
2023-08-11 10:08 ` [PATCH 0/2] iio: imu: lsm6dsx: Support temperature and ism330dhc Lorenzo Bianconi

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=20230828174332.101ecbcf@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=mario.tesi@st.com \
    --cc=miquel.raynal@bootlin.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox