Advertisement
Guest User

hid/sony: add autorepeat for PS3 remotes: 3.16.1

a guest
Sep 5th, 2014
423
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.30 KB | None | 0 0
  1.  drivers/hid/hid-sony.c |   20 ++++++++++++++++++++
  2.  1 files changed, 20 insertions(+), 0 deletions(-)
  3.  
  4. diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
  5. --- a/drivers/hid/hid-sony.c
  6. +++ b/drivers/hid/hid-sony.c
  7. @@ -819,6 +819,24 @@ static int ps3remote_mapping(struct hid_
  8.     return 1;
  9.  }
  10.  
  11. +static int ps3remote_setup_repeat(struct hid_device *hdev)
  12. +{
  13. +   struct hid_input *hidinput = list_first_entry(&hdev->inputs,
  14. +                        struct hid_input, list);
  15. +   struct input_dev *input = hidinput->input;
  16. +
  17. +   /*
  18. +    * Set up autorepeat defaults per the remote control subsystem;
  19. +    * this must be done after hid_hw_start(), as having these non-zero
  20. +    * at the time of input_register_device() tells the input system that
  21. +    * the hardware does the autorepeat, and the PS3 remote does not.
  22. +   */
  23. +   set_bit(EV_REP, input->evbit);
  24. +   input->rep[REP_DELAY]  = 500;
  25. +   input->rep[REP_PERIOD] = 125;
  26. +
  27. +   return 0;
  28. +}
  29.  
  30.  /* Sony Vaio VGX has wrongly mouse pointer declared as constant */
  31.  static __u8 *sony_report_fixup(struct hid_device *hdev, __u8 *rdesc,
  32. @@ -1892,6 +1910,8 @@ static int sony_probe(struct hid_device
  33.             goto err_stop;
  34.  
  35.         sony_init_work(sc, dualshock4_state_worker);
  36. +   } else if (sc->quirks & PS3REMOTE) {
  37. +       ret = ps3remote_setup_repeat(hdev);
  38.     } else {
  39.         ret = 0;
  40.     }
  41. --
  42. 1.7.2.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement