From patchwork Fri Apr 4 15:02:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Gay X-Patchwork-Id: 3939231 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9E15C9F1EE for ; Fri, 4 Apr 2014 15:08:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A099920394 for ; Fri, 4 Apr 2014 15:08:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 142A220351 for ; Fri, 4 Apr 2014 15:08:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752748AbaDDPIP (ORCPT ); Fri, 4 Apr 2014 11:08:15 -0400 Received: from na3sys009aog101.obsmtp.com ([74.125.149.67]:50886 "EHLO na3sys009aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752426AbaDDPIO (ORCPT ); Fri, 4 Apr 2014 11:08:14 -0400 X-Greylist: delayed 347 seconds by postgrey-1.27 at vger.kernel.org; Fri, 04 Apr 2014 11:08:13 EDT Received: from mail-pb0-f52.google.com ([209.85.160.52]) (using TLSv1) by na3sys009aob101.postini.com ([74.125.148.12]) with SMTP ID DSNKUz7K3SSaXVvytP7D1ou3dCECvE5+ZYHE@postini.com; Fri, 04 Apr 2014 08:08:13 PDT Received: by mail-pb0-f52.google.com with SMTP id rr13so3580190pbb.39 for ; Fri, 04 Apr 2014 08:08:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8NDqSxuhacWfMQdLwCoalRYz0RKcSVQqTE1EvgN0JYo=; b=TfiBUrWYechil6Yo3QCnb+5Ye7obPUI37fSCnAmgx+v6/SSmP9jOOX1Ji/kZOaXRnF SycFUsM/TnEfX8cMBcLyK0rn6bX6itnEac7drDUwq2iE6u1ALzaqL+w4Tr2i+Z5LObJz QW16ydyDyhzPsmDewYBn1nCOxzyJptNzn8+ZaGurursHI8XDx1hS/eNFWVREFZdi7cyR smJjoHZ279f2l0nY2b1cKFSCjAPfSi5kyHq3ruh2H8XhGvy+3OOPZgJ6bv7yW+pUQ3Ng NQmbk8/Ci5xMHrgAEoI14LcEcITNFzrItsLPsGF8fFY3eNedSqzoQsOowS6T2NWxRhZk dOww== X-Received: by 10.66.240.70 with SMTP id vy6mr15555899pac.80.1396623746154; Fri, 04 Apr 2014 08:02:26 -0700 (PDT) X-Gm-Message-State: ALoCoQmucAfEavTiQVvozoNts8oOYXBXl0OAMwh6M/X9nb/1fZ+AjKqc+z6FNgcNItHHDAsOEgA79str0N4/MlyhuWlK7zOjBGc63ToHmDMIi2aLUO4ZPG2lyWJtlRWye3nTo3Y0YYxaHrYLNTw6JWJpAcMaJd/pXA== X-Received: by 10.66.240.70 with SMTP id vy6mr15555873pac.80.1396623745959; Fri, 04 Apr 2014 08:02:25 -0700 (PDT) Received: from localhost.localdomain ([154.53.1.15]) by mx.google.com with ESMTPSA id ha11sm18366530pbd.17.2014.04.04.08.02.22 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 08:02:24 -0700 (PDT) From: Olivier Gay To: linux-input@vger.kernel.org Cc: Jiri Kosina , Nestor Lopez Casado , Olivier Gay , Mathieu Meisser Subject: [PATCH] HID: add missing hid usages Date: Fri, 4 Apr 2014 17:02:26 +0200 Message-Id: <1396623746-1416-1-git-send-email-ogay@logitech.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add some missing hid usages from consumer page, add display brightness control usages from approved hid usage table request HUTTR41: http://www.usb.org/developers/hidpage/HUTRR41.pdf and add voice command usage from approved request HUTTR45: http://www.usb.org/developers/hidpage/Voice_Command_Usage.pdf Signed-off-by: Olivier Gay Signed-off-by: Mathieu Meisser --- Hi all, with this patch we add some missing hid usages to the hid system. Those missing hid usages are already used by some Logitech products as well as some future ones. (Note: checkpatch.pl shows some errors but I didn't want to break the current code style in hid-input.c) Best regards, Olivier drivers/hid/hid-debug.c | 14 ++++++++++++++ drivers/hid/hid-input.c | 15 +++++++++++++++ include/uapi/linux/input.h | 16 ++++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 53b771d..742d78b 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -855,6 +855,20 @@ static const char *keys[KEY_MAX + 1] = { [KEY_KBDILLUMDOWN] = "KbdIlluminationDown", [KEY_KBDILLUMUP] = "KbdIlluminationUp", [KEY_SWITCHVIDEOMODE] = "SwitchVideoMode", + [KEY_BUTTONCONFIG] = "ButtonConfig", + [KEY_TASKMANAGER] = "TaskManager", + [KEY_JOURNAL] = "Journal", + [KEY_CONTROLPANEL] = "ControlPanel", + [KEY_APPSELECT] = "AppSelect", + [KEY_SCREENSAVER] = "ScreenSaver", + [KEY_VOICECOMMAND] = "VoiceCommand", + [KEY_BRIGHTNESS_INC] = "BrightnessInc", + [KEY_BRIGHTNESS_DEC] = "BrightnessDec", + [KEY_BRIGHTNESS] = "Brightness", + [KEY_BRIGHTNESS_TOGGLE] = "BrightnessToggle", + [KEY_BRIGHTNESS_MIN] = "BrightnessMin", + [KEY_BRIGHTNESS_MAX] = "BrightnessMax", + [KEY_BRIGHTNESS_AUTO] = "BrightnessAuto", }; static const char *relatives[REL_MAX + 1] = { diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 930382e..e1409da 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -721,6 +721,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x06c: map_key_clear(KEY_YELLOW); break; case 0x06d: map_key_clear(KEY_ZOOM); break; + case 0x06f: map_key_clear(KEY_BRIGHTNESS_INC); break; + case 0x070: map_key_clear(KEY_BRIGHTNESS_DEC); break; + case 0x071: map_key_clear(KEY_BRIGHTNESS); break; + case 0x072: map_key_clear(KEY_BRIGHTNESS_TOGGLE); break; + case 0x073: map_key_clear(KEY_BRIGHTNESS_MIN); break; + case 0x074: map_key_clear(KEY_BRIGHTNESS_MAX); break; + case 0x075: map_key_clear(KEY_BRIGHTNESS_AUTO); break; + case 0x082: map_key_clear(KEY_VIDEO_NEXT); break; case 0x083: map_key_clear(KEY_LAST); break; case 0x084: map_key_clear(KEY_ENTER); break; @@ -761,6 +769,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x0bf: map_key_clear(KEY_SLOW); break; case 0x0cd: map_key_clear(KEY_PLAYPAUSE); break; + case 0x0cf: map_key_clear(KEY_VOICECOMMAND); break; case 0x0e0: map_abs_clear(ABS_VOLUME); break; case 0x0e2: map_key_clear(KEY_MUTE); break; case 0x0e5: map_key_clear(KEY_BASSBOOST); break; @@ -768,6 +777,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x0ea: map_key_clear(KEY_VOLUMEDOWN); break; case 0x0f5: map_key_clear(KEY_SLOW); break; + case 0x181: map_key_clear(KEY_BUTTONCONFIG); break; case 0x182: map_key_clear(KEY_BOOKMARKS); break; case 0x183: map_key_clear(KEY_CONFIG); break; case 0x184: map_key_clear(KEY_WORDPROCESSOR); break; @@ -781,6 +791,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x18c: map_key_clear(KEY_VOICEMAIL); break; case 0x18d: map_key_clear(KEY_ADDRESSBOOK); break; case 0x18e: map_key_clear(KEY_CALENDAR); break; + case 0x18f: map_key_clear(KEY_TASKMANAGER); break; + case 0x190: map_key_clear(KEY_JOURNAL); break; case 0x191: map_key_clear(KEY_FINANCE); break; case 0x192: map_key_clear(KEY_CALC); break; case 0x193: map_key_clear(KEY_PLAYER); break; @@ -789,12 +801,15 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x199: map_key_clear(KEY_CHAT); break; case 0x19c: map_key_clear(KEY_LOGOFF); break; case 0x19e: map_key_clear(KEY_COFFEE); break; + case 0x19f: map_key_clear(KEY_CONTROLPANEL); break; + case 0x1a2: map_key_clear(KEY_APPSELECT); break; case 0x1a3: map_key_clear(KEY_NEXT); break; case 0x1a4: map_key_clear(KEY_PREVIOUS); break; case 0x1a6: map_key_clear(KEY_HELP); break; case 0x1a7: map_key_clear(KEY_DOCUMENTS); break; case 0x1ab: map_key_clear(KEY_SPELLCHECK); break; case 0x1ae: map_key_clear(KEY_KEYBOARD); break; + case 0x1b1: map_key_clear(KEY_SCREENSAVER); break; case 0x1b4: map_key_clear(KEY_FILE); break; case 0x1b6: map_key_clear(KEY_IMAGES); break; case 0x1b7: map_key_clear(KEY_AUDIO); break; diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index bd24470..d82454f 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h @@ -722,6 +722,22 @@ struct input_keymap_entry { #define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ +#define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */ +#define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */ +#define KEY_JOURNAL 0x242 /* AL Log/Journal/Timecard */ +#define KEY_CONTROLPANEL 0x243 /* AL Control Panel */ +#define KEY_APPSELECT 0x244 /* AL Select Task/Application */ +#define KEY_SCREENSAVER 0x245 /* AL Screen Saver */ +#define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */ + +#define KEY_BRIGHTNESS_INC KEY_BRIGHTNESSUP +#define KEY_BRIGHTNESS_DEC KEY_BRIGHTNESSDOWN +#define KEY_BRIGHTNESS 0x250 /* Display Brightness */ +#define KEY_BRIGHTNESS_TOGGLE 0x251 /* Backlight Toggle */ +#define KEY_BRIGHTNESS_MIN 0x252 /* Set Brightness to Minimum */ +#define KEY_BRIGHTNESS_MAX 0x253 /* Set Brightness to Maximum */ +#define KEY_BRIGHTNESS_AUTO 0x254 /* Set Auto Brightness */ + #define BTN_TRIGGER_HAPPY 0x2c0 #define BTN_TRIGGER_HAPPY1 0x2c0 #define BTN_TRIGGER_HAPPY2 0x2c1