From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Philippe De Muyter <phdm@macq.eu>, linux-iio@vger.kernel.org
Subject: Re: sysfs mount_matrix for st_lsm6dsx gyro
Date: Thu, 12 Jan 2023 10:51:03 +0100 [thread overview]
Message-ID: <Y7/YB1CmEzbnNogP@lore-desk> (raw)
In-Reply-To: <20230111171732.00006941@Huawei.com>
[-- Attachment #1: Type: text/plain, Size: 3008 bytes --]
> On Wed, 11 Jan 2023 13:09:40 +0100
> Philippe De Muyter <phdm@macq.eu> wrote:
>
> > Hello Lorenzo and list,
> >
> > I do not find a "*mount_matrix" entry in sysfs for a 'ism330dlc_gyro'
> > iio device.
> > Is that normal ?
> > Is a fix available ?
>
> Looks like the channel definition for the gyro does not include an
> appropriate ext_info entry unlike the accelerometer channels which
> have one with mount_matrix support.
>
> From a quick glance looks like a simple fix. Add that entry.
I am not sure if accel and gyro can be mounted with a different orientation.
Do you think we should have a per-sensor mount_matrix?
Regards,
Lorenzo
> >
> > Some more info :
> >
> > I have backported drivers/iio/imu/st_lsm6dsx to linux-4.9 in order
> > to drive a ism330dlc imu on a custom board. The chip is correctly
> > detected and two devices are created in /sys/bus/iio/devices/
> >
> > the first one (where name is 'ism330dlc_gyro') has the following entries :
> >
> > me@proto4:~$ ls /sys/bus/iio/devices/iio\:device1/
> > buffer in_anglvel_x_raw sampling_frequency
> > current_timestamp_clock in_anglvel_y_raw sampling_frequency_available
> > dev in_anglvel_z_raw scan_elements
> > in_anglvel_scale name subsystem
> > in_anglvel_scale_available power uevent
> > me@proto4:~$
> >
> > the second one (where name is 'ism330dlc_accel') has those entries :
> >
> > me@proto4:~$ ls /sys/bus/iio/devices/iio\:device2
> > buffer in_accel_x_raw sampling_frequency
> > current_timestamp_clock in_accel_y_raw sampling_frequency_available
> > dev in_accel_z_raw scan_elements
> > events mount_matrix subsystem
> > in_accel_scale name uevent
> > in_accel_scale_available power
> > me@proto4:~$
> >
> > The 'mount_matrix' entry is only present in the 'ism330dlc_accel' device
> > but not in the 'ism330dlc_gyro' device.
> >
> > On a similar board, but with mpu9250 imu, I get only one iio:deviceX
> > entry but with two *mount_matrix entries :
> >
> > in_accel_mount_matrix
> > in_anglvel_mount_matrix
> >
> > In both cases, I would have expected only one 'iio:deviceX' entry with
> > only one 'mount_matrix' entry.
>
> There are multiple devices because the driver predates the addition
> of multiple buffer support to IIO and IIRC is capable of producing data
> at different sampling rates for the accelerometer and the gyros.
> Hence when it was implemented the only choice was to register multiple
> devices in order to get the multiple buffers. It's ABI now so we can't
> fix it in an old driver unfortunately. We'd do this differently today..
>
> The double mount_matrix for the mpu9250 is a little odd and I can't
> immediately spot why that one is happening.
>
>
> >
> > Best regards
> >
> > Philippe
> >
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-01-12 9:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-11 12:09 sysfs mount_matrix for st_lsm6dsx gyro Philippe De Muyter
2023-01-11 17:17 ` Jonathan Cameron
2023-01-12 9:51 ` Lorenzo Bianconi [this message]
2023-01-12 11:27 ` Philippe De Muyter
2023-01-12 11:32 ` Lorenzo Bianconi
2023-01-12 15:19 ` Jonathan Cameron
2023-01-13 14:45 ` Philippe De Muyter
2023-01-12 10:12 ` 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=Y7/YB1CmEzbnNogP@lore-desk \
--to=lorenzo@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=linux-iio@vger.kernel.org \
--cc=phdm@macq.eu \
/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