From patchwork Thu Apr 7 16:18:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anisse Astier X-Patchwork-Id: 692901 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p37GIUCb002217 for ; Thu, 7 Apr 2011 16:18:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755178Ab1DGQSX (ORCPT ); Thu, 7 Apr 2011 12:18:23 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:54462 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754932Ab1DGQSW (ORCPT ); Thu, 7 Apr 2011 12:18:22 -0400 Received: by wya21 with SMTP id 21so2371011wya.19 for ; Thu, 07 Apr 2011 09:18:21 -0700 (PDT) Received: by 10.227.169.76 with SMTP id x12mr1096457wby.155.1302193100779; Thu, 07 Apr 2011 09:18:20 -0700 (PDT) Received: from destiny.ordissimo (ip-140.net-81-220-116.brest.rev.numericable.fr [81.220.116.140]) by mx.google.com with ESMTPS id bs4sm1155392wbb.18.2011.04.07.09.18.20 (version=SSLv3 cipher=OTHER); Thu, 07 Apr 2011 09:18:20 -0700 (PDT) Date: Thu, 7 Apr 2011 18:18:00 +0200 From: Anisse Astier To: linux-input@vger.kernel.org, platform-driver-x86@vger.kernel.org Cc: Dmitry Torokhov , Matthew Garrett , Andy Ross , Corentin Chary Subject: [RFC] Reporting "orientation changed" event Message-ID: <20110407181800.27b441b1@destiny.ordissimo> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.20.1; i486-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 07 Apr 2011 16:18:30 +0000 (UTC) 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 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 Cc: Matthew Garrett Cc: Andy Ross Cc: Corentin Chary Signed-off-by: Anisse Astier --- 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}, };