Skip to content

Commit

Permalink
Input: wacom - fix physical size calculation for 3rd-gen Bamboo
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jason Gerecke authored and Dmitry Torokhov committed Mar 13, 2012
1 parent 7a0a1df commit 24e3e5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/input/tablet/wacom_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand Down

0 comments on commit 24e3e5a

Please sign in to comment.