diff options
| author | 2022-07-20 22:22:55 -0500 | |
|---|---|---|
| committer | 2022-07-21 07:18:39 -0700 | |
| commit | 0eabb1396656f215a5333a9444158b17b0fd3247 (patch) | |
| tree | d8051f245aaed268c87f7651b2cdb5041a5384b9 /tools/scripts/ssh:/git@git.zx2c4.com/git: | |
| parent | hwmon: (aspeed-pwm-tacho) increase fan tach period (again) (diff) | |
| download | linux-dev-0eabb1396656f215a5333a9444158b17b0fd3247.tar.xz linux-dev-0eabb1396656f215a5333a9444158b17b0fd3247.zip | |
hwmon: (tps23861) fix byte order in current and voltage registers
Trying to use this driver on a big-endian machine results in garbage
values for voltage and current. The tps23861 registers are little-
endian, and regmap_read_bulk() does not do byte order conversion. Thus
on BE machines, the most significant bytes got modified, and were
trimmed by the VOLTAGE_CURRENT_MASK.
To resolve this use uint16_t values, and convert them to host byte
order using le16_to_cpu(). This results in correct readings on MIPS.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Link: https://lore.kernel.org/r/20220721032255.2850647-1-mr.nuke.me@gmail.com
[groeck: Use __le16 instead of uint16_t]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'tools/scripts/ssh:/git@git.zx2c4.com/git:')
0 files changed, 0 insertions, 0 deletions
