From patchwork Fri Oct 17 23:53:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivier Gay X-Patchwork-Id: 5099431 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 24C6FC11AC for ; Sat, 18 Oct 2014 00:00:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47957201B9 for ; Sat, 18 Oct 2014 00:00:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 56FAB2018E for ; Sat, 18 Oct 2014 00:00:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751396AbaJRAAU (ORCPT ); Fri, 17 Oct 2014 20:00:20 -0400 Received: from na3sys009aob139.obsmtp.com ([74.125.149.251]:56612 "EHLO psmtp.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751342AbaJRAAT (ORCPT ); Fri, 17 Oct 2014 20:00:19 -0400 X-Greylist: delayed 406 seconds by postgrey-1.27 at vger.kernel.org; Fri, 17 Oct 2014 20:00:19 EDT Received: from mail-lb0-f171.google.com ([209.85.217.171]) (using TLSv1) by na3sys009aob139.postini.com ([74.125.148.12]) with SMTP ID DSNKVEGtkux6rSegDK/+0hwZnY3e+aJw/Oa0@postini.com; Fri, 17 Oct 2014 17:00:19 PDT Received: by mail-lb0-f171.google.com with SMTP id z12so1485683lbi.16 for ; Fri, 17 Oct 2014 17:00:17 -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=WpLUijLWrPb+wYMIcheKQaPT+y6LQbU+ej0pCA9Xyg4=; b=OhQcLKFVpxqbQtDyJt4OiQqFjKw+NMMzHMHYGNDXnAlurAUtAFroPHBrW4bNHiMJOg co5y36OUB/rLvN4aehvRuPQWeAg95NTFz23y1iePDCQJ1HIqGdshF8qJf3MJgagNALAl kXlDdKGbxDI3ulXWo+GZ+3u3gCGFnc8913odKu59ybjOkBvSpIrr9wpGfbFhPZH/AV4r iJ2p77PYjiW2wT0d9qj1DcUSQCYbfZewGMxUuaHWnFxoBVHqken1Gak+ypRkn18+Ypet ZvPFtF9Av7snRb3Obrarg4M2CU4nz/t6+k+Rj1zZ//C05PsVbX+u1PwiTMbD8pCETmQL WyVw== X-Received: by 10.152.23.68 with SMTP id k4mr11870901laf.79.1413590011105; Fri, 17 Oct 2014 16:53:31 -0700 (PDT) X-Gm-Message-State: ALoCoQnsokXnA/495GjjxLL8eIvnegAul4XNnqpXyT/HDr9Sk1EwSzcIKIMwA0sy3sj/eAyAQ7wkRevAyELAUJfrzH69DyGvGkSFC7BuYlM7ZS0YedFNHHimvVo0ZD11vg+n/6JUR6X53IO1mw6LvZId/b3lBQqDow== X-Received: by 10.152.23.68 with SMTP id k4mr11870891laf.79.1413590010991; Fri, 17 Oct 2014 16:53:30 -0700 (PDT) Received: from localhost.localdomain ([154.53.1.15]) by mx.google.com with ESMTPSA id jp17sm865577lab.18.2014.10.17.16.53.29 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 17 Oct 2014 16:53:30 -0700 (PDT) From: Olivier Gay To: linux-input@vger.kernel.org Cc: Jiri Kosina , Dmitry Torokhov , Mathieu Meisser , Olivier Gay Subject: [PATCH] HID: add keyboard input assist hid usages Date: Sat, 18 Oct 2014 01:53:39 +0200 Message-Id: <1413590019-1829-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=-6.9 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 keyboard input assist controls usages from approved hid usage table request HUTTR42: http://www.usb.org/developers/hidpage/HUTRR42c.pdf Signed-off-by: Olivier Gay --- Hi all, this patch adds some currently missing hid usages to the hid system. Best regards, Olivier drivers/hid/hid-debug.c | 6 ++++++ drivers/hid/hid-input.c | 7 +++++++ include/uapi/linux/input.h | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c index 84c3cb1..8bf61d2 100644 --- a/drivers/hid/hid-debug.c +++ b/drivers/hid/hid-debug.c @@ -946,6 +946,12 @@ static const char *keys[KEY_MAX + 1] = { [KEY_BRIGHTNESS_MIN] = "BrightnessMin", [KEY_BRIGHTNESS_MAX] = "BrightnessMax", [KEY_BRIGHTNESS_AUTO] = "BrightnessAuto", + [KEY_KBDINPUTASSIST_PREV] = "KbdInputAssistPrev", + [KEY_KBDINPUTASSIST_NEXT] = "KbdInputAssistNext", + [KEY_KBDINPUTASSIST_PREVGROUP] = "KbdInputAssistPrevGroup", + [KEY_KBDINPUTASSIST_NEXTGROUP] = "KbdInputAssistNextGroup", + [KEY_KBDINPUTASSIST_ACCEPT] = "KbdInputAssistAccept", + [KEY_KBDINPUTASSIST_CANCEL] = "KbdInputAssistCancel", }; static const char *relatives[REL_MAX + 1] = { diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 2df7fdd..56c6c30 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c @@ -862,6 +862,13 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel case 0x28b: map_key_clear(KEY_FORWARDMAIL); break; case 0x28c: map_key_clear(KEY_SEND); break; + case 0x2c7: map_key_clear(KEY_KBDINPUTASSIST_PREV); break; + case 0x2c8: map_key_clear(KEY_KBDINPUTASSIST_NEXT); break; + case 0x2c9: map_key_clear(KEY_KBDINPUTASSIST_PREVGROUP); break; + case 0x2ca: map_key_clear(KEY_KBDINPUTASSIST_NEXTGROUP); break; + case 0x2cb: map_key_clear(KEY_KBDINPUTASSIST_ACCEPT); break; + case 0x2cc: map_key_clear(KEY_KBDINPUTASSIST_CANCEL); break; + default: goto ignore; } break; diff --git a/include/uapi/linux/input.h b/include/uapi/linux/input.h index 19df18c..9be8c13 100644 --- a/include/uapi/linux/input.h +++ b/include/uapi/linux/input.h @@ -738,6 +738,13 @@ struct input_keymap_entry { #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ +#define KEY_KBDINPUTASSIST_PREV 0x260 +#define KEY_KBDINPUTASSIST_NEXT 0x261 +#define KEY_KBDINPUTASSIST_PREVGROUP 0x262 +#define KEY_KBDINPUTASSIST_NEXTGROUP 0x263 +#define KEY_KBDINPUTASSIST_ACCEPT 0x264 +#define KEY_KBDINPUTASSIST_CANCEL 0x265 + #define BTN_TRIGGER_HAPPY 0x2c0 #define BTN_TRIGGER_HAPPY1 0x2c0 #define BTN_TRIGGER_HAPPY2 0x2c1