Skip to content

Commit 287d998

Browse files
amiclausjic23
authored andcommitted
iio: admv1013: add mixer_vgate corner cases
Include the corner cases in the computation of the MIXER_VGATE register value. According to the datasheet: The MIXER_VGATE values follows the VCM such as, that for a 0V to 1.8V VCM, MIXER_VGATE = 23.89 VCM + 81, and for a > 1.8V to 2.6V VCM, MIXER_VGATE = 23.75 VCM + 1.25. Fixes: da35a7b ("iio: frequency: admv1013: add support for ADMV1013") Signed-off-by: Antoniu Miclaus <[email protected]> Reviewed-by: Nuno Sa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 85dfb43 commit 287d998

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/iio/frequency/admv1013.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,9 @@ static int admv1013_update_mixer_vgate(struct admv1013_state *st)
351351
if (vcm < 0)
352352
return vcm;
353353

354-
if (vcm < 1800000)
354+
if (vcm <= 1800000)
355355
mixer_vgate = (2389 * vcm / 1000000 + 8100) / 100;
356-
else if (vcm > 1800000 && vcm < 2600000)
356+
else if (vcm > 1800000 && vcm <= 2600000)
357357
mixer_vgate = (2375 * vcm / 1000000 + 125) / 100;
358358
else
359359
return -EINVAL;

0 commit comments

Comments
 (0)