Skip to contentSkip to conversation

iio: kx022a: document new chip_info structure members

PATCH In review Matti Vaittinen 3 participants 6 messages Dec 6, 2024 – Dec 9, 2024

Subsystems (2)
lore
Share & tools
lore

Matti Vaittinen

author maintainer
#0 lore raw

PATCH v2 1/1 iio: kx022a: document new chip_info structure members

The kx022a driver supports a few different HW variants. A chip-info structure is used to describe sensor specific details. Support for sensors with different measurement g-ranges was added recently, introducing sensor specific scale arrays.

The members of the chip-info structure have been documented using kerneldoc. The newly added members omitted the documentation. It is nice to have all the entries documented for the sake of the consistency. Furthermore, the scale table format may not be self explatonary, nor how the amount of scales is informed.

Add documentation to scale table entries to maintain consistency and to make it more obvious how the scales should be represented.

---
Revision history:
v1 => v2:
- Improved wording based on discussion with Mehdi.

 drivers/iio/accel/kionix-kx022a.h | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/iio/accel/kionix-kx022a.h +8 -0
index 142652ff4b22..d18d56cef098 100644
@@ -137,6 +137,14 @@ struct kx022a_data;
  *
  * @name:			name of the device
  * @regmap_config:		pointer to register map configuration
+ * scale_table:			An array of tables of scaling factors for
+ *				a supported acceleration measurement range.
+ *				Each table containing a single scaling
+ *				factor consisting of two integers. The first
+ *				value in a table is the integer part, and
+ *				the second value is the	fractional part as
+ *				parts per billion.
+ * scale_table_size:		Amount of values in tables.
  * @channels:			pointer to iio_chan_spec array
  * @num_channels:		number of iio_chan_spec channels
  * @fifo_length:		number of 16-bit samples in a full buffer

base-commit: 05ff9c9c53c643551fe08fe52bd714310b9afc2e

Signature · 1 line
2.47.0
maintainer
#1 lore raw
Quoted 11 lines · On Fri, 6 Dec 2024 11:26:42 +0200 Matti Vaittinen <[email protected]>…

The kx022a driver supports a few different HW variants. A chip-info structure is used to describe sensor specific details. Support for sensors with different measurement g-ranges was added recently, introducing sensor specific scale arrays.

The members of the chip-info structure have been documented using kerneldoc. The newly added members omitted the documentation. It is nice to have all the entries documented for the sake of the consistency. Furthermore, the scale table format may not be self explatonary, nor how the amount of scales is informed.

Quoted 5 lines

Add documentation to scale table entries to maintain consistency and to make it more obvious how the scales should be represented.

Applied to the togreg branch of iio.git. Initially pushed out as testing.

Mehdi, if you want to give a tag (or more feedback) I am happy to rebase for a few days.

Jonathan

Quoted 29 lines

---
Revision history:
v1 => v2:
- Improved wording based on discussion with Mehdi.

 drivers/iio/accel/kionix-kx022a.h | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/iio/accel/kionix-kx022a.h +8 -0
index 142652ff4b22..d18d56cef098 100644
@@ -137,6 +137,14 @@ struct kx022a_data;
  *
  * @name:			name of the device
  * @regmap_config:		pointer to register map configuration
+ * scale_table:			An array of tables of scaling factors for
+ *				a supported acceleration measurement range.
+ *				Each table containing a single scaling
+ *				factor consisting of two integers. The first
+ *				value in a table is the integer part, and
+ *				the second value is the	fractional part as
+ *				parts per billion.
+ * scale_table_size:		Amount of values in tables.
  * @channels:			pointer to iio_chan_spec array
  * @num_channels:		number of iio_chan_spec channels
  * @fifo_length:		number of 16-bit samples in a full buffer

base-commit: 05ff9c9c53c643551fe08fe52bd714310b9afc2e

Reviewed-by
#2 lore raw

Hi Jonathan and Matti,

thank you Matti for the patch.

Quoted 14 lines · Jonathan Cameron
Quoted 11 lines · On Fri, 6 Dec 2024 11:26:42 +0200 Matti Vaittinen <[email protected]>…

The kx022a driver supports a few different HW variants. A chip-info structure is used to describe sensor specific details. Support for sensors with different measurement g-ranges was added recently, introducing sensor specific scale arrays.

The members of the chip-info structure have been documented using kerneldoc. The newly added members omitted the documentation. It is nice to have all the entries documented for the sake of the consistency. Furthermore, the scale table format may not be self explatonary, nor how the amount of scales is informed.

Quoted 3 lines
Quoted 3 lines

Add documentation to scale table entries to maintain consistency and to make it more obvious how the scales should be represented.

Quoted 6 lines
Quoted 2 lines

Applied to the togreg branch of iio.git. Initially pushed out as testing.

Mehdi, if you want to give a tag (or more feedback) I am happy to rebase for a few days.

the kernel-doc looks good to me.
thank you Jonathan.

--
Kind Regards
Mehdi Djait

#3 lore raw
In reply to Jonathan Cameron

Hi Jonathan,

Quoted 34 lines · Jonathan Cameron
Quoted 11 lines · On Fri, 6 Dec 2024 11:26:42 +0200 Matti Vaittinen <[email protected]>…

The kx022a driver supports a few different HW variants. A chip-info structure is used to describe sensor specific details. Support for sensors with different measurement g-ranges was added recently, introducing sensor specific scale arrays.

The members of the chip-info structure have been documented using kerneldoc. The newly added members omitted the documentation. It is nice to have all the entries documented for the sake of the consistency. Furthermore, the scale table format may not be self explatonary, nor how the amount of scales is informed.

Quoted 5 lines

Add documentation to scale table entries to maintain consistency and to make it more obvious how the scales should be represented.

Applied to the togreg branch of iio.git. Initially pushed out as testing.

Mehdi, if you want to give a tag (or more feedback) I am happy to rebase for a few days.

Jonathan

Quoted 8 lines

---
Revision history:
v1 => v2:
- Improved wording based on discussion with Mehdi.

 drivers/iio/accel/kionix-kx022a.h | 8 ++++++++
 1 file changed, 8 insertions(+)
Quoted 16 lines
Quoted 6 lines
drivers/iio/accel/kionix-kx022a.h +0 -0
index 142652ff4b22..d18d56cef098 100644
@@ -137,6 +137,14 @@ struct kx022a_data;
  *

drivers/iio/accel/kionix-kx022a.h struct kx022a_data; · line 147

Quoted 10 lines
drivers/iio/accel/kionix-kx022a.h +8 -0
  * @name:			name of the device
  * @regmap_config:		pointer to register map configuration
+ * scale_table:			An array of tables of scaling factors for
+ *				a supported acceleration measurement range.
+ *				Each table containing a single scaling
+ *				factor consisting of two integers. The first
+ *				value in a table is the integer part, and
+ *				the second value is the	fractional part as
+ *				parts per billion.
+ * scale_table_size:		Amount of values in tables.

I just noticed that the '@' preceding the added members scale_table and scale_table_size are missing, but I guess you can add those when rebasing ?

--
Kind Regards
Mehdi Djait

maintainer
#4 lore raw
Quoted 49 lines · On Sun, 8 Dec 2024 18:42:56 +0100 Mehdi Djait <[email protected]>…

Hi Jonathan,

Quoted 46 lines · Jonathan Cameron
Quoted 11 lines · On Fri, 6 Dec 2024 11:26:42 +0200 Matti Vaittinen <[email protected]>…

The kx022a driver supports a few different HW variants. A chip-info structure is used to describe sensor specific details. Support for sensors with different measurement g-ranges was added recently, introducing sensor specific scale arrays.

The members of the chip-info structure have been documented using kerneldoc. The newly added members omitted the documentation. It is nice to have all the entries documented for the sake of the consistency. Furthermore, the scale table format may not be self explatonary, nor how the amount of scales is informed.

Quoted 5 lines

Add documentation to scale table entries to maintain consistency and to make it more obvious how the scales should be represented.

Applied to the togreg branch of iio.git. Initially pushed out as testing.

Mehdi, if you want to give a tag (or more feedback) I am happy to rebase for a few days.

Jonathan

Quoted 20 lines

---
Revision history:
v1 => v2:
- Improved wording based on discussion with Mehdi.

 drivers/iio/accel/kionix-kx022a.h | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/iio/accel/kionix-kx022a.h +4 -0
index 142652ff4b22..d18d56cef098 100644
@@ -137,6 +137,14 @@ struct kx022a_data;
  *
  * @name:			name of the device
  * @regmap_config:		pointer to register map configuration
+ * scale_table:			An array of tables of scaling factors for
+ *				a supported acceleration measurement range.
+ *				Each table containing a single scaling
+ *				factor consisting of two integers. The first
Quoted 8 lines
Quoted 4 lines

drivers/iio/accel/kionix-kx022a.h struct kx022a_data; · line 147

Quoted 4 lines
drivers/iio/accel/kionix-kx022a.h +4 -0
+ *				value in a table is the integer part, and
+ *				the second value is the	fractional part as
+ *				parts per billion.
+ * scale_table_size:		Amount of values in tables.  

I just noticed that the '@' preceding the added members scale_table and scale_table_size are missing, but I guess you can add those when rebasing ?

Good spot ;( I'll fix.

Quoted 4 lines

--
Kind Regards
Mehdi Djait

author maintainer
#5 lore raw
Quoted 60 lines · Jonathan Cameron
Quoted 49 lines · On Sun, 8 Dec 2024 18:42:56 +0100 Mehdi Djait <[email protected]>…

Hi Jonathan,

Quoted 46 lines · Jonathan Cameron
Quoted 11 lines · On Fri, 6 Dec 2024 11:26:42 +0200 Matti Vaittinen <[email protected]>…

The kx022a driver supports a few different HW variants. A chip-info structure is used to describe sensor specific details. Support for sensors with different measurement g-ranges was added recently, introducing sensor specific scale arrays.

The members of the chip-info structure have been documented using kerneldoc. The newly added members omitted the documentation. It is nice to have all the entries documented for the sake of the consistency. Furthermore, the scale table format may not be self explatonary, nor how the amount of scales is informed.

Quoted 5 lines

Add documentation to scale table entries to maintain consistency and to make it more obvious how the scales should be represented.

Applied to the togreg branch of iio.git. Initially pushed out as testing.

Mehdi, if you want to give a tag (or more feedback) I am happy to rebase for a few days.

Jonathan

Quoted 20 lines

---
Revision history:
v1 => v2:
- Improved wording based on discussion with Mehdi.

  drivers/iio/accel/kionix-kx022a.h | 8 ++++++++
  1 file changed, 8 insertions(+)
drivers/iio/accel/kionix-kx022a.h +4 -0
index 142652ff4b22..d18d56cef098 100644
@@ -137,6 +137,14 @@ struct kx022a_data;
   *
   * @name:			name of the device
   * @regmap_config:		pointer to register map configuration
+ * scale_table:			An array of tables of scaling factors for
+ *				a supported acceleration measurement range.
+ *				Each table containing a single scaling
+ *				factor consisting of two integers. The first
Quoted 8 lines
Quoted 4 lines

drivers/iio/accel/kionix-kx022a.h struct kx022a_data; · line 147

Quoted 4 lines
drivers/iio/accel/kionix-kx022a.h +4 -0
+ *				value in a table is the integer part, and
+ *				the second value is the	fractional part as
+ *				parts per billion.
+ * scale_table_size:		Amount of values in tables.

I just noticed that the '@' preceding the added members scale_table and scale_table_size are missing, but I guess you can add those when rebasing ?

Quoted 1 line

Good spot ;( I'll fix.

Thanks a ton for both of you :) I concentrated too much on rewording!

Yours,
-- Matti