public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Minor cleanups and better error handling
@ 2024-07-29 11:50 Abhash Jha
  2024-07-29 11:50 ` [PATCH v3 1/3] iio: light: ltr390: Add configurable gain and resolution Abhash Jha
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Abhash Jha @ 2024-07-29 11:50 UTC (permalink / raw)
  To: linux-iio; +Cc: anshulusr, jic23, lars, linux-kernel, Abhash Jha

Hello,

The first patch in the series adds support for configuring the gain and
resolution(integration time) of the ltr390 sensor by writing to the
respective registers. Then the available values for gain and resolution
that are listed in the datasheet are provided via the `read_avail`
callback. 

The second patch adds a new channel for the ALS feature of the sensor.
The same configuration of gain and resolution has to be provided for this
channel as well. As there are two IIO channels now, we would need to
switch the sensor's mode of operation depending on which sensor is being
accessed. Hence, mode switching is also provided.

Then the third patch adds support for calculating `counts_per_uvi` based
on the current gain and resolution value.

Changes in v3:
- Added cover letter to the patch series.
- Fixed indentation in the patch description.
- Patch specific changes are listed below.

[PATCH v3 1/3]
	- Cleaned up the spurious changes made in v2.
	- ltr390_set_int_time and ltr390_set_gain now return -EINVAL to
    indicate no match.

[PATCH v3 2/3]
	- Used enum ltr390_mode inside the ltr390_data struct.
  - Refactored `ltr390_set_mode` function according to the comments in v2.

[PATCH v3 3/3]
	- Simplified the formula for `counts_per_uvi` calculation.
	- Removed spurious whitespace changes introduced in v2.

- Link to v2: https://lore.kernel.org/linux-iio/20240728151957.310237-1-abhashkumarjha123@gmail.com/

Changes in v2:
- Split the single patch into 3 patches.
- Used FIELD_PREP to perform bit shifting.
- Used enum for mode selection instead of defines.
- Fixed indentation and whitespace issues pointed out in the comments
- Replaced `mutex_lock(&data->lock)` with `guard(mutex)(&data->lock)`
- Provided available values for gain and resolution via `read_avail`
  instead of sysfs attributes.
- Refactored `ltr390_set_gain` and `ltr390_set_int_time`.
- Used early returns instead of single exit points.

- Link to v1: https://lore.kernel.org/linux-iio/20240718104947.7384-1-abhashkumarjha123@gmail.com/

Regards,
Abhash

Abhash Jha (3):
  iio: light: ltr390: Add configurable gain and resolution
  iio: light: ltr390: Add ALS channel and support for gain and
    resolution
  iio: light: ltr390: Calculate 'counts_per_uvi' dynamically

 drivers/iio/light/ltr390.c | 246 +++++++++++++++++++++++++++++++++----
 1 file changed, 225 insertions(+), 21 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2024-08-03  5:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-29 11:50 [PATCH v3 0/3] Minor cleanups and better error handling Abhash Jha
2024-07-29 11:50 ` [PATCH v3 1/3] iio: light: ltr390: Add configurable gain and resolution Abhash Jha
2024-07-29 23:45   ` kernel test robot
2024-07-30  2:46   ` kernel test robot
2024-07-29 11:50 ` [PATCH v3 2/3] iio: light: ltr390: Add ALS channel and support for " Abhash Jha
2024-07-29 19:53   ` Jonathan Cameron
2024-07-30  7:17     ` Abhash jha
2024-07-30 18:21       ` Jonathan Cameron
2024-08-03  5:17         ` Abhash jha
2024-07-29 11:50 ` [PATCH v3 3/3] iio: light: ltr390: Calculate 'counts_per_uvi' dynamically Abhash Jha

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