Skip to content

Commit 48b30e1

Browse files
committed
Merge tag 'iio-fixes-for-5.3b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes: Second set of IIO fix for the 5.3 cycle. * adf4371 - Calculation of the value to program to control the output frequency was incorrect. * max9611 - Fix temperature reading in probe. A recent fix for a wrong mask meant this code was looked at afresh. A second bug became obvious in which the return value was used inplace of the desired register value. This had no visible effect other than a communication test not actually testing the communications. * tag 'iio-fixes-for-5.3b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: iio: adc: max9611: Fix temperature reading in probe iio: frequency: adf4371: Fix output frequency setting
2 parents 8e2a589 + b9ddd50 commit 48b30e1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/iio/adc/max9611.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ static int max9611_init(struct max9611_dev *max9611)
480480
if (ret)
481481
return ret;
482482

483-
regval = ret & MAX9611_TEMP_MASK;
483+
regval &= MAX9611_TEMP_MASK;
484484

485485
if ((regval > MAX9611_TEMP_MAX_POS &&
486486
regval < MAX9611_TEMP_MIN_NEG) ||

drivers/iio/frequency/adf4371.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,11 @@ static int adf4371_set_freq(struct adf4371_state *st, unsigned long long freq,
276276
st->buf[0] = st->integer >> 8;
277277
st->buf[1] = 0x40; /* REG12 default */
278278
st->buf[2] = 0x00;
279-
st->buf[3] = st->fract2 & 0xFF;
280-
st->buf[4] = st->fract2 >> 7;
281-
st->buf[5] = st->fract2 >> 15;
279+
st->buf[3] = st->fract1 & 0xFF;
280+
st->buf[4] = st->fract1 >> 8;
281+
st->buf[5] = st->fract1 >> 16;
282282
st->buf[6] = ADF4371_FRAC2WORD_L(st->fract2 & 0x7F) |
283-
ADF4371_FRAC1WORD(st->fract1 >> 23);
283+
ADF4371_FRAC1WORD(st->fract1 >> 24);
284284
st->buf[7] = ADF4371_FRAC2WORD_H(st->fract2 >> 7);
285285
st->buf[8] = st->mod2 & 0xFF;
286286
st->buf[9] = ADF4371_MOD2WORD(st->mod2 >> 8);

0 commit comments

Comments
 (0)