From patchwork Fri Sep 8 00:48:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 9943025 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 DB6B5600CB for ; Fri, 8 Sep 2017 00:49:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C855927F82 for ; Fri, 8 Sep 2017 00:49:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCF2A27F88; Fri, 8 Sep 2017 00:49:09 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 5207727F82 for ; Fri, 8 Sep 2017 00:49:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753304AbdIHAtI (ORCPT ); Thu, 7 Sep 2017 20:49:08 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33562 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753079AbdIHAtH (ORCPT ); Thu, 7 Sep 2017 20:49:07 -0400 Received: by mail-pf0-f196.google.com with SMTP id h4so637798pfk.0 for ; Thu, 07 Sep 2017 17:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=hchMeDv0qtpLmlwZeGEORQDi7F4NEeF4Ekv17qjAU4w=; b=JMQTeWruCXiNG/uvziQgo0wRWIu8PYS7htfQb83NBaWyM+as6T/pdwubn9Qm8fvUn6 sMTacKK39M8KvzgdVtmHCMqvxCl6YxcgSNNr4wtvgVnMMAZZh4QOI/DzofWngey+MuHF 0eiNeJtHTGiSPLCiwyQKbRkybaZBr1x4vDHMBbYGyBEBDe72OAKPw7fMpugpx2kWROvz oRQfFSZCQVMPS8pKL8OlyQ5O0rSAaFcCMAHx4I08fjAPJIg3Vw4nHjk9lmRfxVCUqf3P Lom3eOSsMCt4wnGvjDVjsy02V/9KGFOppvFkEOw33OrsmVIwNBFBKB4L8yFq8nEBzviJ 3vWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hchMeDv0qtpLmlwZeGEORQDi7F4NEeF4Ekv17qjAU4w=; b=USHt0e0I8NQbv1SGAVZTRlYGwBlsIxvA5/mPkeJrSG2rYcrvhbHeVSgktHKVPsui4w 81rCGncSbsCWg7otgUfiEE41AnaPRZXTWvqtXLUx9RuqyHyfEF04LwOZVoEMohJXrfIJ w0estAz2MNv3xzQLdEus/jc6PXQax1CNKzLSsp3iZph89uiSuTamooR0DsN8l51qpLbn E7Od8Sb5LIz3KdYtYsLHlabG9Zmh9U2dl5ObDtd8cqWZZsU73mTcCu/hxdSXwNj7+Req DmKyiK21K2QJqWf/aUKZsDsAqHx3CV558+qBJsr5Cbzzhv1bMwOelwiHQJ94Awmw+U1r NEEQ== X-Gm-Message-State: AHPjjUhXW7MRZjqB+RrzhNh1NRgp+UA1c33nEpy9p9TkehJm+M0rS4lx KYYJYUKjrof+bQ== X-Google-Smtp-Source: ADKCNb4IbQGpEHaRop0Oocz1VLzFLSjsECUbCuZ4RTuD0u0tAPrb1yzmtaaJxoqieE4OH+A37cTp/g== X-Received: by 10.84.174.67 with SMTP id q61mr1384752plb.242.1504831747511; Thu, 07 Sep 2017 17:49:07 -0700 (PDT) Received: from localhost.localdomain (mobile-166-176-185-67.mycingular.net. [166.176.185.67]) by smtp.gmail.com with ESMTPSA id w134sm943466pfd.186.2017.09.07.17.49.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Sep 2017 17:49:06 -0700 (PDT) From: Ping Cheng X-Google-Original-From: Ping Cheng To: jikos@kernel.org Cc: linux-input@vger.kernel.org, Jason Gerecke , Jason Gerecke , Ping Cheng Subject: [PATCH 3/6] HID: wacom: generic: Use generic codepath terminology in wacom_wac_pen_report Date: Thu, 7 Sep 2017 17:48:55 -0700 Message-Id: <20170908004855.2966-1-ping.cheng@wacom.com> X-Mailer: git-send-email 2.9.5 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 From: Jason Gerecke The terminology used to describe the various degrees of pen proximity within the wacom_wac_pen_report function does not match that used elsewhere in the generic codepath. Specifically, the names of the variables "prox" and "range" were inspired by the non-generic codepaths. To make the generic codepath internally consistent, replace these terms with "range" and "sense" respectively. Signed-off-by: Jason Gerecke Signed-off-by: Ping Cheng --- drivers/hid/wacom_wac.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index aa692e2..cdf95e1 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -2217,7 +2217,7 @@ static void wacom_wac_pen_event(struct hid_device *hdev, struct hid_field *field if (!usage->type || delay_pen_events(wacom_wac)) return; - /* send pen events only when the pen is in/entering/leaving proximity */ + /* send pen events only when the pen is in/entering/leaving range */ if (!wacom_wac->hid_data.inrange_state && !wacom_wac->tool[0]) return; @@ -2236,11 +2236,11 @@ static void wacom_wac_pen_report(struct hid_device *hdev, struct wacom *wacom = hid_get_drvdata(hdev); struct wacom_wac *wacom_wac = &wacom->wacom_wac; struct input_dev *input = wacom_wac->pen_input; - bool prox = wacom_wac->hid_data.inrange_state; - bool range = wacom_wac->hid_data.sense_state; + bool range = wacom_wac->hid_data.inrange_state; + bool sense = wacom_wac->hid_data.sense_state; - if (!wacom_wac->tool[0] && prox) { /* first in prox */ - /* Going into proximity select tool */ + if (!wacom_wac->tool[0] && range) { /* first in range */ + /* Going into range select tool */ if (wacom_wac->hid_data.invert_state) wacom_wac->tool[0] = BTN_TOOL_RUBBER; else if (wacom_wac->id[0]) @@ -2250,7 +2250,7 @@ static void wacom_wac_pen_report(struct hid_device *hdev, } /* keep pen state for touch events */ - wacom_wac->shared->stylus_in_proximity = range; + wacom_wac->shared->stylus_in_proximity = sense; if (!delay_pen_events(wacom_wac) && wacom_wac->tool[0]) { int id = wacom_wac->id[0]; @@ -2269,10 +2269,10 @@ static void wacom_wac_pen_report(struct hid_device *hdev, */ input_report_key(input, BTN_TOUCH, wacom_wac->hid_data.tipswitch); - input_report_key(input, wacom_wac->tool[0], prox); + input_report_key(input, wacom_wac->tool[0], range); if (wacom_wac->serial[0]) { input_event(input, EV_MSC, MSC_SERIAL, wacom_wac->serial[0]); - input_report_abs(input, ABS_MISC, prox ? id : 0); + input_report_abs(input, ABS_MISC, range ? id : 0); } wacom_wac->hid_data.tipswitch = false; @@ -2280,7 +2280,7 @@ static void wacom_wac_pen_report(struct hid_device *hdev, input_sync(input); } - if (!prox) { + if (!range) { wacom_wac->tool[0] = 0; wacom_wac->id[0] = 0; wacom_wac->serial[0] = 0;