]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - drivers/hid/hid-lgff.c
Merge branches 'doc', 'multitouch', 'upstream' and 'upstream-fixes' into for-linus
[linux-2.6.git] / drivers / hid / hid-lgff.c
index 9735be6ee4ffbfb3a7cbe374130f04c477ea9874..088f85049290164a92167dbdda3ef6480f1a3f5e 100644 (file)
@@ -27,6 +27,8 @@
  * e-mail - mail your message to <johann.deneux@it.uu.se>
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/input.h>
 #include <linux/usb.h>
 #include <linux/hid.h>
@@ -50,6 +52,12 @@ static const signed short ff_joystick[] = {
        -1
 };
 
+static const signed short ff_joystick_ac[] = {
+       FF_CONSTANT,
+       FF_AUTOCENTER,
+       -1
+};
+
 static const signed short ff_wheel[] = {
        FF_CONSTANT,
        FF_AUTOCENTER,
@@ -60,9 +68,16 @@ static const struct dev_type devices[] = {
        { 0x046d, 0xc211, ff_rumble },
        { 0x046d, 0xc219, ff_rumble },
        { 0x046d, 0xc283, ff_joystick },
-       { 0x046d, 0xc286, ff_joystick },
+       { 0x046d, 0xc286, ff_joystick_ac },
+       { 0x046d, 0xc287, ff_joystick_ac },
+       { 0x046d, 0xc293, ff_joystick },
        { 0x046d, 0xc294, ff_wheel },
+       { 0x046d, 0xc298, ff_wheel },
+       { 0x046d, 0xc299, ff_wheel },
+       { 0x046d, 0xc29b, ff_wheel },
        { 0x046d, 0xc295, ff_joystick },
+       { 0x046d, 0xc298, ff_wheel },
+       { 0x046d, 0xc299, ff_wheel },
        { 0x046d, 0xca03, ff_wheel },
 };
 
@@ -138,20 +153,15 @@ int lgff_init(struct hid_device* hid)
 
        /* Find the report to use */
        if (list_empty(report_list)) {
-               err_hid("No output report found");
+               hid_err(hid, "No output report found\n");
                return -1;
        }
 
        /* Check that the report looks ok */
        report = list_entry(report_list->next, struct hid_report, list);
-       if (!report) {
-               err_hid("NULL output report");
-               return -1;
-       }
-
        field = report->field[0];
        if (!field) {
-               err_hid("NULL field");
+               hid_err(hid, "NULL field\n");
                return -1;
        }
 
@@ -173,7 +183,7 @@ int lgff_init(struct hid_device* hid)
        if ( test_bit(FF_AUTOCENTER, dev->ffbit) )
                dev->ff->set_autocenter = hid_lgff_set_autocenter;
 
-       printk(KERN_INFO "Force feedback for Logitech force feedback devices by Johann Deneux <johann.deneux@it.uu.se>\n");
+       pr_info("Force feedback for Logitech force feedback devices by Johann Deneux <johann.deneux@it.uu.se>\n");
 
        return 0;
 }