Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
16e5617e
Commit
16e5617e
authored
Feb 12, 2003
by
Zinx Verituse
Committed by
Vojtech Pavlik
Feb 12, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: Add support for ThrustMaster ForceFeedback USB HID devices.
parent
2a5ae84e
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
484 additions
and
8 deletions
+484
-8
drivers/usb/input/Kconfig
drivers/usb/input/Kconfig
+10
-2
drivers/usb/input/Makefile
drivers/usb/input/Makefile
+3
-0
drivers/usb/input/fixp-arith.h
drivers/usb/input/fixp-arith.h
+6
-6
drivers/usb/input/hid-ff.c
drivers/usb/input/hid-ff.c
+4
-0
drivers/usb/input/hid-tmff.c
drivers/usb/input/hid-tmff.c
+461
-0
No files found.
drivers/usb/input/Kconfig
View file @
16e5617e
...
...
@@ -49,7 +49,7 @@ config HID_FF
If unsure, say N.
config HID_PID
bool "PID Devices"
bool "PID Devices
(Microsoft Sidewinder Force Feedback 2)
"
depends on HID_FF
help
Say Y here if you have a PID-compliant joystick and wish to enable force
...
...
@@ -67,6 +67,15 @@ config LOGITECH_FF
Note: if you say N here, this device will still be supported, but without
force feedback.
config THRUSTMASTER_FF
bool "ThrustMaster FireStorm Dual Power 2 support (EXPERIMENTAL)"
depends on HID_FF && EXPERIMENTAL
help
Say Y here if you have a THRUSTMASTER FireStore Dual Power 2,
and want to enable force feedback support for it.
Note: if you say N here, this device will still be supported, but without
force feedback.
config USB_HIDDEV
bool "/dev/hiddev raw HID device support"
depends on USB_HID
...
...
@@ -81,7 +90,6 @@ config USB_HIDDEV
If unsure, say Y.
menu "USB HID Boot Protocol drivers"
depends on USB!=n && USB_HID!=y
...
...
drivers/usb/input/Makefile
View file @
16e5617e
...
...
@@ -19,6 +19,9 @@ endif
ifeq
($(CONFIG_LOGITECH_FF),y)
hid-objs
+=
hid-lgff.o
endif
ifeq
($(CONFIG_THRUSTMASTER_FF),y)
hid-objs
+=
hid-tmff.o
endif
ifeq
($(CONFIG_HID_FF),y)
hid-objs
+=
hid-ff.o
endif
...
...
drivers/usb/input/fixp-arith.h
View file @
16e5617e
...
...
@@ -38,7 +38,7 @@ typedef s16 fixp_t;
#define FRAC_MASK ((1<<FRAC_N)-1)
// Not to be used directly. Use fixp_{cos,sin}
fixp_t
cos_table
[
45
]
=
{
static
fixp_t
cos_table
[
45
]
=
{
0x0100
,
0x00FF
,
0x00FF
,
0x00FE
,
0x00FD
,
0x00FC
,
0x00FA
,
0x00F8
,
0x00F6
,
0x00F3
,
0x00F0
,
0x00ED
,
0x00E9
,
0x00E6
,
0x00E2
,
0x00DD
,
0x00D9
,
0x00D4
,
0x00CF
,
0x00C9
,
0x00C4
,
0x00BE
,
0x00B8
,
0x00B1
,
...
...
@@ -49,7 +49,7 @@ fixp_t cos_table[45] = {
/* a: 123 -> 123.0 */
inline
fixp_t
fixp_new
(
s16
a
)
static
inline
fixp_t
fixp_new
(
s16
a
)
{
return
a
<<
FRAC_N
;
}
...
...
@@ -58,12 +58,12 @@ inline fixp_t fixp_new(s16 a)
0x8000 -> 1.0
0x0000 -> 0.0
*/
inline
fixp_t
fixp_new16
(
s16
a
)
static
inline
fixp_t
fixp_new16
(
s16
a
)
{
return
((
s32
)
a
)
>>
(
16
-
FRAC_N
);
}
inline
fixp_t
fixp_cos
(
unsigned
int
degrees
)
static
inline
fixp_t
fixp_cos
(
unsigned
int
degrees
)
{
int
quadrant
=
(
degrees
/
90
)
&
3
;
unsigned
int
i
=
degrees
%
90
;
...
...
@@ -77,12 +77,12 @@ inline fixp_t fixp_cos(unsigned int degrees)
return
(
quadrant
==
1
||
quadrant
==
2
)
?
-
cos_table
[
i
]
:
cos_table
[
i
];
}
inline
fixp_t
fixp_sin
(
unsigned
int
degrees
)
static
inline
fixp_t
fixp_sin
(
unsigned
int
degrees
)
{
return
-
fixp_cos
(
degrees
+
90
);
}
inline
fixp_t
fixp_mult
(
fixp_t
a
,
fixp_t
b
)
static
inline
fixp_t
fixp_mult
(
fixp_t
a
,
fixp_t
b
)
{
return
((
s32
)(
a
*
b
))
>>
FRAC_N
;
}
...
...
drivers/usb/input/hid-ff.c
View file @
16e5617e
...
...
@@ -38,6 +38,7 @@
extern
int
hid_lgff_init
(
struct
hid_device
*
hid
);
extern
int
hid_lg3d_init
(
struct
hid_device
*
hid
);
extern
int
hid_pid_init
(
struct
hid_device
*
hid
);
extern
int
hid_tmff_init
(
struct
hid_device
*
hid
);
/*
* This table contains pointers to initializers. To add support for new
...
...
@@ -56,6 +57,9 @@ static struct hid_ff_initializer inits[] = {
#endif
#ifdef CONFIG_HID_PID
{
0x45e
,
0x001b
,
hid_pid_init
},
#endif
#ifdef CONFIG_THRUSTMASTER_FF
{
0x44f
,
0xb304
,
hid_tmff_init
},
#endif
{
0
,
0
,
NULL
}
/* Terminating entry */
};
...
...
drivers/usb/input/hid-tmff.c
0 → 100644
View file @
16e5617e
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment