Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors
@ 2026-05-24 19:20 Sanjay Chitroda
  2026-05-24 19:20 ` [PATCH v4 01/36] iio: hid-sensors: add missing blank line after declarations Sanjay Chitroda
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Sanjay Chitroda @ 2026-05-24 19:20 UTC (permalink / raw)
  To: jikos, jic23, srinivas.pandruvada
  Cc: dlechner, nuno.sa, andy, sanjayembeddedse, sakari.ailus,
	linux-input, linux-iio, linux-kernel

From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

Key highlights:
- 0000-0024: General cleanup and kernel few coding style fixes across HID IIO drivers
- 0025: Remove unused iio_dev argument from HID IIO sensor helper
- 0026: Introduce devm_hid_sensor_setup_trigger() device-managed API
- 0027-0036: Convert HID IIO sensor drivers to use the new devm-based trigger setup

changes in v4:
- Extend the series to cover remaining HID IIO drivers with devm API usage
- Reorder patches to place cleanup and warning fix at beginning and,
  devm-related changes toward the end based on feedback from David
- v3 series -> https://lore.kernel.org/all/20260509101040.791404-1-sanjayembedded@gmail.com/
changes in v3:
- Added cleanup and prepratory changes before adding devm_ API
  conversion based on self review: 0002, 0004, 0006, 0007 and 0008
- Address andy's review comment on commit message and coding style
- v2 series -> https://lore.kernel.org/all/20260429175918.2541914-1-sanjayembedded@gmail.com/
changes in v2:
- Following input from Jonathan and Andy, squash initial patch v1
  series in single change as individual change should not break anything
- Add devm API support and two driver using the same
- v1 series -> https://lore.kernel.org/all/20260428071613.1134053-1-sanjayembedded@gmail.com/

Testing:
  - Compiled with W=1 for each patch in series
  - Build-tested on QEMU x86_64

P.S.
- Sashiko reported an issue in a different driver and noted that it is not
  introduced by this series. I have taken this feedback into account and
  will address the actual issue in a separate series focus on that driver.
- Once this series is merged into the IIO tree, a number of HID IIO
  drivers will become available to fully converted to devm API usage.
- The changes are organized across drivers to keep similar modifications
  grouped together for consistency, making the series easier to review,
  rather than grouping all changes per driver.

Thanks,
Sanjay Chitroda

Sanjay Chitroda (36):
  iio: hid-sensors: add missing blank line after declarations
  iio: gyro: hid-sensor-gyro-3d: use u32 instead of unsigned
  iio: accel: hid-sensor-accel-3d: use u32 instead of unsigned
  iio: light: hid-sensor-als: use u32 instead of unsigned
  iio: light: hid-sensor-prox: use u32 instead of unsigned
  iio: orientation: hid-sensor-incl-3d: use u32 instead of unsigned
  iio: orientation: hid-sensor-rotation: use u32 instead of unsigned
  iio: pressure: hid-sensor-press: use u32 instead of unsigned
  iio: humidity: hid-sensor-humidity: align parenthesis for readability
  iio: gyro: hid-sensor-gyro-3d: align parenthesis for readability
  iio: magnetometer: hid-sensor-magn-3d: align parenthesis for
    readability
  iio: humidity: hid-sensor-humidity: use common device for devres
  iio: position: hid-sensor-custom-intel-hinge: use common device for
    devres
  iio: temperature: hid-sensor-temperature: use common device for devres
  iio: humidity: hid-sensor-humidity: use local struct device
  iio: gyro: hid-sensor-gyro-3d: use local struct device
  iio: accel: hid-sensor-accel-3d: use local struct device
  iio: light: hid-sensor-als: use local struct device
  iio: light: hid-sensor-prox: use local struct device
  iio: magnetometer: hid-sensor-magn-3d: use local struct device
  iio: orientation: hid-sensor-incl-3d: use local struct device
  iio: orientation: hid-sensor-rotation: use local struct device
  iio: position: hid-sensor-custom-intel-hinge: use local struct device
  iio: pressure: hid-sensor-press: use local struct device
  iio: hid-sensors: remove unused iio_dev argument
  iio: hid-sensors: introduce device managed API
  iio: gyro: hid-sensor-gyro-3d: drop hid_sensor_remove_trigger() using
    devm API
  iio: humidity: hid-sensor-humidity: drop hid_sensor_remove_trigger()
    using devm API
  iio: light: hid-sensor-prox: drop hid_sensor_remove_trigger() using
    devm API
  iio: light: hid-sensor-als: drop hid_sensor_remove_trigger() using
    devm API
  iio: magnetometer: hid-sensor-magn-3d: drop
    hid_sensor_remove_trigger() using devm API
  iio: orientation: hid-sensor-incl-3d: drop hid_sensor_remove_trigger()
    using devm API
  iio: orientation: hid-sensor-rotation: drop
    hid_sensor_remove_trigger() using devm API
  iio: position: hid-sensor-custom-intel-hinge: drop
    hid_sensor_remove_trigger() using devm API
  iio: pressure: hid-sensor-press: drop hid_sensor_remove_trigger()
    using devm API
  iio: temperature: hid-sensor-temperature: drop
    hid_sensor_remove_trigger() using devm API

 drivers/iio/accel/hid-sensor-accel-3d.c       |  30 ++---
 .../common/hid-sensors/hid-sensor-trigger.c   |  24 +++-
 .../common/hid-sensors/hid-sensor-trigger.h   |   5 +-
 drivers/iio/gyro/hid-sensor-gyro-3d.c         |  96 ++++++++-------
 drivers/iio/humidity/hid-sensor-humidity.c    |  61 +++++-----
 drivers/iio/light/hid-sensor-als.c            |  31 +++--
 drivers/iio/light/hid-sensor-prox.c           |  30 ++---
 drivers/iio/magnetometer/hid-sensor-magn-3d.c | 112 +++++++++---------
 drivers/iio/orientation/hid-sensor-incl-3d.c  |  36 +++---
 drivers/iio/orientation/hid-sensor-rotation.c |  38 +++---
 .../position/hid-sensor-custom-intel-hinge.c  |  27 ++---
 drivers/iio/pressure/hid-sensor-press.c       |  36 +++---
 .../iio/temperature/hid-sensor-temperature.c  |  15 +--
 13 files changed, 264 insertions(+), 277 deletions(-)


base-commit: 08297ca8422541dde6c8b7e6b1d68bd4aa4568ef
-- 
2.34.1


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

* [PATCH v4 01/36] iio: hid-sensors: add missing blank line after declarations
  2026-05-24 19:20 [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors Sanjay Chitroda
@ 2026-05-24 19:20 ` Sanjay Chitroda
  2026-05-24 19:20 ` [PATCH v4 02/36] iio: gyro: hid-sensor-gyro-3d: use u32 instead of unsigned Sanjay Chitroda
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sanjay Chitroda @ 2026-05-24 19:20 UTC (permalink / raw)
  To: jikos, jic23, srinivas.pandruvada
  Cc: dlechner, nuno.sa, andy, sanjayembeddedse, sakari.ailus,
	linux-input, linux-iio, linux-kernel

From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

Add a blank line after variable declarations to improve
readability and align with kernel coding style.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
---
Changes in v4:
- Rectify commit message with input from David
---
 drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
index 417c4ab8c1b2..c8ccf96f3d03 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c
@@ -314,7 +314,9 @@ static int __maybe_unused hid_sensor_resume(struct device *dev)
 {
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev);
+
 	schedule_work(&attrb->work);
+
 	return 0;
 }
 
@@ -322,6 +324,7 @@ static int __maybe_unused hid_sensor_runtime_resume(struct device *dev)
 {
 	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 	struct hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev);
+
 	return _hid_sensor_power_state(attrb, true);
 }
 
-- 
2.34.1


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

* [PATCH v4 02/36] iio: gyro: hid-sensor-gyro-3d: use u32 instead of unsigned
  2026-05-24 19:20 [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors Sanjay Chitroda
  2026-05-24 19:20 ` [PATCH v4 01/36] iio: hid-sensors: add missing blank line after declarations Sanjay Chitroda
@ 2026-05-24 19:20 ` Sanjay Chitroda
  2026-05-24 19:20 ` [PATCH v4 03/36] iio: accel: hid-sensor-accel-3d: " Sanjay Chitroda
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sanjay Chitroda @ 2026-05-24 19:20 UTC (permalink / raw)
  To: jikos, jic23, srinivas.pandruvada
  Cc: dlechner, nuno.sa, andy, sanjayembeddedse, sakari.ailus,
	linux-input, linux-iio, linux-kernel

From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

Prefer 'u32' instead of bare 'unsigned' variable to improve code
clarity and consistency with kernel style.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
---
Changes in v4:
- Use 'u32' instead of 'unsigned int' as driver is already uses that and respective prototype has same data type with input from David and Andy
- Link to v3 -> https://lore.kernel.org/all/20260509101040.791404-5-sanjayembedded@gmail.com/
---
 drivers/iio/gyro/hid-sensor-gyro-3d.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/gyro/hid-sensor-gyro-3d.c b/drivers/iio/gyro/hid-sensor-gyro-3d.c
index c340cc899a7c..020812639947 100644
--- a/drivers/iio/gyro/hid-sensor-gyro-3d.c
+++ b/drivers/iio/gyro/hid-sensor-gyro-3d.c
@@ -187,7 +187,7 @@ static const struct iio_info gyro_3d_info = {
 
 /* Callback handler to send event after all samples are received and captured */
 static int gyro_3d_proc_event(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				void *priv)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(priv);
@@ -209,7 +209,7 @@ static int gyro_3d_proc_event(struct hid_sensor_hub_device *hsdev,
 
 /* Capture samples in local storage */
 static int gyro_3d_capture_sample(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				size_t raw_len, char *raw_data,
 				void *priv)
 {
@@ -244,7 +244,7 @@ static int gyro_3d_capture_sample(struct hid_sensor_hub_device *hsdev,
 static int gyro_3d_parse_report(struct platform_device *pdev,
 				struct hid_sensor_hub_device *hsdev,
 				struct iio_chan_spec *channels,
-				unsigned usage_id,
+				u32 usage_id,
 				struct gyro_3d_state *st)
 {
 	int ret;
-- 
2.34.1


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

* [PATCH v4 03/36] iio: accel: hid-sensor-accel-3d: use u32 instead of unsigned
  2026-05-24 19:20 [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors Sanjay Chitroda
  2026-05-24 19:20 ` [PATCH v4 01/36] iio: hid-sensors: add missing blank line after declarations Sanjay Chitroda
  2026-05-24 19:20 ` [PATCH v4 02/36] iio: gyro: hid-sensor-gyro-3d: use u32 instead of unsigned Sanjay Chitroda
@ 2026-05-24 19:20 ` Sanjay Chitroda
  2026-05-24 19:20 ` [PATCH v4 04/36] iio: light: hid-sensor-als: " Sanjay Chitroda
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sanjay Chitroda @ 2026-05-24 19:20 UTC (permalink / raw)
  To: jikos, jic23, srinivas.pandruvada
  Cc: dlechner, nuno.sa, andy, sanjayembeddedse, sakari.ailus,
	linux-input, linux-iio, linux-kernel

From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

Prefer 'u32' instead of bare 'unsigned' variable to improve code
clarity and consistency with kernel style.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
---
 drivers/iio/accel/hid-sensor-accel-3d.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/accel/hid-sensor-accel-3d.c b/drivers/iio/accel/hid-sensor-accel-3d.c
index 2ff591b3458f..67fb8efd6b10 100644
--- a/drivers/iio/accel/hid-sensor-accel-3d.c
+++ b/drivers/iio/accel/hid-sensor-accel-3d.c
@@ -233,7 +233,7 @@ static void hid_sensor_push_data(struct iio_dev *indio_dev, void *data,
 
 /* Callback handler to send event after all samples are received and captured */
 static int accel_3d_proc_event(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				void *priv)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(priv);
@@ -257,7 +257,7 @@ static int accel_3d_proc_event(struct hid_sensor_hub_device *hsdev,
 
 /* Capture samples in local storage */
 static int accel_3d_capture_sample(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				size_t raw_len, char *raw_data,
 				void *priv)
 {
@@ -293,7 +293,7 @@ static int accel_3d_capture_sample(struct hid_sensor_hub_device *hsdev,
 static int accel_3d_parse_report(struct platform_device *pdev,
 				struct hid_sensor_hub_device *hsdev,
 				struct iio_chan_spec *channels,
-				unsigned usage_id,
+				u32 usage_id,
 				struct accel_3d_state *st)
 {
 	int ret;
-- 
2.34.1


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

* [PATCH v4 04/36] iio: light: hid-sensor-als: use u32 instead of unsigned
  2026-05-24 19:20 [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors Sanjay Chitroda
                   ` (2 preceding siblings ...)
  2026-05-24 19:20 ` [PATCH v4 03/36] iio: accel: hid-sensor-accel-3d: " Sanjay Chitroda
@ 2026-05-24 19:20 ` Sanjay Chitroda
  2026-05-24 19:20 ` [PATCH v4 05/36] iio: light: hid-sensor-prox: " Sanjay Chitroda
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sanjay Chitroda @ 2026-05-24 19:20 UTC (permalink / raw)
  To: jikos, jic23, srinivas.pandruvada
  Cc: dlechner, nuno.sa, andy, sanjayembeddedse, sakari.ailus,
	linux-input, linux-iio, linux-kernel

From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

Prefer 'u32' instead of bare 'unsigned' variable to improve code
clarity and consistency with kernel style.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
---
 drivers/iio/light/hid-sensor-als.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/light/hid-sensor-als.c b/drivers/iio/light/hid-sensor-als.c
index 384572844162..ac654b2bbc1b 100644
--- a/drivers/iio/light/hid-sensor-als.c
+++ b/drivers/iio/light/hid-sensor-als.c
@@ -251,7 +251,7 @@ static const struct iio_info als_info = {
 
 /* Callback handler to send event after all samples are received and captured */
 static int als_proc_event(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				void *priv)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(priv);
@@ -273,7 +273,7 @@ static int als_proc_event(struct hid_sensor_hub_device *hsdev,
 
 /* Capture samples in local storage */
 static int als_capture_sample(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				size_t raw_len, char *raw_data,
 				void *priv)
 {
@@ -315,7 +315,7 @@ static int als_capture_sample(struct hid_sensor_hub_device *hsdev,
 /* Parse report which is specific to an usage id*/
 static int als_parse_report(struct platform_device *pdev,
 				struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				struct als_state *st)
 {
 	struct iio_chan_spec *channels;
-- 
2.34.1


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

* [PATCH v4 05/36] iio: light: hid-sensor-prox: use u32 instead of unsigned
  2026-05-24 19:20 [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors Sanjay Chitroda
                   ` (3 preceding siblings ...)
  2026-05-24 19:20 ` [PATCH v4 04/36] iio: light: hid-sensor-als: " Sanjay Chitroda
@ 2026-05-24 19:20 ` Sanjay Chitroda
  2026-05-24 19:20 ` [PATCH v4 06/36] iio: orientation: hid-sensor-incl-3d: " Sanjay Chitroda
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sanjay Chitroda @ 2026-05-24 19:20 UTC (permalink / raw)
  To: jikos, jic23, srinivas.pandruvada
  Cc: dlechner, nuno.sa, andy, sanjayembeddedse, sakari.ailus,
	linux-input, linux-iio, linux-kernel

From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

Prefer 'u32' instead of bare 'unsigned' variable to improve code
clarity and consistency with kernel style.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
---
 drivers/iio/light/hid-sensor-prox.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/light/hid-sensor-prox.c b/drivers/iio/light/hid-sensor-prox.c
index efa904a70d0e..ac55808f161b 100644
--- a/drivers/iio/light/hid-sensor-prox.c
+++ b/drivers/iio/light/hid-sensor-prox.c
@@ -176,7 +176,7 @@ static const struct iio_info prox_info = {
 
 /* Callback handler to send event after all samples are received and captured */
 static int prox_proc_event(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				void *priv)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(priv);
@@ -193,7 +193,7 @@ static int prox_proc_event(struct hid_sensor_hub_device *hsdev,
 
 /* Capture samples in local storage */
 static int prox_capture_sample(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				size_t raw_len, char *raw_data,
 				void *priv)
 {
-- 
2.34.1


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

* [PATCH v4 06/36] iio: orientation: hid-sensor-incl-3d: use u32 instead of unsigned
  2026-05-24 19:20 [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors Sanjay Chitroda
                   ` (4 preceding siblings ...)
  2026-05-24 19:20 ` [PATCH v4 05/36] iio: light: hid-sensor-prox: " Sanjay Chitroda
@ 2026-05-24 19:20 ` Sanjay Chitroda
  2026-05-24 19:20 ` [PATCH v4 07/36] iio: orientation: hid-sensor-rotation: " Sanjay Chitroda
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Sanjay Chitroda @ 2026-05-24 19:20 UTC (permalink / raw)
  To: jikos, jic23, srinivas.pandruvada
  Cc: dlechner, nuno.sa, andy, sanjayembeddedse, sakari.ailus,
	linux-input, linux-iio, linux-kernel

From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

Prefer 'u32' instead of bare 'unsigned' variable to improve code
clarity and consistency with kernel style.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
---
 drivers/iio/orientation/hid-sensor-incl-3d.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/orientation/hid-sensor-incl-3d.c b/drivers/iio/orientation/hid-sensor-incl-3d.c
index 4e23a598a3fb..c7fbff498be7 100644
--- a/drivers/iio/orientation/hid-sensor-incl-3d.c
+++ b/drivers/iio/orientation/hid-sensor-incl-3d.c
@@ -189,7 +189,7 @@ static const struct iio_info incl_3d_info = {
 
 /* Callback handler to send event after all samples are received and captured */
 static int incl_3d_proc_event(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				void *priv)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(priv);
@@ -212,7 +212,7 @@ static int incl_3d_proc_event(struct hid_sensor_hub_device *hsdev,
 
 /* Capture samples in local storage */
 static int incl_3d_capture_sample(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				size_t raw_len, char *raw_data,
 				void *priv)
 {
@@ -247,7 +247,7 @@ static int incl_3d_capture_sample(struct hid_sensor_hub_device *hsdev,
 static int incl_3d_parse_report(struct platform_device *pdev,
 				struct hid_sensor_hub_device *hsdev,
 				struct iio_chan_spec *channels,
-				unsigned usage_id,
+				u32 usage_id,
 				struct incl_3d_state *st)
 {
 	int ret;
-- 
2.34.1


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

* [PATCH v4 07/36] iio: orientation: hid-sensor-rotation: use u32 instead of unsigned
  2026-05-24 19:20 [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors Sanjay Chitroda
                   ` (5 preceding siblings ...)
  2026-05-24 19:20 ` [PATCH v4 06/36] iio: orientation: hid-sensor-incl-3d: " Sanjay Chitroda
@ 2026-05-24 19:20 ` Sanjay Chitroda
  2026-05-24 19:20 ` [PATCH v4 08/36] iio: pressure: hid-sensor-press: " Sanjay Chitroda
  2026-05-24 19:20 ` [PATCH v4 09/36] iio: humidity: hid-sensor-humidity: align parenthesis for readability Sanjay Chitroda
  8 siblings, 0 replies; 10+ messages in thread
From: Sanjay Chitroda @ 2026-05-24 19:20 UTC (permalink / raw)
  To: jikos, jic23, srinivas.pandruvada
  Cc: dlechner, nuno.sa, andy, sanjayembeddedse, sakari.ailus,
	linux-input, linux-iio, linux-kernel

From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

Prefer 'u32' instead of bare 'unsigned' variable to improve code
clarity and consistency with kernel style.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
---
 drivers/iio/orientation/hid-sensor-rotation.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/orientation/hid-sensor-rotation.c b/drivers/iio/orientation/hid-sensor-rotation.c
index 4a11e4555099..20563d8efaf6 100644
--- a/drivers/iio/orientation/hid-sensor-rotation.c
+++ b/drivers/iio/orientation/hid-sensor-rotation.c
@@ -176,7 +176,7 @@ static const struct iio_info dev_rot_info = {
 
 /* Callback handler to send event after all samples are received and captured */
 static int dev_rot_proc_event(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				void *priv)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(priv);
@@ -209,7 +209,7 @@ static int dev_rot_proc_event(struct hid_sensor_hub_device *hsdev,
 
 /* Capture samples in local storage */
 static int dev_rot_capture_sample(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				size_t raw_len, char *raw_data,
 				void *priv)
 {
@@ -240,7 +240,7 @@ static int dev_rot_capture_sample(struct hid_sensor_hub_device *hsdev,
 /* Parse report which is specific to an usage id*/
 static int dev_rot_parse_report(struct platform_device *pdev,
 				struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				struct dev_rot_state *st)
 {
 	int ret;
-- 
2.34.1


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

* [PATCH v4 08/36] iio: pressure: hid-sensor-press: use u32 instead of unsigned
  2026-05-24 19:20 [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors Sanjay Chitroda
                   ` (6 preceding siblings ...)
  2026-05-24 19:20 ` [PATCH v4 07/36] iio: orientation: hid-sensor-rotation: " Sanjay Chitroda
@ 2026-05-24 19:20 ` Sanjay Chitroda
  2026-05-24 19:20 ` [PATCH v4 09/36] iio: humidity: hid-sensor-humidity: align parenthesis for readability Sanjay Chitroda
  8 siblings, 0 replies; 10+ messages in thread
From: Sanjay Chitroda @ 2026-05-24 19:20 UTC (permalink / raw)
  To: jikos, jic23, srinivas.pandruvada
  Cc: dlechner, nuno.sa, andy, sanjayembeddedse, sakari.ailus,
	linux-input, linux-iio, linux-kernel

From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

Prefer 'u32' instead of bare 'unsigned' variable to improve code
clarity and consistency with kernel style.

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
---
 drivers/iio/pressure/hid-sensor-press.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/pressure/hid-sensor-press.c b/drivers/iio/pressure/hid-sensor-press.c
index 5f1d6abda3e4..a5db5220d3d5 100644
--- a/drivers/iio/pressure/hid-sensor-press.c
+++ b/drivers/iio/pressure/hid-sensor-press.c
@@ -165,7 +165,7 @@ static const struct iio_info press_info = {
 
 /* Callback handler to send event after all samples are received and captured */
 static int press_proc_event(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				void *priv)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(priv);
@@ -186,7 +186,7 @@ static int press_proc_event(struct hid_sensor_hub_device *hsdev,
 
 /* Capture samples in local storage */
 static int press_capture_sample(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				u32 usage_id,
 				size_t raw_len, char *raw_data,
 				void *priv)
 {
@@ -214,7 +214,7 @@ static int press_capture_sample(struct hid_sensor_hub_device *hsdev,
 static int press_parse_report(struct platform_device *pdev,
 				struct hid_sensor_hub_device *hsdev,
 				struct iio_chan_spec *channels,
-				unsigned usage_id,
+				u32 usage_id,
 				struct press_state *st)
 {
 	int ret;
-- 
2.34.1


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

* [PATCH v4 09/36] iio: humidity: hid-sensor-humidity: align parenthesis for readability
  2026-05-24 19:20 [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors Sanjay Chitroda
                   ` (7 preceding siblings ...)
  2026-05-24 19:20 ` [PATCH v4 08/36] iio: pressure: hid-sensor-press: " Sanjay Chitroda
@ 2026-05-24 19:20 ` Sanjay Chitroda
  8 siblings, 0 replies; 10+ messages in thread
From: Sanjay Chitroda @ 2026-05-24 19:20 UTC (permalink / raw)
  To: jikos, jic23, srinivas.pandruvada
  Cc: dlechner, nuno.sa, andy, sanjayembeddedse, sakari.ailus,
	linux-input, linux-iio, linux-kernel

From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

Adjust alignment of parentheses to improve readability and
maintain consistency with kernel coding style

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
---
 drivers/iio/humidity/hid-sensor-humidity.c | 46 +++++++++++-----------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/iio/humidity/hid-sensor-humidity.c b/drivers/iio/humidity/hid-sensor-humidity.c
index be2338d5f407..6fed019f4099 100644
--- a/drivers/iio/humidity/hid-sensor-humidity.c
+++ b/drivers/iio/humidity/hid-sensor-humidity.c
@@ -45,7 +45,7 @@ static const struct iio_chan_spec humidity_channels[] = {
 
 /* Adjust channel real bits based on report descriptor */
 static void humidity_adjust_channel_bit_mask(struct iio_chan_spec *channels,
-					int channel, int size)
+					     int channel, int size)
 {
 	channels[channel].scan_type.sign = 's';
 	/* Real storage bits will change based on the report desc. */
@@ -55,8 +55,8 @@ static void humidity_adjust_channel_bit_mask(struct iio_chan_spec *channels,
 }
 
 static int humidity_read_raw(struct iio_dev *indio_dev,
-				struct iio_chan_spec const *chan,
-				int *val, int *val2, long mask)
+			     struct iio_chan_spec const *chan,
+			     int *val, int *val2, long mask)
 {
 	struct hid_humidity_state *humid_st = iio_priv(indio_dev);
 
@@ -101,8 +101,8 @@ static int humidity_read_raw(struct iio_dev *indio_dev,
 }
 
 static int humidity_write_raw(struct iio_dev *indio_dev,
-				struct iio_chan_spec const *chan,
-				int val, int val2, long mask)
+			      struct iio_chan_spec const *chan,
+			      int val, int val2, long mask)
 {
 	struct hid_humidity_state *humid_st = iio_priv(indio_dev);
 
@@ -127,7 +127,7 @@ static const struct iio_info humidity_info = {
 
 /* Callback handler to send event after all samples are received and captured */
 static int humidity_proc_event(struct hid_sensor_hub_device *hsdev,
-				unsigned int usage_id, void *pdev)
+			       unsigned int usage_id, void *pdev)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(pdev);
 	struct hid_humidity_state *humid_st = iio_priv(indio_dev);
@@ -141,8 +141,8 @@ static int humidity_proc_event(struct hid_sensor_hub_device *hsdev,
 
 /* Capture samples in local storage */
 static int humidity_capture_sample(struct hid_sensor_hub_device *hsdev,
-				unsigned int usage_id, size_t raw_len,
-				char *raw_data, void *pdev)
+				   unsigned int usage_id, size_t raw_len,
+				   char *raw_data, void *pdev)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(pdev);
 	struct hid_humidity_state *humid_st = iio_priv(indio_dev);
@@ -159,17 +159,17 @@ static int humidity_capture_sample(struct hid_sensor_hub_device *hsdev,
 
 /* Parse report which is specific to an usage id */
 static int humidity_parse_report(struct platform_device *pdev,
-				struct hid_sensor_hub_device *hsdev,
-				struct iio_chan_spec *channels,
-				unsigned int usage_id,
-				struct hid_humidity_state *st)
+				 struct hid_sensor_hub_device *hsdev,
+				 struct iio_chan_spec *channels,
+				 unsigned int usage_id,
+				 struct hid_humidity_state *st)
 {
 	int ret;
 
 	ret = sensor_hub_input_get_attribute_info(hsdev, HID_INPUT_REPORT,
-					usage_id,
-					HID_USAGE_SENSOR_ATMOSPHERIC_HUMIDITY,
-					&st->humidity_attr);
+						  usage_id,
+						  HID_USAGE_SENSOR_ATMOSPHERIC_HUMIDITY,
+						  &st->humidity_attr);
 	if (ret < 0)
 		return ret;
 
@@ -208,20 +208,20 @@ static int hid_humidity_probe(struct platform_device *pdev)
 	humid_st->common_attributes.pdev = pdev;
 
 	ret = hid_sensor_parse_common_attributes(hsdev,
-					HID_USAGE_SENSOR_HUMIDITY,
-					&humid_st->common_attributes,
-					humidity_sensitivity_addresses,
-					ARRAY_SIZE(humidity_sensitivity_addresses));
+						 HID_USAGE_SENSOR_HUMIDITY,
+						 &humid_st->common_attributes,
+						 humidity_sensitivity_addresses,
+						 ARRAY_SIZE(humidity_sensitivity_addresses));
 	if (ret)
 		return ret;
 
 	humid_chans = devm_kmemdup(&indio_dev->dev, humidity_channels,
-					sizeof(humidity_channels), GFP_KERNEL);
+				   sizeof(humidity_channels), GFP_KERNEL);
 	if (!humid_chans)
 		return -ENOMEM;
 
 	ret = humidity_parse_report(pdev, hsdev, humid_chans,
-				HID_USAGE_SENSOR_HUMIDITY, humid_st);
+				    HID_USAGE_SENSOR_HUMIDITY, humid_st);
 	if (ret)
 		return ret;
 
@@ -234,7 +234,7 @@ static int hid_humidity_probe(struct platform_device *pdev)
 	atomic_set(&humid_st->common_attributes.data_ready, 0);
 
 	ret = hid_sensor_setup_trigger(indio_dev, name,
-				&humid_st->common_attributes);
+				       &humid_st->common_attributes);
 	if (ret)
 		return ret;
 
@@ -242,7 +242,7 @@ static int hid_humidity_probe(struct platform_device *pdev)
 
 	humidity_callbacks.pdev = pdev;
 	ret = sensor_hub_register_callback(hsdev, HID_USAGE_SENSOR_HUMIDITY,
-					&humidity_callbacks);
+					   &humidity_callbacks);
 	if (ret)
 		goto error_remove_trigger;
 
-- 
2.34.1


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

end of thread, other threads:[~2026-05-24 19:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-24 19:20 [PATCH v4 00/36] HID: iio: basic clean up and introduce devm_ API for HID sensors Sanjay Chitroda
2026-05-24 19:20 ` [PATCH v4 01/36] iio: hid-sensors: add missing blank line after declarations Sanjay Chitroda
2026-05-24 19:20 ` [PATCH v4 02/36] iio: gyro: hid-sensor-gyro-3d: use u32 instead of unsigned Sanjay Chitroda
2026-05-24 19:20 ` [PATCH v4 03/36] iio: accel: hid-sensor-accel-3d: " Sanjay Chitroda
2026-05-24 19:20 ` [PATCH v4 04/36] iio: light: hid-sensor-als: " Sanjay Chitroda
2026-05-24 19:20 ` [PATCH v4 05/36] iio: light: hid-sensor-prox: " Sanjay Chitroda
2026-05-24 19:20 ` [PATCH v4 06/36] iio: orientation: hid-sensor-incl-3d: " Sanjay Chitroda
2026-05-24 19:20 ` [PATCH v4 07/36] iio: orientation: hid-sensor-rotation: " Sanjay Chitroda
2026-05-24 19:20 ` [PATCH v4 08/36] iio: pressure: hid-sensor-press: " Sanjay Chitroda
2026-05-24 19:20 ` [PATCH v4 09/36] iio: humidity: hid-sensor-humidity: align parenthesis for readability Sanjay Chitroda

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