From: Hans de Goede <hdegoede@redhat.com>
To: linux-usb <linux-input@vger.kernel.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Bastien Nocera <hadess@hadess.net>
Subject: Adding an interface to evdev for tablet orientation
Date: Thu, 6 Aug 2015 15:19:25 +0200 [thread overview]
Message-ID: <55C35EDD.8010806@redhat.com> (raw)
Hi All,
Many accelerometers used in tablets not only offer acceleration
data along 3 axis, but also have a notion of the orientation of
the tablet (right side up, upside down, rotated 90 degrees left/right),
currently there is no way to export this info via evdev.
I think we need to add an axis/switch/? to the linux/uapi/input.h
definitions to support this, as it is useful info to have, and the hw
is likely a more reliable source of this info then deducting it from
the accelerometer readings as is done in e.g. :
https://github.com/hadess/iio-sensor-proxy/blob/master/src/orientation.c#L60
3 questions:
1) Do people agree that it is a good idea to export the hardware's
notation of the orientation through evdev ?
2) What sort of evdev events should orientation changes send, events
on a new axis, or switch events, or ... ?
3) The accelerometer hardware I've been looking at sofar typically
generates a hw interrupt for orientation changes, where as reading
the actual acceleration axis typically is a contineous process
requiring polling. The current iio-sensor-proxy code (which also
handles evdev accelerometers) leaves the evdev node closed and
only opens it on a change kevent, which means that we need to
generate change kevents on orientation changes. Another approach
would be to have 2 separate evdev nodes, one for the orientation
function, and on opening that we enable the irq), and one for
reading accel values and on opening this one we start polling.
Regards,
Hans
next reply other threads:[~2015-08-06 13:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-06 13:19 Hans de Goede [this message]
2015-08-16 19:58 ` Adding an interface to evdev for tablet orientation Bastien Nocera
2015-08-16 20:12 ` Hans de Goede
2015-08-16 20:17 ` Bastien Nocera
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55C35EDD.8010806@redhat.com \
--to=hdegoede@redhat.com \
--cc=dmitry.torokhov@gmail.com \
--cc=hadess@hadess.net \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.