Revert "iio: fix scale application in iio_convert_raw_to_processed_unlocked"

This reverts commit 7065933b99.
This commit is contained in:
Ksawlii 2024-11-24 00:23:38 +01:00
parent 47fd099684
commit 08390b1a41

View file

@ -610,17 +610,17 @@ static int iio_convert_raw_to_processed_unlocked(struct iio_channel *chan,
break; break;
case IIO_VAL_INT_PLUS_MICRO: case IIO_VAL_INT_PLUS_MICRO:
if (scale_val2 < 0) if (scale_val2 < 0)
*processed = -raw64 * scale_val * scale; *processed = -raw64 * scale_val;
else else
*processed = raw64 * scale_val * scale; *processed = raw64 * scale_val;
*processed += div_s64(raw64 * (s64)scale_val2 * scale, *processed += div_s64(raw64 * (s64)scale_val2 * scale,
1000000LL); 1000000LL);
break; break;
case IIO_VAL_INT_PLUS_NANO: case IIO_VAL_INT_PLUS_NANO:
if (scale_val2 < 0) if (scale_val2 < 0)
*processed = -raw64 * scale_val * scale; *processed = -raw64 * scale_val;
else else
*processed = raw64 * scale_val * scale; *processed = raw64 * scale_val;
*processed += div_s64(raw64 * (s64)scale_val2 * scale, *processed += div_s64(raw64 * (s64)scale_val2 * scale,
1000000000LL); 1000000000LL);
break; break;