Skip to content

Add definition and driver for optional EMC2301 fan controller#125

Merged
svenrademakers merged 2 commits intoturing-machines:masterfrom
CFSworks:emc2301-driver
Oct 16, 2023
Merged

Add definition and driver for optional EMC2301 fan controller#125
svenrademakers merged 2 commits intoturing-machines:masterfrom
CFSworks:emc2301-driver

Conversation

@CFSworks
Copy link
Copy Markdown
Contributor

The original design of the TP2 board includes a 4-pin fan header and EMC2301 fan controller. (These are J16 and U109 on the PCB, respectively.) They aren't populated at the factory, but some users may nonetheless want to order and solder these parts themselves, so it makes sense to have out-of-the-box support for it in the firmware, at least.

For boards with the EMC2301 soldered, a /sys/class/thermal/cooling_device0 and /sys/class/hwmon/hwmon1 entry appear in sysfs to manage the fan speed. For boards without, the driver (silently) fails to bind, and the BMC operates as usual. So, this makes the EMC2301 pretty much "plug-and-play" -- or, "solder-and-play" at least. :)


This PR may be controversial not on software/technical grounds but on logistical ones: I do not know why these parts weren't populated at the factory, but if there was a solid business reason for it, accepting this PR might be incongruous with that reason.

My speculation is that there was uncertainty about whether a pure SMBus/I²C device like the EMC2301 could coexist on the bus with the RTL8370CG, since the latter uses a weird variant of I²C, or perhaps whether the RTL8370CG driver might "hog" the lines, rendering the EMC2301 inaccessible. I can at least confirm that this isn't the case; I quickly put together a Rust tool that can read/write RTL8370CG registers through the ordinary I²C interface, and I can interleave RTL8370CG operations and EMC2301 operations on the same bus with no problem.

But, that's just speculation. Again: I don't know the reason the components aren't populated. I'd recommend not accepting this PR before finding out.

@svenrademakers
Copy link
Copy Markdown
Collaborator

This PR may be controversial not on software/technical grounds but on logistical ones: I do not know why these parts weren't populated at the factory, but if there was a solid business reason for it, accepting this PR might be incongruous with that reason.

As i understood, this was done to reduce costs. Soldering the EMC2301 on there should work, although Turing Machine will not give any official statement on this.

Copy link
Copy Markdown
Collaborator

@svenrademakers svenrademakers left a comment

Choose a reason for hiding this comment

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

I think its quite low-hanging fruit and a nice addition to have. After all, this firmware is community-driven, lets honor that

@svenrademakers svenrademakers merged commit ea1b51d into turing-machines:master Oct 16, 2023
@CFSworks CFSworks deleted the emc2301-driver branch February 13, 2024 03:05
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.

2 participants