From patchwork Thu Apr 26 20:36:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Junge, Terry" X-Patchwork-Id: 10366803 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6AC8A602DC for ; Thu, 26 Apr 2018 20:37:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56F18281E1 for ; Thu, 26 Apr 2018 20:37:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B63828399; Thu, 26 Apr 2018 20:37:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2AF2281E1 for ; Thu, 26 Apr 2018 20:37:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753652AbeDZUhq convert rfc822-to-8bit (ORCPT ); Thu, 26 Apr 2018 16:37:46 -0400 Received: from mail4.plantronics.com ([198.231.10.50]:53749 "EHLO mail4.plantronics.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754529AbeDZUhn (ORCPT ); Thu, 26 Apr 2018 16:37:43 -0400 Received: from usscmb04.plt.plantronics.com (usscmb04.plt.plantronics.com [10.1.3.175]) by mail4.plantronics.com (8.15.2/8.15.2) with ESMTP id w3QKbYp8005443; Thu, 26 Apr 2018 13:37:34 -0700 Received: from SQADIRECTOR3.plt.plantronics.com (10.1.10.62) by usscmb04.plt.plantronics.com (10.1.3.175) with Microsoft SMTP Server (TLS) id 15.0.1130.7; Thu, 26 Apr 2018 13:37:33 -0700 From: Terry Junge To: CC: Terry Junge , , Subject: [PATCH] HID: hid-plantronics: Resend Update to map button for PTT products Date: Thu, 26 Apr 2018 13:36:57 -0700 Message-ID: <1524775017-13472-1-git-send-email-terry.junge@plantronics.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.1.10.62] X-ClientProxiedBy: usscch04.plt.plantronics.com (10.1.3.111) To usscmb04.plt.plantronics.com (10.1.3.175) X-Scanned-By: MIMEDefang 2.67 on 10.63.1.50 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Resend with, hopefully, no trailing legal disclaimers added by mail server Added mapping for Push-To-Talk joystick trigger button. Patched against git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid.git Tested on ChromeBox/ChromeBook with various Plantronics devices. Signed-off-by: Terry Junge --- drivers/hid/hid-plantronics.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/hid/hid-plantronics.c b/drivers/hid/hid-plantronics.c index febb21e..584b10d 100644 --- a/drivers/hid/hid-plantronics.c +++ b/drivers/hid/hid-plantronics.c @@ -2,7 +2,7 @@ * Plantronics USB HID Driver * * Copyright (c) 2014 JD Cole - * Copyright (c) 2015 Terry Junge + * Copyright (c) 2015-2018 Terry Junge */ /* @@ -48,6 +48,10 @@ static int plantronics_input_mapping(struct hid_device *hdev, unsigned short mapped_key; unsigned long plt_type = (unsigned long)hid_get_drvdata(hdev); + /* special case for PTT products */ + if (field->application == HID_GD_JOYSTICK) + goto defaulted; + /* handle volume up/down mapping */ /* non-standard types or multi-HID interfaces - plt_type is PID */ if (!(plt_type & HID_USAGE_PAGE)) {