From patchwork Wed Mar 28 20:46:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Junge, Terry" X-Patchwork-Id: 10314089 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 4C3C960325 for ; Wed, 28 Mar 2018 20:59:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BFEA2A01C for ; Wed, 28 Mar 2018 20:59:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FE7F2A01E; Wed, 28 Mar 2018 20:59:57 +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=-6.9 required=2.0 tests=BAYES_00,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 8F8E52A01C for ; Wed, 28 Mar 2018 20:59:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753135AbeC1U7z (ORCPT ); Wed, 28 Mar 2018 16:59:55 -0400 Received: from mail3.plantronics.com ([198.231.10.49]:55780 "EHLO mail3.plantronics.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753011AbeC1U7z (ORCPT ); Wed, 28 Mar 2018 16:59:55 -0400 X-Greylist: delayed 795 seconds by postgrey-1.27 at vger.kernel.org; Wed, 28 Mar 2018 16:59:55 EDT Received: from usscmb04.plt.plantronics.com (usscmb04.plt.plantronics.com [10.1.3.175]) by mail3.plantronics.com (8.15.2/8.15.2) with ESMTP id w2SKkbO1018295; Wed, 28 Mar 2018 13:46:37 -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; Wed, 28 Mar 2018 13:46:36 -0700 From: Terry Junge To: CC: Terry Junge , Subject: [PATCH] HID: hid-plantronics: Update to map button for PTT products Date: Wed, 28 Mar 2018 13:46:05 -0700 Message-ID: <1522269965-26232-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.49 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 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(-) 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)) {