# Re: \[PATCH, 2/6\] HID-Sensors: Sensor framework

- List: linux-input
- 2 messages, 2 authors
- Page: https://ratatoskr.run/linux-input/2012/06/8919773/t

## Re: \[PATCH, 2/6\] HID-Sensors: Sensor framework

- From: Jiri Kosina \<hidden\>
- Date: 2012-06-26 12:02:08 
- Message: https://ratatoskr.run/linux-input/2012/06/8919773.md

```text
On Mon, 25 Jun 2012, srinivas pandruvada wrote:

> Adding processing for HID Sensor usage table as defined by
> HID 1.12, Request #: HUTRR39, dated 05 May, 2011.
> This driver uses HID driver framework to register, send and
> receive events.
> This uses MFD framework, so that actual processing for a
> specific usage id can be done in a different driver. For
> example an accelerometer driver can be a separate driver and
> use the interface provided by this driver to register for
> events.
> 
> Signed-off-by: srinivas pandruvada <redacted>
> ---
>  drivers/hid/Kconfig            |   18 +
>  drivers/hid/Makefile           |    1 +
>  drivers/hid/hid-sensor-hub.c   |  883 ++++++++++++++++++++++++++++++++++++++++
>  include/linux/hid-sensor-hub.h |   99 +++++
>  include/linux/hid-sensor-ids.h |  116 ++++++
>  5 files changed, 1117 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/hid/hid-sensor-hub.c
>  create mode 100644 include/linux/hid-sensor-hub.h
>  create mode 100644 include/linux/hid-sensor-ids.h
> 
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
> index ffddcba..0c86ab0 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -644,6 +644,24 @@ config HID_ZYDACRON
>  	---help---
>  	Support for Zydacron remote control.
>  
> +config HID_SENSOR_HUB
> +	tristate "HID Sensors framework support"
> +	depends on USB_HID
> +	select MFD_CORE
> +	default n
> +	-- help---
> +	  Support for HID Sensor framework. This will provide MFD framework for
> +	  adding different sensors, using HID sensor usage table. This defines
> +	  a set of interface functions to register callbacks for events so
> +	  that the events are transferred to user space using either input
> +	  or IIO ineterfaces.
> +
> +config HID_SENSOR_HUB_DEBUG
> +	tristate "HID Sensor debug support"
> +	default n
> +	-- help---
> +	  Debug support for Hid sensors. Enable this flag to debug only.
> +

Why not use debugfs (which is what the rest of the HID code and drivers do 
for debugging)?

Thanks,

-- 
Jiri Kosina
SUSE Labs
```

## RE: \[PATCH, 2/6\] HID-Sensors: Sensor framework

- From: Pandruvada, Srinivas \<hidden\>
- Date: 2012-06-26 16:00:29 
- Message: https://ratatoskr.run/linux-input/2012/06/8919776.md

```text
OK. I can use debugfs. If you have some other comments, I can bundle all of them together in the next set.

Thanks,
Srinivas

-----Original Message-----
From: <redacted> [mailto:<redacted>] On Behalf Of Jiri Kosina
Sent: Tuesday, June 26, 2012 5:02 AM
To: Pandruvada, Srinivas
Cc: <redacted>; <redacted>; <redacted>
Subject: Re: [PATCH, 2/6] HID-Sensors: Sensor framework

On Mon, 25 Jun 2012, srinivas pandruvada wrote:

> Adding processing for HID Sensor usage table as defined by HID 1.12, 
> Request #: HUTRR39, dated 05 May, 2011.
> This driver uses HID driver framework to register, send and receive 
> events.
> This uses MFD framework, so that actual processing for a specific 
> usage id can be done in a different driver. For example an 
> accelerometer driver can be a separate driver and use the interface 
> provided by this driver to register for events.
> 
> Signed-off-by: srinivas pandruvada <redacted>
> ---
>  drivers/hid/Kconfig            |   18 +
>  drivers/hid/Makefile           |    1 +
>  drivers/hid/hid-sensor-hub.c   |  883 ++++++++++++++++++++++++++++++++++++++++
>  include/linux/hid-sensor-hub.h |   99 +++++
>  include/linux/hid-sensor-ids.h |  116 ++++++
>  5 files changed, 1117 insertions(+), 0 deletions(-)  create mode 
> 100644 drivers/hid/hid-sensor-hub.c  create mode 100644 
> include/linux/hid-sensor-hub.h  create mode 100644 
> include/linux/hid-sensor-ids.h
> 
> diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 
> ffddcba..0c86ab0 100644
> --- a/drivers/hid/Kconfig
> +++ b/drivers/hid/Kconfig
> @@ -644,6 +644,24 @@ config HID_ZYDACRON
>  	---help---
>  	Support for Zydacron remote control.
>  
> +config HID_SENSOR_HUB
> +	tristate "HID Sensors framework support"
> +	depends on USB_HID
> +	select MFD_CORE
> +	default n
> +	-- help---
> +	  Support for HID Sensor framework. This will provide MFD framework for
> +	  adding different sensors, using HID sensor usage table. This defines
> +	  a set of interface functions to register callbacks for events so
> +	  that the events are transferred to user space using either input
> +	  or IIO ineterfaces.
> +
> +config HID_SENSOR_HUB_DEBUG
> +	tristate "HID Sensor debug support"
> +	default n
> +	-- help---
> +	  Debug support for Hid sensors. Enable this flag to debug only.
> +

Why not use debugfs (which is what the rest of the HID code and drivers do for debugging)?

Thanks,

--
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@vger.kernel.org More majordomo info at  http://vger.kernel.org/majordomo-info.html
```
