]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
drivers: hid: Disable haptics on blake
authorAnkita Garg <ankitag@nvidia.com>
Wed, 14 Oct 2015 20:05:45 +0000 (13:05 -0700)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 6 Nov 2015 16:25:27 +0000 (08:25 -0800)
Bug 1694535

Change-Id: I684a82bf8652cc8405b79dd09621c026825e4cf8
Signed-off-by: Ankita Garg <ankitag@nvidia.com>
Reviewed-on: http://git-master/r/817736
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Toby Butzon <tbutzon@nvidia.com>
Reviewed-by: Vinayak Pane <vpane@nvidia.com>
drivers/hid/hid-nvidia-blake.c

index 34ac316a3c0ef8d9555513b38c631d3bad484c2f..8828e337c308abbe991df6d90abb9f216d226be1 100644 (file)
@@ -370,32 +370,6 @@ static ssize_t blake_store_speed(struct device *dev,
        return count;
 }
 
-
-static int nvidia_ff_play(struct input_dev *dev, void *data,
-                        struct ff_effect *effect)
-{
-       struct hid_device *hid = input_get_drvdata(dev);
-       struct nvidia_tp_loc *loc = data;
-       int left, right, length;
-
-       left = effect->u.rumble.strong_magnitude;
-       right = effect->u.rumble.weak_magnitude;
-       length = effect->replay.length;
-
-       dbg_hid("called with 0x%04x 0x%04x 0x%04x", left, right, length);
-
-       length = length > 10000 ? 10000 : length;
-
-       loc->ff_report->field[0]->value[0] = left;
-       loc->ff_report->field[0]->value[1] = right;
-       loc->ff_report->field[0]->value[2] = length;
-
-       hid_hw_request(hid, loc->ff_report, HID_REQ_SET_REPORT);
-
-       return 0;
-}
-
-
 static int nvidia_find_tp_len(struct hid_device *hdev,
        struct nvidia_tp_loc *loc)
 {
@@ -431,56 +405,6 @@ static int nvidia_find_tp_len(struct hid_device *hdev,
        return 0;
 }
 
-static int nvidia_init_ff(struct hid_device *hdev, struct nvidia_tp_loc *loc)
-{
-       struct hid_report *report;
-       struct hid_input *hidinput = list_entry(hdev->inputs.next,
-                                               struct hid_input, list);
-       struct list_head *report_list =
-                       &hdev->report_enum[HID_OUTPUT_REPORT].report_list;
-       struct input_dev *dev = hidinput->input;
-       int error;
-
-       if (list_empty(report_list)) {
-               hid_err(hdev, "no output reports found\n");
-               return -ENODEV;
-       }
-
-       list_for_each_entry(report, report_list, list) {
-               if (report->maxfield < 1) {
-                       hid_warn(hdev, "no fields in the report\n");
-                       continue;
-               }
-
-               if (report->field[0]->report_count != 3) {
-                       hid_warn(hdev, "not right number of values in the field\n");
-                       continue;
-               }
-
-               goto found_report;
-       }
-       hid_warn(hdev, "FF report not found\n");
-       loc->ff_report = NULL;
-       return -ENODEV;
-
-found_report:
-       loc->ff_report = report;
-
-       set_bit(FF_RUMBLE, dev->ffbit);
-       error = input_ff_create_memless(dev, loc, nvidia_ff_play);
-
-       if (error) {
-               loc->ff_report = NULL;
-               clear_bit(FF_RUMBLE, dev->ffbit);
-               hid_warn(hdev, "Couldn't create FF device");
-               return error;
-       }
-
-       hid_info(hdev, "Force feedback enabled\n");
-
-       return 0;
-}
-
 static DEVICE_ATTR(speed, S_IRUGO | S_IWUSR,
        blake_show_speed, blake_store_speed);
 static DEVICE_ATTR(mode, S_IRUGO | S_IWUSR,
@@ -517,7 +441,6 @@ static int nvidia_probe(struct hid_device *hdev, const struct hid_device_id *id)
        if (ret)
                goto err_parse;
 
-       nvidia_init_ff(hdev, loc);
        nvidia_find_tp_len(hdev, loc);
 
        ret = device_create_file(&hdev->dev, &dev_attr_speed);