forked from analogdevicesinc/linux
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HID: wiimote: add pro-controller analog stick calibration
The analog sticks of the pro-controller might report slightly off values. To guarantee a uniform setup, we now calibrate analog-stick values during pro-controller setup. Unfortunately, the pro-controller fails during normal EEPROM reads and I couldn't figure out whether there are any calibration values stored on the device. Therefore, we now use the first values reported by the device (iff they are not _way_ off, which would indicate movement) to initialize the calibration values. To allow users to change this calibration data, we provide a pro_calib sysfs attribute. We also change the "flat" values so user-space correctly smoothes our data. It makes slightly off zero-positions less visible while still guaranteeing highly precise movement reports. Note that the pro controller reports zero-positions in a quite huge range (at least: -100 to +100). Reported-by: Rafael Brune <[email protected]> Tested-by: Rafael Brune <[email protected]> Signed-off-by: David Herrmann <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
- Loading branch information
David Herrmann
authored and
Jiri Kosina
committed
Oct 30, 2013
1 parent
0abda6f
commit 08072dd
Showing
3 changed files
with
128 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,21 @@ Description: This attribute is only provided if the device was detected as a | |
Calibration data is already applied by the kernel to all input | ||
values but may be used by user-space to perform other | ||
transformations. | ||
|
||
What: /sys/bus/hid/drivers/wiimote/<dev>/pro_calib | ||
Date: October 2013 | ||
KernelVersion: 3.13 | ||
Contact: David Herrmann <[email protected]> | ||
Description: This attribute is only provided if the device was detected as a | ||
pro-controller. It provides a single line with 4 calibration | ||
values for all 4 analog sticks. Format is: "x1:y1 x2:y2". Data | ||
is prefixed with a +/-. Each value is a signed 16bit number. | ||
Data is encoded as decimal numbers and specifies the offsets of | ||
the analog sticks of the pro-controller. | ||
Calibration data is already applied by the kernel to all input | ||
values but may be used by user-space to perform other | ||
transformations. | ||
Calibration data is detected by the kernel during device setup. | ||
You can write "scan\n" into this file to re-trigger calibration. | ||
You can also write data directly in the form "x1:y1 x2:y2" to | ||
set the calibration values manually. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters