aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-wacom.c
diff options
context:
space:
mode:
authorPrzemo Firszt <przemo@firszt.eu>2012-05-15 14:32:26 -0400
committerJiri Kosina <jkosina@suse.cz>2012-05-16 15:42:15 -0400
commitbe4925b018b3c398d2775826091c693f214630a8 (patch)
treef3b76c998ef5b22c730301df00ddc92e3593fc33 /drivers/hid/hid-wacom.c
parent163a6ae19b8f6afc4ac4f60711b998a3c150b858 (diff)
HID: wacom: Add speed setting for Intuos4 WL
Add option to change reporting speed for Intuos4 WL. The option is only internal to the module, but it will be extended to allow control over sysfs, as it is already implemented for Graphire. Signed-off-by: Przemo Firszt <przemo@firszt.eu> Acked-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-wacom.c')
-rw-r--r--drivers/hid/hid-wacom.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index 4fc4eebe9784..5f6ce70c23fb 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -228,16 +228,25 @@ static int wacom_ac_get_property(struct power_supply *psy,
228 return ret; 228 return ret;
229} 229}
230 230
231static void wacom_set_features(struct hid_device *hdev) 231static void wacom_set_features(struct hid_device *hdev, u8 speed)
232{ 232{
233 struct wacom_data *wdata = hid_get_drvdata(hdev);
233 int ret; 234 int ret;
234 __u8 rep_data[2]; 235 __u8 rep_data[2];
235 236
236 /*set high speed, tablet mode*/ 237 if (speed == 1)
238 wdata->features &= ~0x20;
239 else
240 wdata->features |= 0x20;
241
237 rep_data[0] = 0x03; 242 rep_data[0] = 0x03;
238 rep_data[1] = 0x20; 243 rep_data[1] = wdata->features;
244
239 ret = hdev->hid_output_raw_report(hdev, rep_data, 2, 245 ret = hdev->hid_output_raw_report(hdev, rep_data, 2,
240 HID_FEATURE_REPORT); 246 HID_FEATURE_REPORT);
247 if (ret >= 0)
248 wdata->high_speed = speed;
249
241 return; 250 return;
242} 251}
243 252
@@ -719,7 +728,7 @@ static int wacom_probe(struct hid_device *hdev,
719 case USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH: 728 case USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH:
720 sprintf(hdev->name, "%s", "Wacom Intuos4 WL"); 729 sprintf(hdev->name, "%s", "Wacom Intuos4 WL");
721 wdata->features = 0; 730 wdata->features = 0;
722 wacom_set_features(hdev); 731 wacom_set_features(hdev, 1);
723 ret = wacom_initialize_leds(hdev); 732 ret = wacom_initialize_leds(hdev);
724 if (ret) { 733 if (ret) {
725 hid_warn(hdev, 734 hid_warn(hdev,