From: Jonathan Cameron <jic23@kernel.org>
To: "Natália Salvino André" <natalia.andre@ime.usp.br>
Cc: andy@kernel.org, dlechner@baylibre.com, jikos@kernel.org,
nuno.sa@analog.com, srinivas.pandruvada@linux.intel.com,
linux-iio@vger.kernel.org, linux-input@vger.kernel.org, "Zhang,
Lixu" <lixu.zhang@intel.com>
Subject: Re: [PATCH v4 0/6] iio: hid-sensor: standardize scan_type initialization
Date: Fri, 22 May 2026 17:51:47 +0100 [thread overview]
Message-ID: <20260522175147.78e0e7bc@jic23-huawei> (raw)
In-Reply-To: <20260519234752.23911-1-natalia.andre@ime.usp.br>
On Tue, 19 May 2026 20:40:42 -0300
Natália Salvino André <natalia.andre@ime.usp.br> wrote:
> This series refactors the HID sensor drivers to standardize the
> initialization of the iio_chan_spec scan_type structure using compound
> literals.
>
> This change improves code readability and ensures that all fields of
> the scan_type structure are properly zero-initialized, allowing the
> removal of local helper functions.
>
> Additionally, the channel initialization loops for hid-sensor-accel-3d
> and hid-sensor-gyro-3d were cleaned up to iterate directly over the
> scan indices, eliminating redundant index-offset logic.
+CC Lixu
Please make sure to add to your +CC anyone who has been involve in earlier
versions of the series.
I'm going to queue this now to get some build coverage. Still fine
to add tags though or indeed drop it if any problems.
Applied to the testing branch of iio.git
thanks,
Jonathan
>
> ---
>
> Changes in v4:
>
> - Fixed a bug in the sensor_hub_input_get_attribute_info()
> call where passing the raw loop index 'ch' broke the HID report
> field lookup in hid-sensor-accel-3d. Restored the proper HID
> usage ID offset calculation using HID_USAGE_SENSOR_ACCEL_X_AXIS + ch
> - Cleaned up the channel initialization loop to iterate
> directly over the scan indices in hid-sensor-gyro-3d for consistency
>
> Changes in v3:
>
> - Dropped the global helper function implementation from
> hid-sensor-attributes.c following maintainer feedback.
> - Shifted to local refactoring inside the drivers using compound
> literals and the macros BYTES_TO_BITS() and BITS_PER_TYPE()
> - Refactored the channel initialization loop in hid-sensor-accel-3d to
> iterate directly over the scan enums instead of using 0-based
> index offsets
> - v3 link: https://lore.kernel.org/linux-iio/89a2e6775e3c922a4848a4b4730aab8d32097454.camel@linux.intel.com/T/#t
>
> Changes in v2:
>
> - Modified the helper function to use the BITS_PER_BYTE macro instead of
> magic numbers for bit calculations
> - Updated the scan_type structure field assignment from '.sign'
> to '.format' based on recent subsystem renaming feedback
>
> Natália Salvino André (6):
> iio: accel: HID: hid-sensor-accel-3d: Refactor channel initialization
> iio: gyro: HID: hid-sensor-gyro-3d: Refactor channel initialization
> iio: light: HID: hid-sensor-als: Refactor channel initialization
> iio: light: HID: hid-sensor-prox: Refactor channel initialization
> iio: magnetometer: HID: hid-sensor-magn-3d: Refactor channel
> initialization
> iio: pressure: HID: hid-sensor-press: Refactor channel initialization
>
> drivers/iio/accel/hid-sensor-accel-3d.c | 27 +++++++------------
> drivers/iio/gyro/hid-sensor-gyro-3d.c | 27 +++++++------------
> drivers/iio/light/hid-sensor-als.c | 18 +++++--------
> drivers/iio/light/hid-sensor-prox.c | 19 +++++--------
> drivers/iio/magnetometer/hid-sensor-magn-3d.c | 20 +++++---------
> drivers/iio/pressure/hid-sensor-press.c | 19 +++++--------
> 6 files changed, 42 insertions(+), 88 deletions(-)
>
prev parent reply other threads:[~2026-05-22 16:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 23:40 [PATCH v4 0/6] iio: hid-sensor: standardize scan_type initialization Natália Salvino André
2026-05-19 23:40 ` [PATCH v4 1/6] iio: accel: HID: hid-sensor-accel-3d: Refactor channel initialization Natália Salvino André
2026-05-20 0:04 ` sashiko-bot
2026-05-19 23:40 ` [PATCH v4 2/6] iio: gyro: HID: hid-sensor-gyro-3d: " Natália Salvino André
2026-05-20 0:31 ` sashiko-bot
2026-05-19 23:40 ` [PATCH v4 3/6] iio: light: HID: hid-sensor-als: " Natália Salvino André
2026-05-20 0:38 ` sashiko-bot
2026-05-19 23:40 ` [PATCH v4 4/6] iio: light: HID: hid-sensor-prox: " Natália Salvino André
2026-05-20 0:49 ` sashiko-bot
2026-05-19 23:40 ` [PATCH v4 5/6] iio: magnetometer: HID: hid-sensor-magn-3d: " Natália Salvino André
2026-05-20 1:01 ` sashiko-bot
2026-05-19 23:40 ` [PATCH v4 6/6] iio: pressure: HID: hid-sensor-press: " Natália Salvino André
2026-05-20 1:14 ` sashiko-bot
2026-05-22 16:51 ` Jonathan Cameron [this message]
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=20260522175147.78e0e7bc@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jikos@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=lixu.zhang@intel.com \
--cc=natalia.andre@ime.usp.br \
--cc=nuno.sa@analog.com \
--cc=srinivas.pandruvada@linux.intel.com \
/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