43 lines
1.6 KiB
Diff
43 lines
1.6 KiB
Diff
From: Jason Gerecke <killertofu@gmail.com>
|
|
Date: Mon, 12 Mar 2012 22:15:43 -0700
|
|
Subject: Input: wacom - fix physical size calculation for 3rd-gen Bamboo
|
|
|
|
commit 24e3e5ae1e4c2a3a32f5b1f96b4e3fd721806acd upstream.
|
|
|
|
This calculation determines the physical dimensions of the tablet,
|
|
used later on in calculate_touch_res to obtain the touch sensor
|
|
resolution.
|
|
|
|
Instead of dividing the logical size by the resolution, the current
|
|
code performs a multiplication. This doesn't pose a problem for the
|
|
3rd-gen Bamboo since the resolution and scale factor happen to be
|
|
identical, but will produce an incorrect result for other cases.
|
|
|
|
Signed-off-by: Jason Gerecke <killertofu@gmail.com>
|
|
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
|
|
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
|
|
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
|
|
---
|
|
drivers/input/tablet/wacom_sys.c | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
|
|
index c9588eececfb..dc07821fdae3 100644
|
|
--- a/drivers/input/tablet/wacom_sys.c
|
|
+++ b/drivers/input/tablet/wacom_sys.c
|
|
@@ -184,9 +184,9 @@ static int wacom_parse_logical_collection(unsigned char *report,
|
|
* data before its overwritten.
|
|
*/
|
|
features->x_phy =
|
|
- (features->x_max * features->x_resolution) / 100;
|
|
+ (features->x_max * 100) / features->x_resolution;
|
|
features->y_phy =
|
|
- (features->y_max * features->y_resolution) / 100;
|
|
+ (features->y_max * 100) / features->y_resolution;
|
|
|
|
features->x_max = features->y_max =
|
|
get_unaligned_le16(&report[10]);
|
|
--
|
|
1.7.10.1
|
|
|