hid-pl.c (48a732dfaa77a4dfec803aa8f248373998704f76) | hid-pl.c (d881427253da011495f4193663d809d0e9dfa215) |
---|---|
1/* 2 * Force feedback support for PantherLord/GreenAsia based devices 3 * 4 * The devices are distributed under various names and the same USB device ID 5 * can be used in both adapters and actual game controllers. 6 * 7 * 0810:0001 "Twin USB Joystick" 8 * - tested with PantherLord USB/PS2 2in1 Adapter --- 29 unchanged lines hidden (view full) --- 38 39/* #define DEBUG */ 40 41#define debug(format, arg...) pr_debug("hid-plff: " format "\n" , ## arg) 42 43#include <linux/input.h> 44#include <linux/slab.h> 45#include <linux/module.h> | 1/* 2 * Force feedback support for PantherLord/GreenAsia based devices 3 * 4 * The devices are distributed under various names and the same USB device ID 5 * can be used in both adapters and actual game controllers. 6 * 7 * 0810:0001 "Twin USB Joystick" 8 * - tested with PantherLord USB/PS2 2in1 Adapter --- 29 unchanged lines hidden (view full) --- 38 39/* #define DEBUG */ 40 41#define debug(format, arg...) pr_debug("hid-plff: " format "\n" , ## arg) 42 43#include <linux/input.h> 44#include <linux/slab.h> 45#include <linux/module.h> |
46#include <linux/usb.h> | |
47#include <linux/hid.h> 48 49#include "hid-ids.h" 50 51#ifdef CONFIG_PANTHERLORD_FF | 46#include <linux/hid.h> 47 48#include "hid-ids.h" 49 50#ifdef CONFIG_PANTHERLORD_FF |
52#include "usbhid/usbhid.h" | |
53 54struct plff_device { 55 struct hid_report *report; 56 s32 maxval; 57 s32 *strong; 58 s32 *weak; 59}; 60 --- 9 unchanged lines hidden (view full) --- 70 debug("called with 0x%04x 0x%04x", left, right); 71 72 left = left * plff->maxval / 0xffff; 73 right = right * plff->maxval / 0xffff; 74 75 *plff->strong = left; 76 *plff->weak = right; 77 debug("running with 0x%02x 0x%02x", left, right); | 51 52struct plff_device { 53 struct hid_report *report; 54 s32 maxval; 55 s32 *strong; 56 s32 *weak; 57}; 58 --- 9 unchanged lines hidden (view full) --- 68 debug("called with 0x%04x 0x%04x", left, right); 69 70 left = left * plff->maxval / 0xffff; 71 right = right * plff->maxval / 0xffff; 72 73 *plff->strong = left; 74 *plff->weak = right; 75 debug("running with 0x%02x 0x%02x", left, right); |
78 usbhid_submit_report(hid, plff->report, USB_DIR_OUT); | 76 hid_hw_request(hid, plff->report, HID_REQ_SET_REPORT); |
79 80 return 0; 81} 82 83static int plff_init(struct hid_device *hid) 84{ 85 struct plff_device *plff; 86 struct hid_report *report; --- 77 unchanged lines hidden (view full) --- 164 165 plff->report = report; 166 plff->strong = strong; 167 plff->weak = weak; 168 plff->maxval = maxval; 169 170 *strong = 0x00; 171 *weak = 0x00; | 77 78 return 0; 79} 80 81static int plff_init(struct hid_device *hid) 82{ 83 struct plff_device *plff; 84 struct hid_report *report; --- 77 unchanged lines hidden (view full) --- 162 163 plff->report = report; 164 plff->strong = strong; 165 plff->weak = weak; 166 plff->maxval = maxval; 167 168 *strong = 0x00; 169 *weak = 0x00; |
172 usbhid_submit_report(hid, plff->report, USB_DIR_OUT); | 170 hid_hw_request(hid, plff->report, HID_REQ_SET_REPORT); |
173 } 174 175 hid_info(hid, "Force feedback for PantherLord/GreenAsia devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); 176 177 return 0; 178} 179#else 180static inline int plff_init(struct hid_device *hid) --- 50 unchanged lines hidden --- | 171 } 172 173 hid_info(hid, "Force feedback for PantherLord/GreenAsia devices by Anssi Hannula <anssi.hannula@gmail.com>\n"); 174 175 return 0; 176} 177#else 178static inline int plff_init(struct hid_device *hid) --- 50 unchanged lines hidden --- |