Linux IIO development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel.
@ 2023-01-16 13:07 Philippe De Muyter
  2023-01-16 13:07 ` [PATCH v2 1/2] iio: imu: st_lsm6dsx: fix naming of 'struct iio_info' in st_lsm6dsx_shub.c Philippe De Muyter
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Philippe De Muyter @ 2023-01-16 13:07 UTC (permalink / raw)
  To: lorenzo, linux-iio; +Cc: Philippe De Muyter

From: Philippe De Muyter <phdm@macqel.be>


A simple patch to add the missing 'mount_matrix' sysfs entry for the gyro
channel of the st_lsm6dsx 6-axes devices.

v2: use 'shub' in the renaming

Philippe De Muyter (2):
  iio: imu: st_lsm6dsx: fix naming of 'struct iio_info' in
    st_lsm6dsx_shub.c.
  iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel.

 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h      |  5 +++--
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 12 ++++++------
 2 files changed, 9 insertions(+), 8 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/2] iio: imu: st_lsm6dsx: fix naming of 'struct iio_info' in st_lsm6dsx_shub.c.
  2023-01-16 13:07 [PATCH v2 0/2] iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel Philippe De Muyter
@ 2023-01-16 13:07 ` Philippe De Muyter
  2023-01-16 13:20   ` Lorenzo Bianconi
  2023-01-16 13:07 ` [PATCH v2 2/2] iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel Philippe De Muyter
  2023-01-21 18:17 ` [PATCH v2 0/2] " Jonathan Cameron
  2 siblings, 1 reply; 6+ messages in thread
From: Philippe De Muyter @ 2023-01-16 13:07 UTC (permalink / raw)
  To: lorenzo, linux-iio; +Cc: Philippe De Muyter

From: Philippe De Muyter <phdm@macqel.be>

We need the name 'st_lsm6dsx_ext_info' for the actual 'iio_chan_spec_ext_info'.
Rename the 'st_lsm6dsx_ext_info' in st_lsm6dsx_shub.c to 'st_lsm6dsx_shub_info'.
For consistency, replace also 'ext' by 'shub' in 'st_lsm6dsx_ext_attributes'
and 'st_lsm6dsx_ext_attribute_group'.

Signed-off-by: Philippe De Muyter <phdm@macqel.be>
---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
index f2b64b4956a3..c1b444520d2a 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
@@ -704,18 +704,18 @@ static ssize_t st_lsm6dsx_shub_scale_avail(struct device *dev,
 static IIO_DEV_ATTR_SAMP_FREQ_AVAIL(st_lsm6dsx_shub_sampling_freq_avail);
 static IIO_DEVICE_ATTR(in_scale_available, 0444,
 		       st_lsm6dsx_shub_scale_avail, NULL, 0);
-static struct attribute *st_lsm6dsx_ext_attributes[] = {
+static struct attribute *st_lsm6dsx_shub_attributes[] = {
 	&iio_dev_attr_sampling_frequency_available.dev_attr.attr,
 	&iio_dev_attr_in_scale_available.dev_attr.attr,
 	NULL,
 };
 
-static const struct attribute_group st_lsm6dsx_ext_attribute_group = {
-	.attrs = st_lsm6dsx_ext_attributes,
+static const struct attribute_group st_lsm6dsx_shub_attribute_group = {
+	.attrs = st_lsm6dsx_shub_attributes,
 };
 
-static const struct iio_info st_lsm6dsx_ext_info = {
-	.attrs = &st_lsm6dsx_ext_attribute_group,
+static const struct iio_info st_lsm6dsx_shub_info = {
+	.attrs = &st_lsm6dsx_shub_attribute_group,
 	.read_raw = st_lsm6dsx_shub_read_raw,
 	.write_raw = st_lsm6dsx_shub_write_raw,
 	.hwfifo_set_watermark = st_lsm6dsx_set_watermark,
@@ -737,7 +737,7 @@ st_lsm6dsx_shub_alloc_iiodev(struct st_lsm6dsx_hw *hw,
 		return NULL;
 
 	iio_dev->modes = INDIO_DIRECT_MODE;
-	iio_dev->info = &st_lsm6dsx_ext_info;
+	iio_dev->info = &st_lsm6dsx_shub_info;
 
 	sensor = iio_priv(iio_dev);
 	sensor->id = id;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/2] iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel.
  2023-01-16 13:07 [PATCH v2 0/2] iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel Philippe De Muyter
  2023-01-16 13:07 ` [PATCH v2 1/2] iio: imu: st_lsm6dsx: fix naming of 'struct iio_info' in st_lsm6dsx_shub.c Philippe De Muyter
@ 2023-01-16 13:07 ` Philippe De Muyter
  2023-01-16 13:19   ` Lorenzo Bianconi
  2023-01-21 18:17 ` [PATCH v2 0/2] " Jonathan Cameron
  2 siblings, 1 reply; 6+ messages in thread
From: Philippe De Muyter @ 2023-01-16 13:07 UTC (permalink / raw)
  To: lorenzo, linux-iio; +Cc: Philippe De Muyter

From: Philippe De Muyter <phdm@macqel.be>

Signed-off-by: Philippe De Muyter <phdm@macqel.be>
---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
index 5b6f195748fc..499fcf8875b4 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
@@ -93,7 +93,7 @@ enum st_lsm6dsx_hw_id {
 		.endianness = IIO_LE,					\
 	},								\
 	.event_spec = &st_lsm6dsx_event,				\
-	.ext_info = st_lsm6dsx_accel_ext_info,				\
+	.ext_info = st_lsm6dsx_ext_info,				\
 	.num_event_specs = 1,						\
 }
 
@@ -113,6 +113,7 @@ enum st_lsm6dsx_hw_id {
 		.storagebits = 16,					\
 		.endianness = IIO_LE,					\
 	},								\
+	.ext_info = st_lsm6dsx_ext_info,				\
 }
 
 struct st_lsm6dsx_reg {
@@ -528,7 +529,7 @@ st_lsm6dsx_device_set_enable(struct st_lsm6dsx_sensor *sensor, bool enable)
 }
 
 static const
-struct iio_chan_spec_ext_info __maybe_unused st_lsm6dsx_accel_ext_info[] = {
+struct iio_chan_spec_ext_info __maybe_unused st_lsm6dsx_ext_info[] = {
 	IIO_MOUNT_MATRIX(IIO_SHARED_BY_ALL, st_lsm6dsx_get_mount_matrix),
 	{ }
 };
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 2/2] iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel.
  2023-01-16 13:07 ` [PATCH v2 2/2] iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel Philippe De Muyter
@ 2023-01-16 13:19   ` Lorenzo Bianconi
  0 siblings, 0 replies; 6+ messages in thread
From: Lorenzo Bianconi @ 2023-01-16 13:19 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: linux-iio, Philippe De Muyter

[-- Attachment #1: Type: text/plain, Size: 1390 bytes --]

> From: Philippe De Muyter <phdm@macqel.be>
> 
> Signed-off-by: Philippe De Muyter <phdm@macqel.be>
> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 

Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>

> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> index 5b6f195748fc..499fcf8875b4 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
> @@ -93,7 +93,7 @@ enum st_lsm6dsx_hw_id {
>  		.endianness = IIO_LE,					\
>  	},								\
>  	.event_spec = &st_lsm6dsx_event,				\
> -	.ext_info = st_lsm6dsx_accel_ext_info,				\
> +	.ext_info = st_lsm6dsx_ext_info,				\
>  	.num_event_specs = 1,						\
>  }
>  
> @@ -113,6 +113,7 @@ enum st_lsm6dsx_hw_id {
>  		.storagebits = 16,					\
>  		.endianness = IIO_LE,					\
>  	},								\
> +	.ext_info = st_lsm6dsx_ext_info,				\
>  }
>  
>  struct st_lsm6dsx_reg {
> @@ -528,7 +529,7 @@ st_lsm6dsx_device_set_enable(struct st_lsm6dsx_sensor *sensor, bool enable)
>  }
>  
>  static const
> -struct iio_chan_spec_ext_info __maybe_unused st_lsm6dsx_accel_ext_info[] = {
> +struct iio_chan_spec_ext_info __maybe_unused st_lsm6dsx_ext_info[] = {
>  	IIO_MOUNT_MATRIX(IIO_SHARED_BY_ALL, st_lsm6dsx_get_mount_matrix),
>  	{ }
>  };
> -- 
> 2.31.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] iio: imu: st_lsm6dsx: fix naming of 'struct iio_info' in st_lsm6dsx_shub.c.
  2023-01-16 13:07 ` [PATCH v2 1/2] iio: imu: st_lsm6dsx: fix naming of 'struct iio_info' in st_lsm6dsx_shub.c Philippe De Muyter
@ 2023-01-16 13:20   ` Lorenzo Bianconi
  0 siblings, 0 replies; 6+ messages in thread
From: Lorenzo Bianconi @ 2023-01-16 13:20 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: linux-iio, Philippe De Muyter

[-- Attachment #1: Type: text/plain, Size: 2280 bytes --]

> From: Philippe De Muyter <phdm@macqel.be>
> 
> We need the name 'st_lsm6dsx_ext_info' for the actual 'iio_chan_spec_ext_info'.
> Rename the 'st_lsm6dsx_ext_info' in st_lsm6dsx_shub.c to 'st_lsm6dsx_shub_info'.
> For consistency, replace also 'ext' by 'shub' in 'st_lsm6dsx_ext_attributes'
> and 'st_lsm6dsx_ext_attribute_group'.

Acked-by: Lorenzo Bianconi <lorenzo@kernel.org>

> 
> Signed-off-by: Philippe De Muyter <phdm@macqel.be>
> ---
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> index f2b64b4956a3..c1b444520d2a 100644
> --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c
> @@ -704,18 +704,18 @@ static ssize_t st_lsm6dsx_shub_scale_avail(struct device *dev,
>  static IIO_DEV_ATTR_SAMP_FREQ_AVAIL(st_lsm6dsx_shub_sampling_freq_avail);
>  static IIO_DEVICE_ATTR(in_scale_available, 0444,
>  		       st_lsm6dsx_shub_scale_avail, NULL, 0);
> -static struct attribute *st_lsm6dsx_ext_attributes[] = {
> +static struct attribute *st_lsm6dsx_shub_attributes[] = {
>  	&iio_dev_attr_sampling_frequency_available.dev_attr.attr,
>  	&iio_dev_attr_in_scale_available.dev_attr.attr,
>  	NULL,
>  };
>  
> -static const struct attribute_group st_lsm6dsx_ext_attribute_group = {
> -	.attrs = st_lsm6dsx_ext_attributes,
> +static const struct attribute_group st_lsm6dsx_shub_attribute_group = {
> +	.attrs = st_lsm6dsx_shub_attributes,
>  };
>  
> -static const struct iio_info st_lsm6dsx_ext_info = {
> -	.attrs = &st_lsm6dsx_ext_attribute_group,
> +static const struct iio_info st_lsm6dsx_shub_info = {
> +	.attrs = &st_lsm6dsx_shub_attribute_group,
>  	.read_raw = st_lsm6dsx_shub_read_raw,
>  	.write_raw = st_lsm6dsx_shub_write_raw,
>  	.hwfifo_set_watermark = st_lsm6dsx_set_watermark,
> @@ -737,7 +737,7 @@ st_lsm6dsx_shub_alloc_iiodev(struct st_lsm6dsx_hw *hw,
>  		return NULL;
>  
>  	iio_dev->modes = INDIO_DIRECT_MODE;
> -	iio_dev->info = &st_lsm6dsx_ext_info;
> +	iio_dev->info = &st_lsm6dsx_shub_info;
>  
>  	sensor = iio_priv(iio_dev);
>  	sensor->id = id;
> -- 
> 2.31.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/2] iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel.
  2023-01-16 13:07 [PATCH v2 0/2] iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel Philippe De Muyter
  2023-01-16 13:07 ` [PATCH v2 1/2] iio: imu: st_lsm6dsx: fix naming of 'struct iio_info' in st_lsm6dsx_shub.c Philippe De Muyter
  2023-01-16 13:07 ` [PATCH v2 2/2] iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel Philippe De Muyter
@ 2023-01-21 18:17 ` Jonathan Cameron
  2 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2023-01-21 18:17 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: lorenzo, linux-iio, Philippe De Muyter

On Mon, 16 Jan 2023 14:07:12 +0100
Philippe De Muyter <Philippe.DeMuyter@macq.eu> wrote:

> From: Philippe De Muyter <phdm@macqel.be>
> 
> 
> A simple patch to add the missing 'mount_matrix' sysfs entry for the gyro
> channel of the st_lsm6dsx 6-axes devices.
> 
> v2: use 'shub' in the renaming
Series applied to the togreg branch of iio.git and initially pushed out
as testing for 0-day to work it's magic.

Thanks,

Jonathan

> 
> Philippe De Muyter (2):
>   iio: imu: st_lsm6dsx: fix naming of 'struct iio_info' in
>     st_lsm6dsx_shub.c.
>   iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel.
> 
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h      |  5 +++--
>  drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c | 12 ++++++------
>  2 files changed, 9 insertions(+), 8 deletions(-)
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-21 18:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-16 13:07 [PATCH v2 0/2] iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel Philippe De Muyter
2023-01-16 13:07 ` [PATCH v2 1/2] iio: imu: st_lsm6dsx: fix naming of 'struct iio_info' in st_lsm6dsx_shub.c Philippe De Muyter
2023-01-16 13:20   ` Lorenzo Bianconi
2023-01-16 13:07 ` [PATCH v2 2/2] iio: imu: st_lsm6dsx: add 'mount_matrix' sysfs entry to gyro channel Philippe De Muyter
2023-01-16 13:19   ` Lorenzo Bianconi
2023-01-21 18:17 ` [PATCH v2 0/2] " Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox