Linux Input/HID development
 help / color / mirror / Atom feed
From: Anisse Astier <anisse@astier.eu>
To: linux-input@vger.kernel.org, platform-driver-x86@vger.kernel.org
Cc: Dmitry Torokhov <dtor@mail.ru>, Matthew Garrett <mjg@redhat.com>,
	Andy Ross <andy.ross@windriver.com>,
	Corentin Chary <corentin.chary@gmail.com>
Subject: [RFC] Reporting "orientation changed" event
Date: Thu, 7 Apr 2011 18:18:00 +0200	[thread overview]
Message-ID: <20110407181800.27b441b1@destiny.ordissimo> (raw)


Pegatron Lucid tablet sends an ACPI hotkey event(0xEA) when the
accelerometer detects coarse orientation change. My initial thought was
to just translate this event into KEY_DIRECTION, which seems to be the
norm from what we can see in hp-wmi driver. (See patch below for an
implementation.)

But this isn't just a key per se like on the HP touchsmart tablet, this
is an event that is triggered when the device is rotated.

This could be defined as a new Misc (EV_MSC) event:
MSC_ORIENTATION_CHANGED ?

Or we could use the upcoming IIO subsystem which is supposed to be for
sensors, but then we'd have a mismatch between the device based on ACPI
with firmware in the middle (driver submitted by Andy Ross) and the
purpose of IIO ("SPI or I2C device").


Maybe I'm over-thinking this and this might be just right:

From: Anisse Astier <anisse@astier.eu>
Subject: [PATCH RFC] asus-laptop: Send input key for tablet rotation on Pegatron Lucid Tablet

Pegatron Lucid tablet sends ACPI event on coarse orientation changes.
Translate this into KEY_DIRECTION input event.

Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Andy Ross <andy.ross@windriver.com>
Cc: Corentin Chary <corentin.chary@gmail.com>
Signed-off-by: Anisse Astier <anisse@astier.eu>
---
Please note that this patch depends on Andy Ross's first patch in order for
asus-laptop to bind with the tablet.

Regards,

Anisse
---
 drivers/platform/x86/asus-laptop.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index 5c23b20..decb958 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -312,6 +312,8 @@ static const struct key_entry asus_keymap[] = {
 	{KE_KEY, 0xc4, { KEY_KBDILLUMUP } },
 	{KE_KEY, 0xc5, { KEY_KBDILLUMDOWN } },
 	{KE_KEY, 0xb5, { KEY_CALC } },
+	/* Pegatron Lucid tablet specific */
+	{KE_KEY, 0xEA, { KEY_DIRECTION } }, /* Orientation changed */
 	{KE_END, 0},
 };
 
-- 
1.7.3.2

             reply	other threads:[~2011-04-07 16:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07 16:18 Anisse Astier [this message]
2011-04-07 16:37 ` [RFC] Reporting "orientation changed" event Bastien Nocera
2011-04-07 16:44   ` Anisse Astier
2011-04-07 17:01 ` Jonathan Cameron
2011-04-07 17:19   ` Anisse Astier
2011-05-09 14:38 ` Matthew Garrett
2011-05-09 15:37   ` Andy Ross
2011-05-09 15:47     ` Matthew Garrett
2011-05-09 15:59       ` Andy Ross
2011-05-09 16:30         ` Anisse Astier
2011-05-09 16:40         ` Matthew Garrett
2011-05-09 17:58           ` Anisse Astier
2011-05-09 18:06             ` Matthew Garrett

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=20110407181800.27b441b1@destiny.ordissimo \
    --to=anisse@astier.eu \
    --cc=andy.ross@windriver.com \
    --cc=corentin.chary@gmail.com \
    --cc=dtor@mail.ru \
    --cc=linux-input@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=platform-driver-x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox