summaryrefslogtreecommitdiff
path: root/drivers/input/matrix-keymap.c
diff options
context:
space:
mode:
authorLuca Weiss <luca@z3ntu.xyz>2023-05-02 03:02:56 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2023-05-02 03:07:12 +0300
commitd09dbc7a018c4d479d7ab0d3b4f6a3211b110923 (patch)
treed7be4a92554f7f6fa5a4e3d168cba17118d48ed6 /drivers/input/matrix-keymap.c
parent980626ec1ca82a10dc04026a79dcbade23cc3438 (diff)
downloadlinux-d09dbc7a018c4d479d7ab0d3b4f6a3211b110923.tar.xz
Input: drv260x - fix magnitude handling
First of all, previously the 16-bit magnitude was written as-is to the device which actually discarded the upper 8 bits since the device has 8-bit registers only. This meant that a strong_magnitude of 0xFF00 would result in 0. To correct this shift the strong_magnitude / weak_magnitude input values so we discard the lower 8 bits and keep the upper bits instead. Secondly the RTP mode that is used by default interprets the values as signed (2s complement), so 0x81 = 0%, 0x00 = 50%, 0x7F = 100%. This doesn't match the FF_RUMBLE interface at all, so let's tell the device to interpret the data as unsigned instead which gets us 0x00 = 0% and 0xFF = 100%. As last change switch ERM to using "Closed-Loop Mode, Unidirectional" instead of "Open-Loop Mode" since it's recommended by the datasheet compared to open loop and better matches our use case of 0% - 100% vibration. Signed-off-by: Luca Weiss <luca@z3ntu.xyz> Link: https://lore.kernel.org/r/20230430-drv260x-improvements-v1-4-1fb28b4cc698@z3ntu.xyz Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/matrix-keymap.c')
0 files changed, 0 insertions, 0 deletions