FGT

2013-08-13 Thread MHQ1
Dear winner,

Microsoft organization is glad to pronounce your email ID as the lucky winner 
of £1,000,000'00 send us the following details to claims award.Do note that no 
ticket was sold nor ballot paper,it was conducted via random selection of so 
many emails and your email emerge as a beneficiary send us the following 
details.

Name in Full:
Date of birth:
Gender:
Full Address:
Mobile Number:
Job:

Thank you.
IRENE TINA
MICROSOFT.
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


HID: add support for Thrustmaster FGT Force Feedback wheel

2007-10-14 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b27c9590ca0f44681fe2504a7ec427ff1bb77e82
Commit: b27c9590ca0f44681fe2504a7ec427ff1bb77e82
Parent: 933e3187d0042d9381d932757dc1f931d984e56d
Author: Dmitry Torokhov [EMAIL PROTECTED]
AuthorDate: Mon Jul 30 14:56:26 2007 +0200
Committer:  Jiri Kosina [EMAIL PROTECTED]
CommitDate: Sun Oct 14 13:40:00 2007 +0200

HID: add support for Thrustmaster FGT Force Feedback wheel

Rework thrustmaster force-feedback module to support devices having
different types of force feedback effects. Add signatures of
Thrustmaster FGT Rumble Force and Thrustmaster FGT Force Feedback
wheels to the list of devices dupported by the module.

Parts of the patch were lifted off a simalar patch by
Anssi Hannula [EMAIL PROTECTED]

Signed-off-by: Dmitry Torokhov [EMAIL PROTECTED]
Signed-off-by: Jiri Kosina [EMAIL PROTECTED]
---
 drivers/hid/usbhid/Kconfig|5 +-
 drivers/hid/usbhid/hid-ff.c   |2 +
 drivers/hid/usbhid/hid-tmff.c |  161 ++---
 3 files changed, 124 insertions(+), 44 deletions(-)

diff --git a/drivers/hid/usbhid/Kconfig b/drivers/hid/usbhid/Kconfig
index 1b4b572..b27023f 100644
--- a/drivers/hid/usbhid/Kconfig
+++ b/drivers/hid/usbhid/Kconfig
@@ -79,11 +79,12 @@ config PANTHERLORD_FF
  to enable force feedback support for it.
 
 config THRUSTMASTER_FF
-   bool ThrustMaster FireStorm Dual Power 2 support (EXPERIMENTAL)
+   bool ThrustMaster devices support (EXPERIMENTAL)
depends on HID_FF  EXPERIMENTAL
select INPUT_FF_MEMLESS if USB_HID
help
- Say Y here if you have a THRUSTMASTER FireStore Dual Power 2,
+ Say Y here if you have a THRUSTMASTER FireStore Dual Power 2 or
+ a THRUSTMASTER Ferrari GT Rumble Force or Force Feedback Wheel,
  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.
diff --git a/drivers/hid/usbhid/hid-ff.c b/drivers/hid/usbhid/hid-ff.c
index 23431fb..5dacd8e 100644
--- a/drivers/hid/usbhid/hid-ff.c
+++ b/drivers/hid/usbhid/hid-ff.c
@@ -67,6 +67,8 @@ static struct hid_ff_initializer inits[] = {
 #ifdef CONFIG_THRUSTMASTER_FF
{ 0x44f, 0xb300, hid_tmff_init },
{ 0x44f, 0xb304, hid_tmff_init },
+   { 0x44f, 0xb651, hid_tmff_init }, /* FGT Rumble Force Wheel */
+   { 0x44f, 0xb654, hid_tmff_init }, /* FGT Force Feedback Wheel */
 #endif
 #ifdef CONFIG_ZEROPLUS_FF
{ 0xc12, 0x0005, hid_zpff_init },
diff --git a/drivers/hid/usbhid/hid-tmff.c b/drivers/hid/usbhid/hid-tmff.c
index 555bb48..69882a7 100644
--- a/drivers/hid/usbhid/hid-tmff.c
+++ b/drivers/hid/usbhid/hid-tmff.c
@@ -36,16 +36,39 @@
 #include usbhid.h
 
 /* Usages for thrustmaster devices I know about */
-#define THRUSTMASTER_USAGE_RUMBLE_LR   (HID_UP_GENDESK | 0xbb)
+#define THRUSTMASTER_USAGE_FF  (HID_UP_GENDESK | 0xbb)
 
+struct dev_type {
+   u16 idVendor;
+   u16 idProduct;
+   const signed short *ff;
+};
+
+static const signed short ff_rumble[] = {
+   FF_RUMBLE,
+   -1
+};
+
+static const signed short ff_joystick[] = {
+   FF_CONSTANT,
+   -1
+};
+
+static const struct dev_type devices[] = {
+   { 0x44f, 0xb300, ff_rumble },
+   { 0x44f, 0xb304, ff_rumble },
+   { 0x44f, 0xb651, ff_rumble },   /* FGT Rumble Force Wheel */
+   { 0x44f, 0xb654, ff_joystick }, /* FGT Force Feedback Wheel */
+};
 
 struct tmff_device {
struct hid_report *report;
-   struct hid_field *rumble;
+   struct hid_field *ff_field;
 };
 
 /* Changes values from 0 to 0x into values from minimum to maximum */
-static inline int hid_tmff_scale(unsigned int in, int minimum, int maximum)
+static inline int hid_tmff_scale_u16(unsigned int in,
+   int minimum, int maximum)
 {
int ret;
 
@@ -57,22 +80,57 @@ static inline int hid_tmff_scale(unsigned int in, int 
minimum, int maximum)
return ret;
 }
 
+/* Changes values from -0x80 to 0x7f into values from minimum to maximum */
+static inline int hid_tmff_scale_s8(int in,
+   int minimum, int maximum)
+{
+   int ret;
+
+   ret = (((in + 0x80) * (maximum - minimum)) / 0xff) + minimum;
+   if (ret  minimum)
+   return minimum;
+   if (ret  maximum)
+   return maximum;
+   return ret;
+}
+
 static int hid_tmff_play(struct input_dev *dev, void *data, struct ff_effect 
*effect)
 {
struct hid_device *hid = input_get_drvdata(dev);
struct tmff_device *tmff = data;
+   struct hid_field *ff_field = tmff-ff_field;
+   int x, y;
int left, right;/* Rumbling */
 
-   left = hid_tmff_scale(effect-u.rumble.weak_magnitude,
-   tmff-rumble-logical_minimum, tmff-rumble-logical_maximum);
-   right = hid_tmff_scale