diff options
author | Ping Cheng <pinglinux@gmail.com> | 2015-04-15 19:54:14 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-04-23 04:02:21 -0400 |
commit | 3d64f54dd0de57bdbcde4b91495fb8e02c620762 (patch) | |
tree | 42849bb70c0d8af8741e284894702dcdf0edd3cd | |
parent | 42f4f272746f9e4e3fecb4440dc2429822b6950b (diff) |
HID: wacom: move unit and unitExpo initialization to wacom_calculate_res
That is where they belong...
Signed-off-by: Ping Cheng <pingc@wacom.com>
Reviewed-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | drivers/hid/wacom_sys.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index 13d8c8fa8ed4..b3c6f111093b 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c | |||
@@ -1369,6 +1369,12 @@ static void wacom_set_default_phy(struct wacom_features *features) | |||
1369 | 1369 | ||
1370 | static void wacom_calculate_res(struct wacom_features *features) | 1370 | static void wacom_calculate_res(struct wacom_features *features) |
1371 | { | 1371 | { |
1372 | /* set unit to "100th of a mm" for devices not reported by HID */ | ||
1373 | if (!features->unit) { | ||
1374 | features->unit = 0x11; | ||
1375 | features->unitExpo = -3; | ||
1376 | } | ||
1377 | |||
1372 | features->x_resolution = wacom_calc_hid_res(features->x_max, | 1378 | features->x_resolution = wacom_calc_hid_res(features->x_max, |
1373 | features->x_phy, | 1379 | features->x_phy, |
1374 | features->unit, | 1380 | features->unit, |
@@ -1476,12 +1482,6 @@ static int wacom_probe(struct hid_device *hdev, | |||
1476 | wacom_retrieve_hid_descriptor(hdev, features); | 1482 | wacom_retrieve_hid_descriptor(hdev, features); |
1477 | 1483 | ||
1478 | wacom_setup_device_quirks(wacom); | 1484 | wacom_setup_device_quirks(wacom); |
1479 | |||
1480 | /* set unit to "100th of a mm" for devices not reported by HID */ | ||
1481 | if (!features->unit) { | ||
1482 | features->unit = 0x11; | ||
1483 | features->unitExpo = -3; | ||
1484 | } | ||
1485 | wacom_calculate_res(features); | 1485 | wacom_calculate_res(features); |
1486 | 1486 | ||
1487 | strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); | 1487 | strlcpy(wacom_wac->name, features->name, sizeof(wacom_wac->name)); |