From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752626AbcGSFgb (ORCPT ); Tue, 19 Jul 2016 01:36:31 -0400 Received: from saturn.retrosnub.co.uk ([178.18.118.26]:57888 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752174AbcGSFgZ (ORCPT ); Tue, 19 Jul 2016 01:36:25 -0400 Subject: Re: [PATCH 03/10] iio: core: Add double tap as possible gesture To: Enric Balletbo i Serra , linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org References: <1468825370-20075-1-git-send-email-enric.balletbo@collabora.com> <1468825370-20075-4-git-send-email-enric.balletbo@collabora.com> Cc: Olof Johansson , Lee Jones , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Guenter Roeck , Gwendal Grignou From: Jonathan Cameron Message-ID: <2e85b96a-4772-1c52-9963-efd788c460e8@kernel.org> Date: Mon, 18 Jul 2016 14:54:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1468825370-20075-4-git-send-email-enric.balletbo@collabora.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18/07/16 08:02, Enric Balletbo i Serra wrote: > From: Gwendal Grignou > > This is an interface change: however, the sysfs entry is based on string, > so if other gestures are added on the trunk in the meantime, we will > still be able to merge this change. > > Signed-off-by: Gwendal Grignou > Signed-off-by: Guenter Roeck > [enric: Rebased and resolved conflicts] > Signed-off-by: Enric Balletbo i Serra So you are creating an entire channel type for double tap? Not keen on this I'm afraid. The activity types in there are the moment are not events, but rather attempts to estimate the 'likelihood' that a given activity is currently being undertaken. Hmm. Double tap is more of an event type. It's one I've been wondering how to describe for a while... At the end of the day it's just a reasonably sophisticated filter - kind of a 'magic' version of Rate of Change. Unfortunately there isn't a clean mathematical definition as it can be implemented in lots of ways. I guess the best may be to just have it as an event type on it's own... What do others think? Jonathan > --- > 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 e6319a9..f700e67 100644 > --- a/drivers/iio/industrialio-core.c > +++ b/drivers/iio/industrialio-core.c > @@ -119,6 +119,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 b0916fc..c290167 100644 > --- a/include/uapi/linux/iio/types.h > +++ b/include/uapi/linux/iio/types.h > @@ -79,6 +79,7 @@ enum iio_modifier { > IIO_MOD_CO2, > IIO_MOD_VOC, > IIO_MOD_LIGHT_UV, > + IIO_MOD_DOUBLE_TAP, > }; > > enum iio_event_type { >