Commit bee4483
iio: afe: rescale: Accept only offset channels
As noted by Jonathan Cameron: it is perfectly legal for a channel
to have an offset but no scale in addition to the raw interface.
The conversion will imply that scale is 1:1.
Make rescale_configure_channel() accept just scale, or just offset
to process a channel.
When a user asks for IIO_CHAN_INFO_OFFSET in rescale_read_raw()
we now have to deal with the fact that OFFSET could be present
but SCALE missing. Add code to simply scale 1:1 in this case.
Link: https://lore.kernel.org/linux-iio/CACRpkdZXBjHU4t-GVOCFxRO-AHGxKnxMeHD2s4Y4PuC29gBq6g@mail.gmail.com/
Fixes: 53ebee9 ("iio: afe: iio-rescale: Support processed channels")
Fixes: 9decacd ("iio: afe: rescale: Fix boolean logic bug")
Reported-by: Jonathan Cameron <[email protected]>
Signed-off-by: Linus Walleij <[email protected]>
Reviewed-by: Peter Rosin <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Cc: <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>1 parent 865b080 commit bee4483
1 file changed
+15
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
219 | 229 | | |
220 | 230 | | |
221 | 231 | | |
| |||
280 | 290 | | |
281 | 291 | | |
282 | 292 | | |
283 | | - | |
284 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
285 | 296 | | |
286 | 297 | | |
287 | 298 | | |
| |||
0 commit comments