Commit 9f8b483c authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

Pull HID fixes from Jiri Kosina:

 - fix for ordering of device removal actions in hidraw, by Fernando
   Luis Vázquez Cao

 - fix for uninitialized workqueue usage in hid-sony, by Frank Praznik

 - device ID addition for new variant of Logitech G27, from Simon Wood

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: hid-lg4ff: Support new version of G27
  HID: hidraw: fix warning destroying hidraw device files after parent
  HID: sony: Fix work queue issues.
parents dcb99fd9 6b5625b2
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
#define G25_REV_MIN 0x22 #define G25_REV_MIN 0x22
#define G27_REV_MAJ 0x12 #define G27_REV_MAJ 0x12
#define G27_REV_MIN 0x38 #define G27_REV_MIN 0x38
#define G27_2_REV_MIN 0x39
#define to_hid_device(pdev) container_of(pdev, struct hid_device, dev) #define to_hid_device(pdev) container_of(pdev, struct hid_device, dev)
...@@ -130,6 +131,7 @@ static const struct lg4ff_usb_revision lg4ff_revs[] = { ...@@ -130,6 +131,7 @@ static const struct lg4ff_usb_revision lg4ff_revs[] = {
{DFP_REV_MAJ, DFP_REV_MIN, &native_dfp}, /* Driving Force Pro */ {DFP_REV_MAJ, DFP_REV_MIN, &native_dfp}, /* Driving Force Pro */
{G25_REV_MAJ, G25_REV_MIN, &native_g25}, /* G25 */ {G25_REV_MAJ, G25_REV_MIN, &native_g25}, /* G25 */
{G27_REV_MAJ, G27_REV_MIN, &native_g27}, /* G27 */ {G27_REV_MAJ, G27_REV_MIN, &native_g27}, /* G27 */
{G27_REV_MAJ, G27_2_REV_MIN, &native_g27}, /* G27 v2 */
}; };
/* Recalculates X axis value accordingly to currently selected range */ /* Recalculates X axis value accordingly to currently selected range */
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
#define DUALSHOCK4_CONTROLLER_BT BIT(6) #define DUALSHOCK4_CONTROLLER_BT BIT(6)
#define SONY_LED_SUPPORT (SIXAXIS_CONTROLLER_USB | BUZZ_CONTROLLER | DUALSHOCK4_CONTROLLER_USB) #define SONY_LED_SUPPORT (SIXAXIS_CONTROLLER_USB | BUZZ_CONTROLLER | DUALSHOCK4_CONTROLLER_USB)
#define SONY_FF_SUPPORT (SIXAXIS_CONTROLLER_USB | DUALSHOCK4_CONTROLLER_USB)
#define MAX_LEDS 4 #define MAX_LEDS 4
...@@ -499,6 +500,7 @@ struct sony_sc { ...@@ -499,6 +500,7 @@ struct sony_sc {
__u8 right; __u8 right;
#endif #endif
__u8 worker_initialized;
__u8 led_state[MAX_LEDS]; __u8 led_state[MAX_LEDS];
__u8 led_count; __u8 led_count;
}; };
...@@ -993,22 +995,11 @@ static int sony_init_ff(struct hid_device *hdev) ...@@ -993,22 +995,11 @@ static int sony_init_ff(struct hid_device *hdev)
return input_ff_create_memless(input_dev, NULL, sony_play_effect); return input_ff_create_memless(input_dev, NULL, sony_play_effect);
} }
static void sony_destroy_ff(struct hid_device *hdev)
{
struct sony_sc *sc = hid_get_drvdata(hdev);
cancel_work_sync(&sc->state_worker);
}
#else #else
static int sony_init_ff(struct hid_device *hdev) static int sony_init_ff(struct hid_device *hdev)
{ {
return 0; return 0;
} }
static void sony_destroy_ff(struct hid_device *hdev)
{
}
#endif #endif
static int sony_set_output_report(struct sony_sc *sc, int req_id, int req_size) static int sony_set_output_report(struct sony_sc *sc, int req_id, int req_size)
...@@ -1077,6 +1068,8 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -1077,6 +1068,8 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
if (sc->quirks & SIXAXIS_CONTROLLER_USB) { if (sc->quirks & SIXAXIS_CONTROLLER_USB) {
hdev->hid_output_raw_report = sixaxis_usb_output_raw_report; hdev->hid_output_raw_report = sixaxis_usb_output_raw_report;
ret = sixaxis_set_operational_usb(hdev); ret = sixaxis_set_operational_usb(hdev);
sc->worker_initialized = 1;
INIT_WORK(&sc->state_worker, sixaxis_state_worker); INIT_WORK(&sc->state_worker, sixaxis_state_worker);
} }
else if (sc->quirks & SIXAXIS_CONTROLLER_BT) else if (sc->quirks & SIXAXIS_CONTROLLER_BT)
...@@ -1087,6 +1080,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -1087,6 +1080,7 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
if (ret < 0) if (ret < 0)
goto err_stop; goto err_stop;
sc->worker_initialized = 1;
INIT_WORK(&sc->state_worker, dualshock4_state_worker); INIT_WORK(&sc->state_worker, dualshock4_state_worker);
} else { } else {
ret = 0; ret = 0;
...@@ -1101,9 +1095,11 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id) ...@@ -1101,9 +1095,11 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
goto err_stop; goto err_stop;
} }
ret = sony_init_ff(hdev); if (sc->quirks & SONY_FF_SUPPORT) {
if (ret < 0) ret = sony_init_ff(hdev);
goto err_stop; if (ret < 0)
goto err_stop;
}
return 0; return 0;
err_stop: err_stop:
...@@ -1120,7 +1116,8 @@ static void sony_remove(struct hid_device *hdev) ...@@ -1120,7 +1116,8 @@ static void sony_remove(struct hid_device *hdev)
if (sc->quirks & SONY_LED_SUPPORT) if (sc->quirks & SONY_LED_SUPPORT)
sony_leds_remove(hdev); sony_leds_remove(hdev);
sony_destroy_ff(hdev); if (sc->worker_initialized)
cancel_work_sync(&sc->state_worker);
hid_hw_stop(hdev); hid_hw_stop(hdev);
} }
......
...@@ -320,13 +320,13 @@ static void drop_ref(struct hidraw *hidraw, int exists_bit) ...@@ -320,13 +320,13 @@ static void drop_ref(struct hidraw *hidraw, int exists_bit)
hid_hw_close(hidraw->hid); hid_hw_close(hidraw->hid);
wake_up_interruptible(&hidraw->wait); wake_up_interruptible(&hidraw->wait);
} }
device_destroy(hidraw_class,
MKDEV(hidraw_major, hidraw->minor));
} else { } else {
--hidraw->open; --hidraw->open;
} }
if (!hidraw->open) { if (!hidraw->open) {
if (!hidraw->exist) { if (!hidraw->exist) {
device_destroy(hidraw_class,
MKDEV(hidraw_major, hidraw->minor));
hidraw_table[hidraw->minor] = NULL; hidraw_table[hidraw->minor] = NULL;
kfree(hidraw); kfree(hidraw);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment