Skip to content

EMC2301 driver - #5026

Merged
pelwell merged 8 commits into
raspberrypi:rpi-5.15.yfrom
6by9:rpi-5.15.y-emc2301
May 10, 2022
Merged

pelwell merged 8 commits into
raspberrypi:rpi-5.15.yfrom
6by9:rpi-5.15.y-emc2301

Conversation

@6by9

@6by9 6by9 commented May 9, 2022

Copy link
Copy Markdown
Contributor

Largely a driver from mainline (not accepted), but with various tweaks by Phil and myself.

For CM4IO it needs dtoverlay=i2c-fan,emc2301,i2c_csi_dsi or similar. Can we make an easier line of either dtoverlay=cm4io-fan, or dtoverlay=i2c-fan,cm4io?

I haven't squashed the changes together so Phil can see where I've deviated from his code, but can do before we merge.

It is quite common for the devm_thermal_zone_of_sensor_register
to need to defer, so avoid spamming the log by using
dev_err_probe instead of dev_err.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
addr = <&emc2301>,"reg:0";
minrpm = <&emc2301>,"min-rpm;0";
maxrpm = <&emc2301>,"max-rpm;0";
minrpm = <&emc2301>,"emc2305,pwm-min;0";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation uses minpwm and maxpwm, which make more sense. But it highlights that the PWM setting is device-specific in a way that an RPM setting wouldn't be (provided the driver supports RPMs). Perhaps this would be better as a dedicated CM4 fan overlay? I don't know.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation uses minpwm and maxpwm, which make more sense

Yes replaced the docs but not the override name.

This is the downside of the emc2305 driver over the emc2301 one - PWM setting vs RPM.

Then again the RPM range is variable between any two fans. At least default PWM settings should guarantee the fan spins (the controller does give a boost if it thinks it is stalled), whereas the default speed settings won't. (eg my fan here has a range of 200 to 1800 rpm, so the defaults you had used of 3500 and 5500 rpm aren't applicable)

Comment thread drivers/hwmon/emc2305.c Resolved
mshych and others added 3 commits May 10, 2022 14:09
Submitted to linux-hwmon mailing list at
https://patchwork.kernel.org/project/linux-hwmon/patch/20220430114905.53448-3-michaelsh@nvidia.com/

Add basic description of emc2305 driver device tree binding.

Signed-off-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
The bindings submitted to mainline had some issues, so fix them up.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
…d Controller.

Submitted to linux-hwmon mailing list at
https://patchwork.kernel.org/project/linux-hwmon/patch/20220430114905.53448-2-michaelsh@nvidia.com/

Add driver for Microchip EMC2301/2/3/5 RPM-based PWM Fan Speed Controller.
Modify Makefile and Kconfig to support Microchip EMC2305 RPM-based
PWM Fan Speed Controller.

Signed-off-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
@6by9
6by9 force-pushed the rpi-5.15.y-emc2301 branch from f464aa0 to fed537b Compare May 10, 2022 13:24
@6by9

6by9 commented May 10, 2022

Copy link
Copy Markdown
Contributor Author

Edits made, our patches squashed, and updated the PR.

Comment thread drivers/hwmon/emc2305.c Resolved
pelwell and others added 4 commits May 10, 2022 14:59
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>
Submitted to linux-hwmon mailing list at
https://patchwork.kernel.org/project/linux-hwmon/patch/20220430114905.53448-4-michaelsh@nvidia.com/

Add description of emc2305 driver.

Signed-off-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add an i2c-fan overlay, initially with support for the EMC2301
fan controller found on the CM4IO board.
Based on the overlay from Traverse Technologies, but modified for
the EMC2305 driver submitted to linux-hwmon.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
@6by9
6by9 force-pushed the rpi-5.15.y-emc2301 branch from fed537b to 2112204 Compare May 10, 2022 13:59
@pelwell
pelwell merged commit 2cca267 into raspberrypi:rpi-5.15.y May 10, 2022
@pelwell

pelwell commented May 10, 2022

Copy link
Copy Markdown
Contributor

Thanks!

popcornmix added a commit to raspberrypi/firmware that referenced this pull request May 12, 2022
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants