From: Jason Gerecke <killert...@gmail.com>

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 <jason.gere...@wacom.com>
Signed-off-by: Ping Cheng <ping.ch...@wacom.com>
Signed-off-by: Jiri Kosina <jkos...@suse.cz>
[aaron.sko...@wacom.com: Imported into input-wacom repository (7690dd18dded)]
Signed-off-by: Aaron Armstrong Skomra <aaron.sko...@wacom.com>
[aaron.sko...@wacom.com: Backported from input-wacom repository (d6172ef487c1)]
Signed-off-by: Aaron Armstrong Skomra <aaron.sko...@wacom.com>
---
 3.17/wacom_wac.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/3.17/wacom_wac.c b/3.17/wacom_wac.c
index 6841bab879e2..a15e1e73d6da 100644
--- a/3.17/wacom_wac.c
+++ b/3.17/wacom_wac.c
@@ -2226,7 +2226,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;
 
@@ -2245,11 +2245,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])
@@ -2259,7 +2259,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];
@@ -2278,10 +2278,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;
@@ -2289,7 +2289,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;
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to