Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1660643
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Gwendal Grignou <gwendal@chromium.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/3] iio: core: Add double tap as possible gesture |
| Date | Thu, 08 Jun 2017 03:20:02 +0200 |
| Message-ID | <tPUhb-5VG-5@gated-at.bofh.it> (permalink) |
| References | <sKXBg-2G5-5@gated-at.bofh.it> <sKXBg-2G5-33@gated-at.bofh.it> <sLm6B-1mB-9@gated-at.bofh.it> <sQdvH-4GC-3@gated-at.bofh.it> |
| X-Original-To | Jonathan Cameron <jic23@kernel.org> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=dmh00jYxXm7zTXElAHVWbptpOMHdBNAcA1VQpE4552A=; b=QXOtPiaGucr5XW28dPnOlfQ/bySJqYQRMJJUUpy89Ww6cbQJrwHEv1JwumulPvsZjm 62kMy5VI1aL2Hk0oli5Q4lXOBCSJWrDljfbBYuVUhi44tRxC/o/vQWJ98aDM5SMuwwC4 TowvPpCVbJHDLer6tV95+gByYPjOMZ6ZOaSzvDc+Jac4kWFX71q6lhY1fel385ipBDnf 2Psm9T9v9LH9e3YU9PLEipvd3TZN1AaZBT/2cP7ilv9l9HJGVsRooQFg1V8Kcznr6Vhc mVyegvUWpnF9GddJb/Qk1olHwaB4LYlNcXEMl8N8JrVEcqS3LMMl6mL2SPdgBFuF/R4n qauQ== |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=dmh00jYxXm7zTXElAHVWbptpOMHdBNAcA1VQpE4552A=; b=IT/CXNuFE7iFQ30dytUMejygrvnjMUxmwTrmcAQ4BtHKJySHEKv+sxDNXP+p2aUCzl tBhoCC25Z/0MzpXA6V0g8Zp6x6kEccBV7QcKKb0/23ULk6cBEDZfwjb+tIExruffewUO cGKhFFIVrv/rPZ9wdh4hem/Ghe/3IVrAtWeP4= |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=dmh00jYxXm7zTXElAHVWbptpOMHdBNAcA1VQpE4552A=; b=X2hHaZqTSCeJfv3boo3nF3I2Yd6RVmStjMnn84KkD2cZrFxoqw8XqGSQCozFaAAdoV nqLtM2vvyF7vbH6A0QeDOaGMe6VRDt4pn0k7YN724xMvUSLHLORGa2zjRPJxjKwQJudu /RK8kWlH3wR0GucscN8vVR0ZmuavdlZVf6uOiWLHZfHi+ExeZI5aytM073UxKxlXZbFZ 4HLWf7MJVwRO2eS6g8vq8Qn0HTl9vNzSYjdLNk1yB9o1YeVJnT7hwB4s/AoZFz66iSSP DyeLdkRBFB9sBX9+gucqBTQ8BCAPxduBLt/amMuCrV7J2wCllLCLQDDCxMh8ZLi/rLye Q+Vw== |
| X-Gm-Message-State | AODbwcCtyLQOZn196sJtJPNLecYMhnR64xv6N0ZDDI1YM6md//wLUlC4 hgUK+Eg/hUQ7cpCRyW5EErJTVUvi/j0+ |
| X-Received | by 10.37.8.69 with SMTP id 66mr8633628ybi.84.1496884222500; Wed, 07 Jun 2017 18:10:22 -0700 (PDT) |
| MIME-Version | 1.0 |
| X-Google-Sender-Auth | yUGWwG2toCf6OtcqoBd_mWWAnqs |
| Content-Type | text/plain; charset="UTF-8" |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 93 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Peter Meerwald-Stadler <pmeerw@pmeerw.net>, Thierry Escande <thierry.escande@collabora.com>, Gwendal Grignou <gwendal@chromium.org>, Linux Kernel <linux-kernel@vger.kernel.org>, linux-iio@vger.kernel.org, nvaccaro@chromium.org |
| X-Original-Date | Wed, 7 Jun 2017 18:10:02 -0700 |
| X-Original-Message-ID | <CAMHSBOVPFVoB4aJAmua8ib7OFReZC9WP2YaOEKyGjPS+7SyGsw@mail.gmail.com> |
| X-Original-References | <1480929198-13671-1-git-send-email-thierry.escande@collabora.com> <1480929198-13671-3-git-send-email-thierry.escande@collabora.com> <alpine.DEB.2.02.1612061223550.29508@pmeerw.net> <9164eb64-55cc-f175-b4c1-3fe2288e0e12@kernel.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1660643 |
Show key headers only | View raw
[+Nick]
Looking into it again, given that overloading IIO_ACTIVITY is not an
option, we need another channel type for these type of events. (single
tap, double tap).
Also to reduce the CPU load at idle, instead of polling an
accelerometer to detect orientation change, we are looking at using
accelerometer built-in capability to detect it. (portrait, landscape,
inverted portrait/landscape).
I am proposing to add a new event type for tap: IIO_EV_TYPE_TAP
IIO_MOD_EVENT_CODE(IIO_ACCEL,
x,
IIO_MOD_Z, /* if the
tap is on the Z axis, if the sensor can tell */
IIO_EV_TYPE_TAP,
IIO_EV_DIR_NONE)
where x == 1 : single tap, 2 : double tap, 3 : .. triple tap ....
For screen rotation detection, another event: IIO_EV_TYPE_ROT, this
time, x will be an enum similar to the W3C Screen Orientation API
(https://www.w3.org/TR/screen-orientation/#screenorientation-interface):
enum iio_orientation_type {
PORTRAIT_PRIMARY,
PORTRAIT_SECONDARY,
LANDSCAPE_PRIMARY,
LANDSCAPE_SECONDARY
};
Gwendal
On Mon, Dec 19, 2016 at 1:11 PM, Jonathan Cameron <jic23@kernel.org> wrote:
> 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@chromium.org>
>>> Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
>>> ---
>>> 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 {
>>>
>>
>
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH 2/3] iio: core: Add double tap as possible gesture Gwendal Grignou <gwendal@chromium.org> - 2017-06-08 03:20 +0200 Re: [PATCH 2/3] iio: core: Add double tap as possible gesture Jonathan Cameron <jic23@kernel.org> - 2017-06-11 16:50 +0200
csiph-web