aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gerecke <killertofu@gmail.com>2017-09-07 20:48:55 -0400
committerJiri Kosina <jkosina@suse.cz>2017-09-13 13:18:01 -0400
commit7690dd18ddeda98521f4966e60e1a70b97316d11 (patch)
treeb8443252b0b8e78f6a15fb9801105ff4b41a65f2
parent92380b572d95caf48f8424746aeee63c5a2b1922 (diff)
HID: wacom: generic: Use generic codepath terminology in wacom_wac_pen_report
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.gerecke@wacom.com> Signed-off-by: Ping Cheng <ping.cheng@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/wacom_wac.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index aa692e28b2cd..cdf95e1999d1 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
2217 if (!usage->type || delay_pen_events(wacom_wac)) 2217 if (!usage->type || delay_pen_events(wacom_wac))
2218 return; 2218 return;
2219 2219
2220 /* send pen events only when the pen is in/entering/leaving proximity */ 2220 /* send pen events only when the pen is in/entering/leaving range */
2221 if (!wacom_wac->hid_data.inrange_state && !wacom_wac->tool[0]) 2221 if (!wacom_wac->hid_data.inrange_state && !wacom_wac->tool[0])
2222 return; 2222 return;
2223 2223
@@ -2236,11 +2236,11 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
2236 struct wacom *wacom = hid_get_drvdata(hdev); 2236 struct wacom *wacom = hid_get_drvdata(hdev);
2237 struct wacom_wac *wacom_wac = &wacom->wacom_wac; 2237 struct wacom_wac *wacom_wac = &wacom->wacom_wac;
2238 struct input_dev *input = wacom_wac->pen_input; 2238 struct input_dev *input = wacom_wac->pen_input;
2239 bool prox = wacom_wac->hid_data.inrange_state; 2239 bool range = wacom_wac->hid_data.inrange_state;
2240 bool range = wacom_wac->hid_data.sense_state; 2240 bool sense = wacom_wac->hid_data.sense_state;
2241 2241
2242 if (!wacom_wac->tool[0] && prox) { /* first in prox */ 2242 if (!wacom_wac->tool[0] && range) { /* first in range */
2243 /* Going into proximity select tool */ 2243 /* Going into range select tool */
2244 if (wacom_wac->hid_data.invert_state) 2244 if (wacom_wac->hid_data.invert_state)
2245 wacom_wac->tool[0] = BTN_TOOL_RUBBER; 2245 wacom_wac->tool[0] = BTN_TOOL_RUBBER;
2246 else if (wacom_wac->id[0]) 2246 else if (wacom_wac->id[0])
@@ -2250,7 +2250,7 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
2250 } 2250 }
2251 2251
2252 /* keep pen state for touch events */ 2252 /* keep pen state for touch events */
2253 wacom_wac->shared->stylus_in_proximity = range; 2253 wacom_wac->shared->stylus_in_proximity = sense;
2254 2254
2255 if (!delay_pen_events(wacom_wac) && wacom_wac->tool[0]) { 2255 if (!delay_pen_events(wacom_wac) && wacom_wac->tool[0]) {
2256 int id = wacom_wac->id[0]; 2256 int id = wacom_wac->id[0];
@@ -2269,10 +2269,10 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
2269 */ 2269 */
2270 input_report_key(input, BTN_TOUCH, 2270 input_report_key(input, BTN_TOUCH,
2271 wacom_wac->hid_data.tipswitch); 2271 wacom_wac->hid_data.tipswitch);
2272 input_report_key(input, wacom_wac->tool[0], prox); 2272 input_report_key(input, wacom_wac->tool[0], range);
2273 if (wacom_wac->serial[0]) { 2273 if (wacom_wac->serial[0]) {
2274 input_event(input, EV_MSC, MSC_SERIAL, wacom_wac->serial[0]); 2274 input_event(input, EV_MSC, MSC_SERIAL, wacom_wac->serial[0]);
2275 input_report_abs(input, ABS_MISC, prox ? id : 0); 2275 input_report_abs(input, ABS_MISC, range ? id : 0);
2276 } 2276 }
2277 2277
2278 wacom_wac->hid_data.tipswitch = false; 2278 wacom_wac->hid_data.tipswitch = false;
@@ -2280,7 +2280,7 @@ static void wacom_wac_pen_report(struct hid_device *hdev,
2280 input_sync(input); 2280 input_sync(input);
2281 } 2281 }
2282 2282
2283 if (!prox) { 2283 if (!range) {
2284 wacom_wac->tool[0] = 0; 2284 wacom_wac->tool[0] = 0;
2285 wacom_wac->id[0] = 0; 2285 wacom_wac->id[0] = 0;
2286 wacom_wac->serial[0] = 0; 2286 wacom_wac->serial[0] = 0;