From patchwork Sun Apr 3 14:15:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yusuke Fujimaki X-Patchwork-Id: 8734321 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D8B6B9F38C for ; Sun, 3 Apr 2016 14:16:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F28FE2021A for ; Sun, 3 Apr 2016 14:15:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EEFE020219 for ; Sun, 3 Apr 2016 14:15:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751393AbcDCOP6 (ORCPT ); Sun, 3 Apr 2016 10:15:58 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:32965 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751282AbcDCOP5 (ORCPT ); Sun, 3 Apr 2016 10:15:57 -0400 Received: by mail-pf0-f194.google.com with SMTP id e190so2461706pfe.0 for ; Sun, 03 Apr 2016 07:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=iSsmesAnTr1xl9rVd6YYsko/InbxQSS1glndB9s+pKU=; b=cqqCHBsqu9GaOY9Gi+aSbMnlVP/g9r39IJ3Ku5lONW9OIIvFefScr4XS2jxzoOfbht LUh6I7Mp9DDuhgrQ4HMkSg/75KDQwUpbooi3IUZ7Nw55WMppK1SCnZ5bcUt3tGQf33GH MfJZe5Q7CoC+sya+NirRHTYNYUZPw74XlrOQes/zfQx1hWERj1RrHGedA2L2trXEqhoQ YFvOpOImd+GzChhuWoyJGQI46OXahmUloS6BhNnild4CkpUP2Tf2bEk0aqd02A+QjaHN Q8waEy9ffD6jKC7w9bIn9SQuqxY1nZUD/OGf7HU+mCxQuDrH39BDX6IO02sF2/3uggEo x3Kw== 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=iSsmesAnTr1xl9rVd6YYsko/InbxQSS1glndB9s+pKU=; b=CijY1cq46GvuqfK063RM6yUFqZafYCyboUrPiki9e5x/76tZ9KmHIO50sgcKZC2AXw iP5V77KhZHWUBheplK9txDWyuwnaFqb2y2rWS8AOI2wn2MLwwCWLYD/+wCcWRnfjWA+K ltVOmyhcmFtsCqkuNSWjHsrtdFsc3kyLJEunNgARV7pIelufVkmg1Q6Y7QA7fhAsF15Q MoJCPCJwukgcCl4fG10cDsRjoAptkOTc3oZuMgHOCOqerBX/VzR/8G2Fna7MNc6VLskF EopAe234bo6lncadtfnbXe0E/6o9fx78ERgT6yo8t//KKt6TVmjWIghVCfQcjViI4AQ5 dSJw== X-Gm-Message-State: AD7BkJI/yJoSPUFPYIjGqr8gAxaULy1gTxoB90adEzMwRvxHQb87E085INLUUKOsJOzgxw== X-Received: by 10.98.79.203 with SMTP id f72mr13398229pfj.102.1459692956615; Sun, 03 Apr 2016 07:15:56 -0700 (PDT) Received: from ppp.wakwak.ne.jp (z60.124-44-50.ppp.wakwak.ne.jp. [124.44.50.60]) by smtp.gmail.com with ESMTPSA id g74sm32916067pfj.1.2016.04.03.07.15.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 03 Apr 2016 07:15:55 -0700 (PDT) From: Yusuke Fujimaki To: Jiri Kosina Cc: Benjamin Tissoires , linux-input@vger.kernel.org, Yusuke Fujimaki Subject: [PATCH V2] HID: Asus X205TA keyboard driver Date: Sun, 3 Apr 2016 23:15:16 +0900 Message-Id: <1459692916-3705-1-git-send-email-usk.fujimaki@gmail.com> X-Mailer: git-send-email 2.1.4 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Asus X205TA and E200HA built-in keyboard contain wrong logical maximum value in report descriptor. This patch correct wrong logical maximum in report descriptor. Signed-off-by: Yusuke Fujimaki --- Changes in V2: - Adding support for VivoBook E200HA - Updating macro,comments and Kconfig drivers/hid/Kconfig | 6 +++++- drivers/hid/hid-asus.c | 12 ++++++++---- drivers/hid/hid-core.c | 2 +- drivers/hid/hid-ids.h | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 513c93e..5646ca4 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig @@ -138,7 +138,11 @@ config HID_ASUS tristate "Asus" depends on I2C_HID ---help--- - Support for Asus X205TA built-in keyboard via i2c. + Support for Asus notebook built-in keyboard via i2c. + + Supported devices: + - EeeBook X205TA + - VivoBook E200HA config HID_AUREAL tristate "Aureal" diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c index 1734e11..7a811ec 100644 --- a/drivers/hid/hid-asus.c +++ b/drivers/hid/hid-asus.c @@ -1,7 +1,11 @@ /* - * HID driver for Asus X205TA built-in keyboard. + * HID driver for Asus notebook built-in keyboard. * Fixes small logical maximum to match usage maximum. * + * Currently supported devices are: + * EeeBook X205TA + * VivoBook E200HA + * * Copyright (c) 2016 Yusuke Fujimaki * * This module based on hid-ortek by @@ -25,15 +29,15 @@ static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { - if (*rsize >= 180 && rdesc[54] == 0x25 && rdesc[55] == 0x65) { - hid_info(hdev, "Fixing up Asus X205TA report descriptor\n"); + if (*rsize >= 56 && rdesc[54] == 0x25 && rdesc[55] == 0x65) { + hid_info(hdev, "Fixing up Asus notebook report descriptor\n"); rdesc[55] = 0xdd; } return rdesc; } static const struct hid_device_id asus_devices[] = { - { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_X205TA_KEYBOARD) }, + { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_NOTEBOOK_KEYBOARD) }, { } }; MODULE_DEVICE_TABLE(hid, asus_devices); diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 7426b5a..7f8105b 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1856,7 +1856,7 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2011_JIS) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, - { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_X205TA_KEYBOARD) }, + { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_NOTEBOOK_KEYBOARD) }, { HID_USB_DEVICE(USB_VENDOR_ID_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) }, { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) }, { HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185BFM, 0x2208) }, diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index f83e7fd..1219e59 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -163,7 +163,7 @@ #define USB_VENDOR_ID_ASUSTEK 0x0b05 #define USB_DEVICE_ID_ASUSTEK_LCM 0x1726 #define USB_DEVICE_ID_ASUSTEK_LCM2 0x175b -#define USB_DEVICE_ID_ASUSTEK_X205TA_KEYBOARD 0x8585 +#define USB_DEVICE_ID_ASUSTEK_NOTEBOOK_KEYBOARD 0x8585 #define USB_VENDOR_ID_ATEN 0x0557 #define USB_DEVICE_ID_ATEN_UC100KM 0x2004