lkml.org 
[lkml]   [2021]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Input: ff-core - Correct magnitude setting for rumble compatibility
On Tue, Nov 30, 2021 at 01:50:39PM +0000, Charles Keepax wrote:
> When converting a rumble into a periodic effect, for compatibility,
> the magnitude is effectively calculated using:
>
> magnitude = max(strong_rubble / 3 + weak_rubble / 6, 0x7fff);
>
> The rumble magnitudes are both u16 and the resulting magnitude is
> s16. The max is presumably an attempt to limit the result of the
> calculation to the maximum possible magnitude for the s16 result,
> and thus should be a min.
>
> However in the case of strong = weak = 0xffff, the result of the first
> part of the calculation is 0x7fff, meaning that the min would be
> redundant anyway, so simply remove the current max.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>

Applied, thank you.

--
Dmitry

\
 
 \ /
  Last update: 2021-12-07 08:24    [W:0.044 / U:1.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site