lkml.org 
[lkml]   [2022]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 12/19] hwmon: (mr75203) fix voltage equation for negative source input
On Tue, Aug 30, 2022 at 07:22:05PM +0000, Eliav Farber wrote:
> According to Moortec Embedded Voltage Monitor (MEVM) series 3 data sheet,
> the minimum input signal is -100mv and maximum input signal is +1000mv.
> When n was small enough, such that PVT_N_CONST * n < PVT_R_CONST it
> resulted in n overflowing to a very large number (since n is u32 type).
>
> This change fixes the problem by casting n to long and replacing shift
> right with div operation.

Fixes tag?

...

> n &= SAMPLE_DATA_MSK;
> +

Unrelated change.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2022-08-31 14:05    [W:0.529 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site