diff mbox series

[v2] iio: kx022a: document new chip_info structure members

Message ID Z1LDUj-naUdGSM6n@mva-rohm (mailing list archive)
State Accepted
Headers show
Series [v2] iio: kx022a: document new chip_info structure members | expand

Commit Message

Matti Vaittinen Dec. 6, 2024, 9:26 a.m. UTC
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.

Suggested-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
---
Revision history:
v1 => v2:
- Improved wording based on discussion with Mehdi.

 drivers/iio/accel/kionix-kx022a.h | 8 ++++++++
 1 file changed, 8 insertions(+)


base-commit: 05ff9c9c53c643551fe08fe52bd714310b9afc2e

Comments

Jonathan Cameron Dec. 7, 2024, 6:02 p.m. UTC | #1
On Fri, 6 Dec 2024 11:26:42 +0200
Matti Vaittinen <mazziesaccount@gmail.com> wrote:

> 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.
> 
> Suggested-by: Mehdi Djait <mehdi.djait@linux.intel.com>
> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
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

> ---
> Revision history:
> v1 => v2:
> - Improved wording based on discussion with Mehdi.
> 
>  drivers/iio/accel/kionix-kx022a.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/iio/accel/kionix-kx022a.h b/drivers/iio/accel/kionix-kx022a.h
> index 142652ff4b22..d18d56cef098 100644
> --- a/drivers/iio/accel/kionix-kx022a.h
> +++ b/drivers/iio/accel/kionix-kx022a.h
> @@ -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
Mehdi Djait Dec. 8, 2024, 5:34 p.m. UTC | #2
Hi Jonathan and Matti,

thank you Matti for the patch.

On Sat, Dec 07, 2024 at 06:02:01PM +0000, Jonathan Cameron wrote:
> On Fri, 6 Dec 2024 11:26:42 +0200
> Matti Vaittinen <mazziesaccount@gmail.com> wrote:
> 
> > 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.
> > 

Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>

> > Suggested-by: Mehdi Djait <mehdi.djait@linux.intel.com>
> > Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
> 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
Mehdi Djait Dec. 8, 2024, 5:42 p.m. UTC | #3
Hi Jonathan,

On Sat, Dec 07, 2024 at 06:02:01PM +0000, Jonathan Cameron wrote:
> On Fri, 6 Dec 2024 11:26:42 +0200
> Matti Vaittinen <mazziesaccount@gmail.com> wrote:
> 
> > 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.
> > 
> > Suggested-by: Mehdi Djait <mehdi.djait@linux.intel.com>
> > Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
> 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
> 
> > ---
> > Revision history:
> > v1 => v2:
> > - Improved wording based on discussion with Mehdi.
> > 
> >  drivers/iio/accel/kionix-kx022a.h | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/drivers/iio/accel/kionix-kx022a.h b/drivers/iio/accel/kionix-kx022a.h
> > index 142652ff4b22..d18d56cef098 100644
> > --- a/drivers/iio/accel/kionix-kx022a.h
> > +++ b/drivers/iio/accel/kionix-kx022a.h
> > @@ -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.

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
Jonathan Cameron Dec. 8, 2024, 6:25 p.m. UTC | #4
On Sun, 8 Dec 2024 18:42:56 +0100
Mehdi Djait <mehdi.djait@linux.intel.com> wrote:

> Hi Jonathan,
> 
> On Sat, Dec 07, 2024 at 06:02:01PM +0000, Jonathan Cameron wrote:
> > On Fri, 6 Dec 2024 11:26:42 +0200
> > Matti Vaittinen <mazziesaccount@gmail.com> wrote:
> >   
> > > 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.
> > > 
> > > Suggested-by: Mehdi Djait <mehdi.djait@linux.intel.com>
> > > Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>  
> > 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
> >   
> > > ---
> > > Revision history:
> > > v1 => v2:
> > > - Improved wording based on discussion with Mehdi.
> > > 
> > >  drivers/iio/accel/kionix-kx022a.h | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > > 
> > > diff --git a/drivers/iio/accel/kionix-kx022a.h b/drivers/iio/accel/kionix-kx022a.h
> > > index 142652ff4b22..d18d56cef098 100644
> > > --- a/drivers/iio/accel/kionix-kx022a.h
> > > +++ b/drivers/iio/accel/kionix-kx022a.h
> > > @@ -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.  
> 
> 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.
> 
> --
> Kind Regards
> Mehdi Djait
Matti Vaittinen Dec. 9, 2024, 8 a.m. UTC | #5
On 08/12/2024 20:25, Jonathan Cameron wrote:
> On Sun, 8 Dec 2024 18:42:56 +0100
> Mehdi Djait <mehdi.djait@linux.intel.com> wrote:
> 
>> Hi Jonathan,
>>
>> On Sat, Dec 07, 2024 at 06:02:01PM +0000, Jonathan Cameron wrote:
>>> On Fri, 6 Dec 2024 11:26:42 +0200
>>> Matti Vaittinen <mazziesaccount@gmail.com> wrote:
>>>    
>>>> 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.
>>>>
>>>> Suggested-by: Mehdi Djait <mehdi.djait@linux.intel.com>
>>>> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
>>> 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
>>>    
>>>> ---
>>>> Revision history:
>>>> v1 => v2:
>>>> - Improved wording based on discussion with Mehdi.
>>>>
>>>>   drivers/iio/accel/kionix-kx022a.h | 8 ++++++++
>>>>   1 file changed, 8 insertions(+)
>>>>
>>>> diff --git a/drivers/iio/accel/kionix-kx022a.h b/drivers/iio/accel/kionix-kx022a.h
>>>> index 142652ff4b22..d18d56cef098 100644
>>>> --- a/drivers/iio/accel/kionix-kx022a.h
>>>> +++ b/drivers/iio/accel/kionix-kx022a.h
>>>> @@ -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.
>>
>> 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.

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

Yours,
	-- Matti
diff mbox series

Patch

diff --git a/drivers/iio/accel/kionix-kx022a.h b/drivers/iio/accel/kionix-kx022a.h
index 142652ff4b22..d18d56cef098 100644
--- a/drivers/iio/accel/kionix-kx022a.h
+++ b/drivers/iio/accel/kionix-kx022a.h
@@ -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