# Re: \[PATCH 07/18\] HID: input: allow mapping of haptic output

- From: Dmitry Torokhov \<dmitry.torokhov@gmail.com\>
- Date: 2022-01-07 21:58:35 
- List: linux-input
- Page: https://ratatoskr.run/linux-input/2022/01/8933779
- Thread: https://ratatoskr.run/linux-input/2021/12/8933714/t.md

```text
On Tue, Dec 21, 2021 at 07:17:32PM +0000, Angela Czubak wrote:
> This change makes it possible to parse output reports by input mapping
> functions by HID drivers.
> 
> Signed-off-by: Angela Czubak <redacted>

Please send to Jiri/Benjamin.

Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

> ---
>  drivers/hid/hid-input.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
> index 03f994541981..81eb277dee91 100644
> --- a/drivers/hid/hid-input.c
> +++ b/drivers/hid/hid-input.c
> @@ -599,9 +599,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
>  	if (field->report_count < 1)
>  		goto ignore;
>  
> -	/* only LED usages are supported in output fields */
> +	/* only LED and HAPTIC usages are supported in output fields */
>  	if (field->report_type == HID_OUTPUT_REPORT &&
> -			(usage->hid & HID_USAGE_PAGE) != HID_UP_LED) {
> +	    (usage->hid & HID_USAGE_PAGE) != HID_UP_LED &&
> +	    (usage->hid & HID_USAGE_PAGE) != HID_UP_HAPTIC) {
>  		goto ignore;
>  	}
>  
> -- 
> 2.34.1.307.g9b7440fafd-goog
> 

-- 
Dmitry
```
