hwmon: emc2305: fixups for driver submitted to mailing lists
authorPhil Elwell <phil@raspberrypi.com>
Thu, 5 May 2022 14:46:07 +0000 (15:46 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:21 +0000 (11:33 +0000)
commit00bd2d6b0eb9302409f33229c90efd166ad4d543
tree8cea312c52e00c6d8188a862a96bb6831be9620c
parent891cd857694dd363db03f22351bfe2bbe3ac1e5a
hwmon: emc2305: fixups for driver submitted to mailing lists

The driver had a number of issues, checkpatch warnings/errors,
and other limitations, so fix these up to make it usable.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
hwmon: emc2305: Add calls to initialise of cooling maps

Commit 46ef9d4ed26b ("hwmon: emc2305: fixups for driver submitted to
mailing lists") missed adding the call to thermal_of_cooling_device_register
required to configure any cooling maps for the device, hence stopping it
from actually ever changing speed.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
hwmon: emc2305: Change OF properties pwm-min & pwm-max to u8

There is no DT binding for emc2305 as mainline are still
discussing how to do a generic fan binding.
The 5.15 driver was reading the "emc2305," properties
"cooling-levels", "pwm-max", "pwm-min", and "pwm-channel" as u8.
The overlay was writing them as u16 (;) so it was working.

The 6.1 driver was reading as u32, which failed as there is
insufficient data.

As this is all downstream only, revert to u8 to match 5.15.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drivers/hwmon/emc2305.c