Re: [PATCH 2/3] iio: core: Add double tap as possible gesture

From: Jonathan Cameron
Date: Mon Dec 19 2016 - 16:11:21 EST


On 06/12/16 11:25, Peter Meerwald-Stadler wrote:
>
>> This adds the IIO_MOD_DOUBLE_TAP entry to the iio_modifier enum and the
>> corresponding "double_tap" string to the iio_modifier_names array.
>
> I don't think we should have gestures as channel modifiers
Agreed, though treating it like other activities (walking, running etc) gave me
the thought that maybe there are exercise classes out there somewhere in
'double tapping'.

We don't actually have a good way of handling this at the moment, but it's
definitely an 'event' in IIO parlance rather than a modifier of a channel type.

It's irritatingly non general, but perhaps an event type is needed for
gestures with some abuse of the event code format when one turns up to allow
us to encode the type?

> probably a middle layer between IIO and input subsystem is needed (could
> be in userspace?)
Could do it in userspace, but we probably ultimately want an in kernel
consumer interface for IIO events, and do the translation in a input
bridge using that...

Certainly bridging buffered data in userspace didn't turn out as neatly
as the in kernel version.

>
>> Signed-off-by: Gwendal Grignou <gwendal@xxxxxxxxxxxx>
>> Signed-off-by: Thierry Escande <thierry.escande@xxxxxxxxxxxxx>
>> ---
>> drivers/iio/industrialio-core.c | 1 +
>> include/uapi/linux/iio/types.h | 1 +
>> 2 files changed, 2 insertions(+)
>>
>> diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
>> index fc340ed..82ce05f 100644
>> --- a/drivers/iio/industrialio-core.c
>> +++ b/drivers/iio/industrialio-core.c
>> @@ -120,6 +120,7 @@ static const char * const iio_modifier_names[] = {
>> [IIO_MOD_Q] = "q",
>> [IIO_MOD_CO2] = "co2",
>> [IIO_MOD_VOC] = "voc",
>> + [IIO_MOD_DOUBLE_TAP] = "double_tap",
>> };
>>
>> /* relies on pairs of these shared then separate */
>> diff --git a/include/uapi/linux/iio/types.h b/include/uapi/linux/iio/types.h
>> index 22e5e58..47d2768 100644
>> --- a/include/uapi/linux/iio/types.h
>> +++ b/include/uapi/linux/iio/types.h
>> @@ -80,6 +80,7 @@ enum iio_modifier {
>> IIO_MOD_CO2,
>> IIO_MOD_VOC,
>> IIO_MOD_LIGHT_UV,
>> + IIO_MOD_DOUBLE_TAP,
>> };
>>
>> enum iio_event_type {
>>
>