Commit 1f05f65
hwmon: (tps23861) fix byte order in resistance register
The tps23861 registers are little-endian, and regmap_read_bulk() does
not do byte order conversion. On BE machines, the bytes were swapped,
and the interpretation of the resistance value was incorrect.
To make it work on both big and little-endian machines, use
le16_to_cpu() to convert the resitance register to host byte order.
Signed-off-by: Alexandru Gagniuc <[email protected]>
Fixes: fff7b8a ("hwmon: add Texas Instruments TPS23861 driver")
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Guenter Roeck <[email protected]>1 parent 7e18e42 commit 1f05f65
1 file changed
+6
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
496 | | - | |
| 496 | + | |
| 497 | + | |
497 | 498 | | |
498 | 499 | | |
499 | 500 | | |
500 | 501 | | |
501 | 502 | | |
502 | 503 | | |
503 | | - | |
| 504 | + | |
| 505 | + | |
504 | 506 | | |
505 | | - | |
| 507 | + | |
506 | 508 | | |
507 | | - | |
| 509 | + | |
508 | 510 | | |
509 | 511 | | |
510 | 512 | | |
| |||
0 commit comments