Merge branch 'main' into vrs
This commit is contained in:
@@ -73,9 +73,9 @@ static int universal_pidff_probe(struct hid_device *hdev,
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = hid_pidff_init_with_quirks(hdev, id);
|
ret = hid_pidff_init_quirks(hdev, id);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
hid_warn(hdev, "Force feedback not supported\n");
|
hid_warn(hdev, "Force feedback is not supported\n");
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
32
hid-pidff.c
32
hid-pidff.c
@@ -1352,9 +1352,9 @@ static int pidff_check_autocenter(struct pidff_device *pidff,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check if the device is PID and initialize it
|
* Check if the device is PID and initialize it, with quirks
|
||||||
*/
|
*/
|
||||||
int hid_pidff_init(struct hid_device *hid)
|
int hid_pidff_init_quirks(struct hid_device *hid, const struct hid_device_id *id)
|
||||||
{
|
{
|
||||||
struct pidff_device *pidff;
|
struct pidff_device *pidff;
|
||||||
struct hid_input *hidinput = list_entry(hid->inputs.next,
|
struct hid_input *hidinput = list_entry(hid->inputs.next,
|
||||||
@@ -1376,6 +1376,8 @@ int hid_pidff_init(struct hid_device *hid)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
pidff->hid = hid;
|
pidff->hid = hid;
|
||||||
|
pidff->quirks |= id->driver_data;
|
||||||
|
hid_dbg(dev, "Device quirks: %d\n", pidff->quirks);
|
||||||
|
|
||||||
hid_device_io_start(hid);
|
hid_device_io_start(hid);
|
||||||
|
|
||||||
@@ -1453,29 +1455,3 @@ int hid_pidff_init(struct hid_device *hid)
|
|||||||
kfree(pidff);
|
kfree(pidff);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Check if the device is PID and initialize it
|
|
||||||
* Add quirks after initialisation
|
|
||||||
*/
|
|
||||||
int hid_pidff_init_with_quirks(struct hid_device *hid, const struct hid_device_id *id)
|
|
||||||
{
|
|
||||||
int error = hid_pidff_init(hid);
|
|
||||||
|
|
||||||
if (error)
|
|
||||||
return error;
|
|
||||||
|
|
||||||
struct hid_input *hidinput = list_entry(hid->inputs.next,
|
|
||||||
struct hid_input, list);
|
|
||||||
struct input_dev *dev = hidinput->input;
|
|
||||||
struct pidff_device *pidff = dev->ff->private;
|
|
||||||
|
|
||||||
/* set quirks on the pidff device */
|
|
||||||
hid_device_io_start(hid);
|
|
||||||
pidff->quirks |= id->driver_data;
|
|
||||||
hid_device_io_stop(hid);
|
|
||||||
|
|
||||||
hid_dbg(dev, "Device quirks: %d\n", pidff->quirks);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
*/
|
*/
|
||||||
#define PIDFF_QUIRK_NO_STRICT_PID_CONTROL BIT(4)
|
#define PIDFF_QUIRK_NO_STRICT_PID_CONTROL BIT(4)
|
||||||
|
|
||||||
int hid_pidff_init(struct hid_device *hid);
|
int hid_pidff_init_quirks(struct hid_device *hid, const struct hid_device_id *id);
|
||||||
int hid_pidff_init_with_quirks(struct hid_device *hid, const struct hid_device_id *id);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user