hid-emsff.c (48a732dfaa77a4dfec803aa8f248373998704f76) hid-emsff.c (d881427253da011495f4193663d809d0e9dfa215)
1/*
2 * Force feedback support for EMS Trio Linker Plus II
3 *
4 * Copyright (c) 2010 Ignaz Forster <ignaz.forster@gmx.de>
5 */
6
7/*
8 * This program is free software; you can redistribute it and/or modify

--- 9 unchanged lines hidden (view full) ---

18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23
24#include <linux/hid.h>
25#include <linux/input.h>
1/*
2 * Force feedback support for EMS Trio Linker Plus II
3 *
4 * Copyright (c) 2010 Ignaz Forster <ignaz.forster@gmx.de>
5 */
6
7/*
8 * This program is free software; you can redistribute it and/or modify

--- 9 unchanged lines hidden (view full) ---

18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23
24#include <linux/hid.h>
25#include <linux/input.h>
26#include <linux/usb.h>
27#include <linux/module.h>
28
29#include "hid-ids.h"
26#include <linux/module.h>
27
28#include "hid-ids.h"
30#include "usbhid/usbhid.h"
31
32struct emsff_device {
33 struct hid_report *report;
34};
35
36static int emsff_play(struct input_dev *dev, void *data,
37 struct ff_effect *effect)
38{

--- 8 unchanged lines hidden (view full) ---

47
48 weak = weak * 0xff / 0xffff;
49 strong = strong * 0xff / 0xffff;
50
51 emsff->report->field[0]->value[1] = weak;
52 emsff->report->field[0]->value[2] = strong;
53
54 dbg_hid("running with 0x%02x 0x%02x\n", strong, weak);
29
30struct emsff_device {
31 struct hid_report *report;
32};
33
34static int emsff_play(struct input_dev *dev, void *data,
35 struct ff_effect *effect)
36{

--- 8 unchanged lines hidden (view full) ---

45
46 weak = weak * 0xff / 0xffff;
47 strong = strong * 0xff / 0xffff;
48
49 emsff->report->field[0]->value[1] = weak;
50 emsff->report->field[0]->value[2] = strong;
51
52 dbg_hid("running with 0x%02x 0x%02x\n", strong, weak);
55 usbhid_submit_report(hid, emsff->report, USB_DIR_OUT);
53 hid_hw_request(hid, emsff->report, HID_REQ_SET_REPORT);
56
57 return 0;
58}
59
60static int emsff_init(struct hid_device *hid)
61{
62 struct emsff_device *emsff;
63 struct hid_report *report;

--- 35 unchanged lines hidden (view full) ---

99 emsff->report = report;
100 emsff->report->field[0]->value[0] = 0x01;
101 emsff->report->field[0]->value[1] = 0x00;
102 emsff->report->field[0]->value[2] = 0x00;
103 emsff->report->field[0]->value[3] = 0x00;
104 emsff->report->field[0]->value[4] = 0x00;
105 emsff->report->field[0]->value[5] = 0x00;
106 emsff->report->field[0]->value[6] = 0x00;
54
55 return 0;
56}
57
58static int emsff_init(struct hid_device *hid)
59{
60 struct emsff_device *emsff;
61 struct hid_report *report;

--- 35 unchanged lines hidden (view full) ---

97 emsff->report = report;
98 emsff->report->field[0]->value[0] = 0x01;
99 emsff->report->field[0]->value[1] = 0x00;
100 emsff->report->field[0]->value[2] = 0x00;
101 emsff->report->field[0]->value[3] = 0x00;
102 emsff->report->field[0]->value[4] = 0x00;
103 emsff->report->field[0]->value[5] = 0x00;
104 emsff->report->field[0]->value[6] = 0x00;
107 usbhid_submit_report(hid, emsff->report, USB_DIR_OUT);
105 hid_hw_request(hid, emsff->report, HID_REQ_SET_REPORT);
108
109 hid_info(hid, "force feedback for EMS based devices by Ignaz Forster <ignaz.forster@gmx.de>\n");
110
111 return 0;
112}
113
114static int ems_probe(struct hid_device *hdev, const struct hid_device_id *id)
115{

--- 41 unchanged lines hidden ---
106
107 hid_info(hid, "force feedback for EMS based devices by Ignaz Forster <ignaz.forster@gmx.de>\n");
108
109 return 0;
110}
111
112static int ems_probe(struct hid_device *hdev, const struct hid_device_id *id)
113{

--- 41 unchanged lines hidden ---