mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] HID: iio: callback API signature match for usage_id
@ 2026-06-16 13:25 Sanjay Chitroda
  2026-06-16 13:25 ` [PATCH 1/3] iio: hid-sensor-temperature: use u32 instead of unsigned int Sanjay Chitroda
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Sanjay Chitroda @ 2026-06-16 13:25 UTC (permalink / raw)
  To: Jiri Kosina, Jonathan Cameron, Srinivas Pandruvada,
	David Lechner, Nuno Sá,
	Andy Shevchenko
  Cc: linux-input, linux-iio, linux-kernel, Sanjay Chitroda

Hi all,

Most of HID IIO driver has correct 'u32' type of usage_id with
https://lore.kernel.org/all/20260610-6-june-hid-iio-correct-usage-id-v2-0-c3c5f0720493@gmail.com/
series which is applied on iio/testing branch.

On top of the same, this series updates remaining HID IIO drivers
to use 'u32' for the usage_id parameter.

Pending list of HID IIO drivers are extracted with command line:
find drivers/iio/ -type f -name "*hid*" | xargs grep -A 5 static | \
    grep -E -A 5 "_proc_event\(|_capture_sample\(|_parse_report\(" --color | \
    grep usage_id

This matches expected callback API type as HID usage IDs are
defined as 32-bit values.

No functional changes are introduced.

Testing:
  - Compiled with W=1 for each patch in the series

Signed-off-by: Sanjay Chitroda <sanjayembeddedse@gmail.com>
---
Sanjay Chitroda (3):
      iio: hid-sensor-temperature: use u32 instead of unsigned int
      iio: hid-sensor-humidity: use u32 instead of unsigned int
      iio: hid-sensor-custom-intel-hinge: use u32 instead of unsigned int

 drivers/iio/humidity/hid-sensor-humidity.c           | 6 +++---
 drivers/iio/position/hid-sensor-custom-intel-hinge.c | 6 +++---
 drivers/iio/temperature/hid-sensor-temperature.c     | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)
---
base-commit: a50909aa46dec46de3c73235fc15a7d6f763d996
change-id: 20260616-16-jun-hid-iio-u32-api-type-180e8f0b2c37

Best regards,
--  
Sanjay Chitroda <sanjayembeddedse@gmail.com>


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

* [PATCH 1/3] iio: hid-sensor-temperature: use u32 instead of unsigned int
  2026-06-16 13:25 [PATCH 0/3] HID: iio: callback API signature match for usage_id Sanjay Chitroda
@ 2026-06-16 13:25 ` Sanjay Chitroda
  2026-06-16 13:25 ` [PATCH 2/3] iio: hid-sensor-humidity: " Sanjay Chitroda
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Sanjay Chitroda @ 2026-06-16 13:25 UTC (permalink / raw)
  To: Jiri Kosina, Jonathan Cameron, Srinivas Pandruvada,
	David Lechner, Nuno Sá,
	Andy Shevchenko
  Cc: linux-input, linux-iio, linux-kernel, Sanjay Chitroda

From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

Prefer 'u32' instead of 'unsigned int' for usage_id variable.
This matches expected callback API type and improves code clarity.

No functional change.

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

diff --git a/drivers/iio/temperature/hid-sensor-temperature.c b/drivers/iio/temperature/hid-sensor-temperature.c
index 9f628a8e5cfb..a8d3a15f9c53 100644
--- a/drivers/iio/temperature/hid-sensor-temperature.c
+++ b/drivers/iio/temperature/hid-sensor-temperature.c
@@ -125,7 +125,7 @@ static const struct iio_info temperature_info = {
 
 /* Callback handler to send event after all samples are received and captured */
 static int temperature_proc_event(struct hid_sensor_hub_device *hsdev,
-				unsigned int usage_id, void *pdev)
+				u32 usage_id, void *pdev)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(pdev);
 	struct temperature_state *temp_st = iio_priv(indio_dev);
@@ -140,7 +140,7 @@ static int temperature_proc_event(struct hid_sensor_hub_device *hsdev,
 
 /* Capture samples in local storage */
 static int temperature_capture_sample(struct hid_sensor_hub_device *hsdev,
-				unsigned int usage_id, size_t raw_len,
+				u32 usage_id, size_t raw_len,
 				char *raw_data, void *pdev)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -159,7 +159,7 @@ static int temperature_capture_sample(struct hid_sensor_hub_device *hsdev,
 static int temperature_parse_report(struct platform_device *pdev,
 				struct hid_sensor_hub_device *hsdev,
 				struct iio_chan_spec *channels,
-				unsigned int usage_id,
+				u32 usage_id,
 				struct temperature_state *st)
 {
 	int ret;

-- 
2.34.1


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

* [PATCH 2/3] iio: hid-sensor-humidity: use u32 instead of unsigned int
  2026-06-16 13:25 [PATCH 0/3] HID: iio: callback API signature match for usage_id Sanjay Chitroda
  2026-06-16 13:25 ` [PATCH 1/3] iio: hid-sensor-temperature: use u32 instead of unsigned int Sanjay Chitroda
@ 2026-06-16 13:25 ` Sanjay Chitroda
  2026-06-16 13:25 ` [PATCH 3/3] iio: hid-sensor-custom-intel-hinge: " Sanjay Chitroda
  2026-06-17 15:52 ` [PATCH 0/3] HID: iio: callback API signature match for usage_id Andy Shevchenko
  3 siblings, 0 replies; 6+ messages in thread
From: Sanjay Chitroda @ 2026-06-16 13:25 UTC (permalink / raw)
  To: Jiri Kosina, Jonathan Cameron, Srinivas Pandruvada,
	David Lechner, Nuno Sá,
	Andy Shevchenko
  Cc: linux-input, linux-iio, linux-kernel, Sanjay Chitroda

From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

Prefer 'u32' instead of 'unsigned int' for usage_id variable.
This matches expected callback API type and improves code clarity.

No functional change.

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

diff --git a/drivers/iio/humidity/hid-sensor-humidity.c b/drivers/iio/humidity/hid-sensor-humidity.c
index be2338d5f407..c376a247b137 100644
--- a/drivers/iio/humidity/hid-sensor-humidity.c
+++ b/drivers/iio/humidity/hid-sensor-humidity.c
@@ -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)
+				u32 usage_id, void *pdev)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(pdev);
 	struct hid_humidity_state *humid_st = iio_priv(indio_dev);
@@ -141,7 +141,7 @@ 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,
+				u32 usage_id, size_t raw_len,
 				char *raw_data, void *pdev)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(pdev);
@@ -161,7 +161,7 @@ static int humidity_capture_sample(struct hid_sensor_hub_device *hsdev,
 static int humidity_parse_report(struct platform_device *pdev,
 				struct hid_sensor_hub_device *hsdev,
 				struct iio_chan_spec *channels,
-				unsigned int usage_id,
+				u32 usage_id,
 				struct hid_humidity_state *st)
 {
 	int ret;

-- 
2.34.1


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

* [PATCH 3/3] iio: hid-sensor-custom-intel-hinge: use u32 instead of unsigned int
  2026-06-16 13:25 [PATCH 0/3] HID: iio: callback API signature match for usage_id Sanjay Chitroda
  2026-06-16 13:25 ` [PATCH 1/3] iio: hid-sensor-temperature: use u32 instead of unsigned int Sanjay Chitroda
  2026-06-16 13:25 ` [PATCH 2/3] iio: hid-sensor-humidity: " Sanjay Chitroda
@ 2026-06-16 13:25 ` Sanjay Chitroda
  2026-06-17 15:52 ` [PATCH 0/3] HID: iio: callback API signature match for usage_id Andy Shevchenko
  3 siblings, 0 replies; 6+ messages in thread
From: Sanjay Chitroda @ 2026-06-16 13:25 UTC (permalink / raw)
  To: Jiri Kosina, Jonathan Cameron, Srinivas Pandruvada,
	David Lechner, Nuno Sá,
	Andy Shevchenko
  Cc: linux-input, linux-iio, linux-kernel, Sanjay Chitroda

From: Sanjay Chitroda <sanjayembeddedse@gmail.com>

Prefer 'u32' instead of 'unsigned int' for usage_id variable.
This matches expected callback API type and improves code clarity.

No functional change.

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

diff --git a/drivers/iio/position/hid-sensor-custom-intel-hinge.c b/drivers/iio/position/hid-sensor-custom-intel-hinge.c
index a26d391661fd..2139ddb670c4 100644
--- a/drivers/iio/position/hid-sensor-custom-intel-hinge.c
+++ b/drivers/iio/position/hid-sensor-custom-intel-hinge.c
@@ -190,7 +190,7 @@ static const struct iio_info hinge_info = {
  * and captured.
  */
 static int hinge_proc_event(struct hid_sensor_hub_device *hsdev,
-			    unsigned int usage_id, void *priv)
+			    u32 usage_id, void *priv)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(priv);
 	struct hinge_state *st = iio_priv(indio_dev);
@@ -209,7 +209,7 @@ static int hinge_proc_event(struct hid_sensor_hub_device *hsdev,
 
 /* Capture samples in local storage */
 static int hinge_capture_sample(struct hid_sensor_hub_device *hsdev,
-				unsigned int usage_id, size_t raw_len,
+				u32 usage_id, size_t raw_len,
 				char *raw_data, void *priv)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(priv);
@@ -236,7 +236,7 @@ static int hinge_capture_sample(struct hid_sensor_hub_device *hsdev,
 static int hinge_parse_report(struct platform_device *pdev,
 			      struct hid_sensor_hub_device *hsdev,
 			      struct iio_chan_spec *channels,
-			      unsigned int usage_id, struct hinge_state *st)
+			      u32 usage_id, struct hinge_state *st)
 {
 	int ret;
 	int i;

-- 
2.34.1


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

* Re: [PATCH 0/3] HID: iio: callback API signature match for usage_id
  2026-06-16 13:25 [PATCH 0/3] HID: iio: callback API signature match for usage_id Sanjay Chitroda
                   ` (2 preceding siblings ...)
  2026-06-16 13:25 ` [PATCH 3/3] iio: hid-sensor-custom-intel-hinge: " Sanjay Chitroda
@ 2026-06-17 15:52 ` Andy Shevchenko
  2026-06-23 19:02   ` Jonathan Cameron
  3 siblings, 1 reply; 6+ messages in thread
From: Andy Shevchenko @ 2026-06-17 15:52 UTC (permalink / raw)
  To: Sanjay Chitroda
  Cc: Jiri Kosina, Jonathan Cameron, Srinivas Pandruvada,
	David Lechner, Nuno Sá,
	Andy Shevchenko, linux-input, linux-iio, linux-kernel

On Tue, Jun 16, 2026 at 06:55:19PM +0530, Sanjay Chitroda wrote:
> 
> Most of HID IIO driver has correct 'u32' type of usage_id with
> https://lore.kernel.org/all/20260610-6-june-hid-iio-correct-usage-id-v2-0-c3c5f0720493@gmail.com/
> series which is applied on iio/testing branch.
> 
> On top of the same, this series updates remaining HID IIO drivers
> to use 'u32' for the usage_id parameter.
> 
> Pending list of HID IIO drivers are extracted with command line:
> find drivers/iio/ -type f -name "*hid*" | xargs grep -A 5 static | \
>     grep -E -A 5 "_proc_event\(|_capture_sample\(|_parse_report\(" --color | \
>     grep usage_id

I recommend to get used with `git grep ...` which is more powerful and much
faster (on a Git index).

	git grep -lw 'u[^3].* usage_id' -- drivers/iio/

for the list of files, and

	git grep -np -w 'u[^3].* usage_id' -- drivers/iio/

for a better view.

(It gives one false positive, though :-)

> This matches expected callback API type as HID usage IDs are
> defined as 32-bit values.
> 
> No functional changes are introduced.
> 
> Testing:
>   - Compiled with W=1 for each patch in the series

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

Jonathan, it seems the missing part of the initial unification. Please, apply
to your testing branch.

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 0/3] HID: iio: callback API signature match for usage_id
  2026-06-17 15:52 ` [PATCH 0/3] HID: iio: callback API signature match for usage_id Andy Shevchenko
@ 2026-06-23 19:02   ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2026-06-23 19:02 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Sanjay Chitroda, Jiri Kosina, Srinivas Pandruvada, David Lechner,
	Nuno Sá,
	Andy Shevchenko, linux-input, linux-iio, linux-kernel

On Wed, 17 Jun 2026 18:52:51 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Tue, Jun 16, 2026 at 06:55:19PM +0530, Sanjay Chitroda wrote:
> > 
> > Most of HID IIO driver has correct 'u32' type of usage_id with
> > https://lore.kernel.org/all/20260610-6-june-hid-iio-correct-usage-id-v2-0-c3c5f0720493@gmail.com/
> > series which is applied on iio/testing branch.
> > 
> > On top of the same, this series updates remaining HID IIO drivers
> > to use 'u32' for the usage_id parameter.
> > 
> > Pending list of HID IIO drivers are extracted with command line:
> > find drivers/iio/ -type f -name "*hid*" | xargs grep -A 5 static | \
> >     grep -E -A 5 "_proc_event\(|_capture_sample\(|_parse_report\(" --color | \
> >     grep usage_id  
> 
> I recommend to get used with `git grep ...` which is more powerful and much
> faster (on a Git index).
> 
> 	git grep -lw 'u[^3].* usage_id' -- drivers/iio/
> 
> for the list of files, and
> 
> 	git grep -np -w 'u[^3].* usage_id' -- drivers/iio/
> 
> for a better view.
> 
> (It gives one false positive, though :-)
> 
> > This matches expected callback API type as HID usage IDs are
> > defined as 32-bit values.
> > 
> > No functional changes are introduced.
> > 
> > Testing:
> >   - Compiled with W=1 for each patch in the series  
> 
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> 
> Jonathan, it seems the missing part of the initial unification. Please, apply
> to your testing branch.
Applied to the testing branch of iio.git.

Thanks,

Jonathan

> 


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

end of thread, other threads:[~2026-06-23 19:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-16 13:25 [PATCH 0/3] HID: iio: callback API signature match for usage_id Sanjay Chitroda
2026-06-16 13:25 ` [PATCH 1/3] iio: hid-sensor-temperature: use u32 instead of unsigned int Sanjay Chitroda
2026-06-16 13:25 ` [PATCH 2/3] iio: hid-sensor-humidity: " Sanjay Chitroda
2026-06-16 13:25 ` [PATCH 3/3] iio: hid-sensor-custom-intel-hinge: " Sanjay Chitroda
2026-06-17 15:52 ` [PATCH 0/3] HID: iio: callback API signature match for usage_id Andy Shevchenko
2026-06-23 19:02   ` Jonathan Cameron

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

all inboxes | Powered by JetHome®