1. 19 12月, 2016 3 次提交
  2. 29 11月, 2016 1 次提交
  3. 28 11月, 2016 3 次提交
    • R
      HID: sony: Comply to Linux gamepad spec for DS4 · 9131f8cc
      Roderick Colenbrander 提交于
      The DS4 side of hid-sony used the hid-core layer to assign buttons
      and axes based on the HID report descriptors. The default mapping
      was strange e.g. right stick using ABS_Z/ABS_RZ or the physical
      'south button' being reported as BTN_EAST etcetera.
      
      This patch makes the DS4 side ofi the hid-sony driver comply to
      the Linux game controller spec as suggested in a discussion with
      Dmitry on the linux-input list.
      
      Currently the main user of the DS4 is the SDL2 library, which has
      a mapping table using vendor/device/version as a key. In order to
      not break SDL2 we discussed adjusting the version number, so it
      can have both mappings. This was discust on linux-input and we
      discussed privately with SDL2 developers.
      Signed-off-by: NRoderick Colenbrander <roderick.colenbrander@sony.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      9131f8cc
    • R
      HID: sony: Make the DS4 touchpad a separate device · ac797b95
      Roderick Colenbrander 提交于
      The dualshock 4 supports both analog sticks of which one uses
      ABS_X/_Y and a touchpad. In a recent discussion with Dmitry about
      some input-mt changes we proposed for disabling pointer emulation from
      input_mt_sync_frame, Dmitry mentioned ABS_X/_Y should report the
      same data as ABS_MT_POSITION_X/_Y. The current driver is mixing axes
      for different subdevices. It was suggested to make the touchpad
      its own sub-device.
      
      This patch turns the touchpad into its own device. In addition
      this patch also moves the button underneath the touchpad into
      the new device. It felt like this button should be part of the
      device. No known user space application (not even SDL2) seems to
      be using it.
      Signed-off-by: NRoderick Colenbrander <roderick.colenbrander@sony.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      ac797b95
    • R
      HID: sony: Fix memory issue when connecting device using both Bluetooth and USB · 4f967f6d
      Roderick Colenbrander 提交于
      A previous patch moved most input initialization from sony_probe to
      sony_input_configured to avoid some race conditions. The driver has some
      special logic to prevent the device to get registered twice in case the
      user connects it both over Bluetooth and USB. When this condition
      happens sony_input_configured returns a failure, but sony_probe continues
      as hid_hw_start doesn't fail. As was discussed on linux-input, it is
      acceptable for this function to fail.
      
      This patch adds a check for the HID_CLAIMED_INPUT flag within sony_probe
      to determine whether initialization succeeded correctly. The flag is
      not set by the HID layer when sony_input_configured fails.
      Signed-off-by: NRoderick Colenbrander <roderick.colenbrander@sony.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      4f967f6d
  4. 10 10月, 2016 7 次提交
  5. 26 9月, 2016 3 次提交
    • F
      HID: sony: Update copyright and add Dualshock 4 rate control note · c4425c8f
      Frank Praznik 提交于
      Update the copyright notice with the current year and add a note
      about values for controlling the Dualshock 4 reporting rate.
      
      Processing reports at the default full rate of 1000hz can be too
      demanding for some low-power embedded processors so noting
      alternate values for people working with this hardware can be useful.
      
      Thanks to Rostislav Pehlivanov for finding these values.
      Signed-off-by: NFrank Praznik <frank.praznik@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      c4425c8f
    • F
      HID: sony: Defer the initial USB Sixaxis output report · 2a242932
      Frank Praznik 提交于
      When initially connected via USB the Sixaxis isn't fully initialized
      until the PS logo button is pressed and won't send any input reports
      nor will any state set by output reports be retained.
      
      This adds a 'defer_initialization' flag to the sony_sc struct which,
      when set, will delay sending any output reports until the first input
      report has arrived. This flag is used with the USB Sixaxis to ensure
      that any state sent will persist since, until the PS button is pushed,
      any changes sent to the controller via an output report will be lost
      after a couple of seconds.
      
      The initial state of the controller is still configured at the time
      of the initial connection and won't be internally modified after that,
      so any state set by the user between that time and the recepit of the
      first input report won't be lost.
      Signed-off-by: NFrank Praznik <frank.praznik@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      2a242932
    • F
      HID: sony: Relax duplicate checking for USB-only devices · 0f398230
      Frank Praznik 提交于
      Some USB-only devices which masquerade as Sixaxis controllers report the
      same generic Bluetooth address for all hardware when queried via the HID
      report. This causes these devices to be wrongly rejected as duplicates
      when more than one is connected at once.
      
      This introduces a connection type comparison when checking for duplicates
      and only rejects the newly connected device if the existing matching
      device is connected using a different connection protocol.
      
      The results of the connection type comparison are also used when
      registering power supply info as the device Bluetooth address is used
      as the unique identifier string.  In cases where more than one valid
      device has the same Bluetooth address the device ID is now appended
      to the power supply name string to avoid name collisions when
      registering the power supply information.
      Signed-off-by: NFrank Praznik <frank.praznik@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      0f398230
  6. 02 8月, 2016 1 次提交
  7. 10 2月, 2016 3 次提交
    • P
      HID: sony: underscores are unnecessary for u8, u16, s32 · 1adf904e
      Pavel Machek 提交于
      Double-underscore prefixed types are unnecessary in pure kernel code,
      replace them with the non prefixed equivalents.
      Signed-off-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NAntonio Ospite <ao2@ao2.it>
      Acked-by: NFrank Praznik <frank.praznik@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      1adf904e
    • A
      HID: sony: fix some warnings from scripts/checkpatch.pl · ef916ef5
      Antonio Ospite 提交于
        WARNING: Block comments use a trailing */ on a separate line
        #822: FILE: drivers/hid/hid-sony.c:822:
        +	   * number but it's not needed for correct operation */
      
        WARNING: Block comments use a trailing */ on a separate line
        #828: FILE: drivers/hid/hid-sony.c:828:
        +	   * buttons multiple keypresses are allowed */
      
        WARNING: Block comments use a trailing */ on a separate line
        #854: FILE: drivers/hid/hid-sony.c:854:
        +	   * 0xff and 11th is for press indication */
      
        WARNING: Missing a blank line after declarations
        #1930: FILE: drivers/hid/hid-sony.c:1930:
        +	struct sony_sc *sc = container_of(work, struct sony_sc, state_worker);
        +	sc->send_output_report(sc);
      
        WARNING: Block comments use a trailing */ on a separate line
        #2510: FILE: drivers/hid/hid-sony.c:2510:
        +	 * Logitech joystick from the device descriptor. */
      Signed-off-by: NAntonio Ospite <ao2@ao2.it>
      Acked-by: NFrank Praznik <frank.praznik@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      ef916ef5
    • A
      HID: sony: fix errors from scripts/checkpatch.pl · 09593e38
      Antonio Ospite 提交于
        ./scripts/checkpatch.pl \
          --types "SPACING,TRAILING_WHITESPACE,POINTER_LOCATION,CODE_INDENT" \
          -f drivers/hid/hid-sony.c
      
        ERROR: trailing whitespace
        #933: FILE: drivers/hid/hid-sony.c:933:
        +^I * $
      
        ERROR: space prohibited after that open square bracket '['
        #947: FILE: drivers/hid/hid-sony.c:947:
        +	[ 1] = BTN_TRIGGER_HAPPY1,
      
        ERROR: space prohibited after that open square bracket '['
        #948: FILE: drivers/hid/hid-sony.c:948:
        +	[ 2] = BTN_TRIGGER_HAPPY2,
      
        ERROR: space prohibited after that open square bracket '['
        #949: FILE: drivers/hid/hid-sony.c:949:
        +	[ 3] = BTN_TRIGGER_HAPPY3,
      
        ERROR: space prohibited after that open square bracket '['
        #950: FILE: drivers/hid/hid-sony.c:950:
        +	[ 4] = BTN_TRIGGER_HAPPY4,
      
        ERROR: space prohibited after that open square bracket '['
        #951: FILE: drivers/hid/hid-sony.c:951:
        +	[ 5] = BTN_TRIGGER_HAPPY5,
      
        ERROR: space prohibited after that open square bracket '['
        #952: FILE: drivers/hid/hid-sony.c:952:
        +	[ 6] = BTN_TRIGGER_HAPPY6,
      
        ERROR: space prohibited after that open square bracket '['
        #953: FILE: drivers/hid/hid-sony.c:953:
        +	[ 7] = BTN_TRIGGER_HAPPY7,
      
        ERROR: space prohibited after that open square bracket '['
        #954: FILE: drivers/hid/hid-sony.c:954:
        +	[ 8] = BTN_TRIGGER_HAPPY8,
      
        ERROR: space prohibited after that open square bracket '['
        #955: FILE: drivers/hid/hid-sony.c:955:
        +	[ 9] = BTN_TRIGGER_HAPPY9,
      
        ERROR: "(foo*)" should be "(foo *)"
        #1032: FILE: drivers/hid/hid-sony.c:1032:
        +	void(*send_output_report)(struct sony_sc*);
      
        WARNING: missing space after return type
        #1032: FILE: drivers/hid/hid-sony.c:1032:
        +	void(*send_output_report)(struct sony_sc*);
      
        ERROR: "(foo*)" should be "(foo *)"
        #2261: FILE: drivers/hid/hid-sony.c:2261:
        +				void(*send_output_report)(struct sony_sc*))
      
        WARNING: missing space after return type
        #2261: FILE: drivers/hid/hid-sony.c:2261:
        +				void(*send_output_report)(struct sony_sc*))
      
        ERROR: code indent should use tabs where possible
        #2449: FILE: drivers/hid/hid-sony.c:2449:
        +         */$
      
        total: 13 errors, 2 warnings, 2570 lines checked
      Signed-off-by: NAntonio Ospite <ao2@ao2.it>
      Acked-by: NFrank Praznik <frank.praznik@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      09593e38
  8. 30 1月, 2016 1 次提交
  9. 19 1月, 2016 3 次提交
  10. 28 12月, 2015 1 次提交
  11. 19 11月, 2015 3 次提交
    • F
      HID: sony: Remove the size check for the Dualshock 4 HID Descriptor · b71b5578
      Frank Praznik 提交于
      Sony has modified the HID descriptor in new revisions of the Dualshock 4 which
      causes the size check in the descriptor replacement function to fail.  Remove it
      so that new revisions of the controller will work correctly.
      
      The module is completely replacing the descriptor instead of patching it, so the
      size check isn't really necessary anyways.
      Signed-off-by: NFrank Praznik <frank.praznik@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      b71b5578
    • F
      HID: sony: Save and restore the controller state on suspend and resume · decd946c
      Frank Praznik 提交于
      On hardware which provides standby power for charging devices the state of the
      LEDs and force-feedback on controllers can persist even when the system is in
      standby.  Additionally, the state of the controllers on resume may be different
      from the state they were in at the time when they were suspended (ie. LEDs are
      cleared on resume).
      
      This implements the suspend and resume callbacks which saves and clears the
      state of the LEDs on suspend and restores them on resume.  Force-feedback is
      stopped on suspend but not automatically restored on resume until a new event is
      received to avoid potentially damaging hardware.
      
      USB Sixaxis and navigation controllers must be reinitialized when the hardware
      is reset on resume or they won't send any input reports.
      Signed-off-by: NFrank Praznik <frank.praznik@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      decd946c
    • F
      HID: sony: Refactor the output report sending functions · d8aaccda
      Frank Praznik 提交于
      Refactor the output report sending functions to allow for the sending of output
      reports without enqueuing a work item.  Output reports for any device can now be
      sent via the send_output_report function pointer in the sony_sc struct which
      points to the appropriate output function.  The individual state worker
      functions have been replaced with a universal sony_state_worker function which
      uses this function pointer.
      Signed-off-by: NFrank Praznik <frank.praznik@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      d8aaccda
  12. 06 11月, 2015 1 次提交
  13. 30 9月, 2015 1 次提交
  14. 31 7月, 2015 1 次提交
    • R
      HID: sony: Fix DS4 controller reporting rate issues · 824deff8
      Rostislav Pehlivanov 提交于
      This commit removes the cap on the DualShock 4 controller reporting rate when
      connected using Bluetooth. The previous value of '0xB0' capped the rate to only
      20.83 Hz which many userspace utilities mistook as a sign of a bad signal.
      Since a 'B' and an '8' can look similar it's possible that someone mistook the
      one for another.  The new value of '0x80' enables the full 1000 Hz peak
      reporting rate that the controller is capable of.
      
      Frank adds: "Back when the original code was written the purpose of that value
      was unknown and 0xB0 seemed to work so that's what ended up being used.  Now
      that we know what it actually does and that 0x80 is a better choice I support
      this patch."
      
      [jkosina@suse.com: update changelog]
      Signed-off-by: NRostislav Pehlivanov <atomnuker@gmail.com>
      Acked-by: NFrank Praznik <frank.praznik@gmail.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.com>
      824deff8
  15. 24 7月, 2015 1 次提交
  16. 13 7月, 2015 1 次提交
  17. 18 6月, 2015 3 次提交
  18. 12 6月, 2015 3 次提交