Third auto-fan control interface proposal
Hi all,
Here is my third proposal for an common auto-fan control interface.
See these previous threads for the first and second proposals and associated comments:
http://archives.andrew.net.au/lm-sensors/msg07517.html
http://archives.andrew.net.au/lm-sensors/msg08091.html
The interface is still made up of two parts: per fan temp channels selection, and trip points selection.
Temp channels selection
===========
It looks like the possibility to select more than one temp channel for a given fan controler is needed (Philip Pokorny), so we wouldn't simplify this. As in the first proposal, the values would be bitfields, 1<<N = temp channel N matters to compute the considered fan's speed.
Files :
fan1_auto_channelsfan2_auto_channels
Trip points
=====
Two distinct models exist: trip points set for a given fan, or trip points set for a given temperature channels. Looks like there is no easy conversion from one model to the other so this gives two possible sets of files (each driver picks the one matching the hardware implementation):
fan1_auto_temp_offfan1_auto_temp_minfan1_auto_temp_maxfan1_auto_pwm_minfan1_auto_pwm_maxfan2_auto_temp_offfan2_auto_temp_minfan2_auto_temp_maxfan2_auto_pwm_minfan2_auto_pwm_max
OR
temp1_auto_temp_offtemp1_auto_temp_mintemp1_auto_temp_maxtemp1_auto_pwm_mintemp1_auto_pwm_maxtemp2_auto_temp_offtemp2_auto_temp_mintemp2_auto_temp_maxtemp2_auto_pwm_mintemp2_auto_pwm_maxtemp3_auto_temp_offtemp3_auto_temp_mintemp3_auto_temp_maxtemp3_auto_pwm_mintemp3_auto_pwm_max
3 trip points in any case, but only 5 values (pwm_off is implied as 0%). Rules are:
if temp < off, fan is off
if off < temp < min, fan speed is either 0 or pwm_min (allows for hysteresis)
if min < temp < max, fan speed is between pwm_min and pwm_max. Exact value is left to the driver/hardware, but should be next to a weighted average if possible.
if temp > max, fan goes to full speed (typically pwm = 100%).
Additional notes
========
1* For some reason, the adm1031 driver had auto_ as a prefix instead of inside the names. I prefer my way because it clearly shows which element the values are attached to. OTOH I agree that "filtering" files with "ls" is somewhat easier with auto as the prefix (especially if you do *not* want to see the auto-fan files). No strong opinion actually.
2* As Mark Hoffman and Mark Studebaker noticed, this interface will necessarily leave extra features or modes behind. Thus, this interface should be considered non-limitative and subject to further extensions as additional common patterns show among various chips. In particular, driver authors should be free to:
- not implement this interface if the chip design is too different
- implement a different interface if they think it's needed (additionally or exclusively)
The other interface (or additions to the standard interface) should be prefixed in such a way that it won't collide with a further extension of the standard interface (until the feature is actually discussed and standardized).
All in all, this interface is meant for chips those implementations roughly fit into it, and that's about it.
Comments, anyone?
Thanks,
Jean Delvare
Quoted 3 lines
We also need a way to turn the whole thing on.
I propose we use a new value of 2 in fan[1-3]_pwm_enable to turn on auto-fan.
fanN_auto_channels does that already. Value 0 = all bits cleared = fan speed doesn't depend on temperature, i.e. auto mode disabled.
Quoted 1 line
I like the second model. It's for adm1031, etc.
True.
Quoted 1 line
I don't understand the first model. what drivers is it for?
IT87xx if I remember correctly.
Signature · 2 lines
Jean Delvare http://khali.linux-fr.org/
Quoted 4 lines
if that's the case, then when
auto_channelsis on,pwm_enablemust be zero, one, or don't care?(in other words, does the pwmconfig script need to change?) Usingpwm_enableas a master configure (off/manual/auto) makes sense to me.
I thought that pwm_enable would be the master command, ie:
pwm = 0: fan to full speed
pwm = 1, auto_channels = 0: manual pwm
pwm = 1, auto_channels > 0: auto pwm
But I didn't consider the pwm scripts. Would it be complicated to update these scripts according to the model I propose?
Signature · 2 lines
Jean Delvare http://khali.linux-fr.org/
We also need a way to turn the whole thing on.
I propose we use a new value of 2 in fan[1-3]_pwm_enable to turn on auto-fan.
I like the second model. It's for adm1031, etc.
I don't understand the first model. what drivers is it for?
Quoted 103 lines · Jean Delvare
Hi all,
Here is my third proposal for an common auto-fan control interface.
See these previous threads for the first and second proposals and associated comments:
http://archives.andrew.net.au/lm-sensors/msg07517.html
http://archives.andrew.net.au/lm-sensors/msg08091.htmlThe interface is still made up of two parts: per fan temp channels selection, and trip points selection.
Temp channels selection
===========>
It looks like the possibility to select more than one temp channel for a given fan controler is needed (Philip Pokorny), so we wouldn't simplify this. As in the first proposal, the values would be bitfields, 1<<N = temp channel N matters to compute the considered fan's speed.Files :
fan1_auto_channelsfan2_auto_channels
q
Trip points
=====>
Two distinct models exist: trip points set for a given fan, or trip points set for a given temperature channels. Looks like there is no easy conversion from one model to the other so this gives two possible sets of files (each driver picks the one matching the hardware implementation):
fan1_auto_temp_offfan1_auto_temp_minfan1_auto_temp_maxfan1_auto_pwm_minfan1_auto_pwm_maxfan2_auto_temp_offfan2_auto_temp_minfan2_auto_temp_maxfan2_auto_pwm_minfan2_auto_pwm_maxOR
temp1_auto_temp_offtemp1_auto_temp_mintemp1_auto_temp_maxtemp1_auto_pwm_mintemp1_auto_pwm_maxtemp2_auto_temp_offtemp2_auto_temp_mintemp2_auto_temp_maxtemp2_auto_pwm_mintemp2_auto_pwm_maxtemp3_auto_temp_offtemp3_auto_temp_mintemp3_auto_temp_maxtemp3_auto_pwm_mintemp3_auto_pwm_max3 trip points in any case, but only 5 values (
pwm_offis implied as 0%). Rules are:
if temp < off, fan is off
if off < temp < min, fan speed is either 0 orpwm_min(allows for hysteresis)
if min < temp < max, fan speed is betweenpwm_minandpwm_max. Exact value is left to the driver/hardware, but should be next to a weighted average if possible.
if temp > max, fan goes to full speed (typically pwm = 100%).Additional notes
========1* For some reason, the adm1031 driver had
auto_as a prefix instead of inside the names. I prefer my way because it clearly shows which element the values are attached to. OTOH I agree that "filtering" files with "ls" is somewhat easier with auto as the prefix (especially if you do *not* want to see the auto-fan files). No strong opinion actually.2* As Mark Hoffman and Mark Studebaker noticed, this interface will necessarily leave extra features or modes behind. Thus, this interface should be considered non-limitative and subject to further extensions as additional common patterns show among various chips. In particular, driver authors should be free to:
- not implement this interface if the chip design is too different
- implement a different interface if they think it's needed (additionally or exclusively)The other interface (or additions to the standard interface) should be prefixed in such a way that it won't collide with a further extension of the standard interface (until the feature is actually discussed and standardized).
All in all, this interface is meant for chips those implementations roughly fit into it, and that's about it.
Comments, anyone?
Thanks,
Jean Delvare
if that's the case, then when auto_channels is on, pwm_enable must be zero, one, or don't care? (in other words, does the pwmconfig script need to change?)
Using pwm_enable as a master configure (off/manual/auto) makes sense to me.
Quoted 12 lines · Jean Delvare
Quoted 3 lines
We also need a way to turn the whole thing on.
I propose we use a new value of 2 in fan[1-3]_pwm_enable to turn on auto-fan.
fanN_auto_channelsdoes that already. Value 0 = all bits cleared = fan speed doesn't depend on temperature, i.e. auto mode disabled.Quoted 1 line
I like the second model. It's for adm1031, etc.
Quoted 8 lines
True.
Quoted 1 line
I don't understand the first model. what drivers is it for?
IT87xx if I remember correctly.
I don't see how this maps to it87 very well.
In it87, just like the others, the temperature controls the fans, not vice versa. It's just that the pwm values are selected discretely. Your naming implied to me that the fan controls the temperature for it87??? confusing to me anyway.
Shouldn't it87 use the same model as the others, with some additional entries if necessary?
Just noticed that I never anwsered this point:
Quoted 7 lines
I don't see how this maps to it87 very well.
In it87, just like the others, the temperature controls the fans, not vice versa. It's just that the pwm values are selected discretely. Your naming implied to me that the fan controls the temperature for it87??? confusing to me anyway.
Shouldn't it87 use the same model as the others, with some additional entries if necessary?
The IT87xx does of course adapt fan speeds to the temperatures, not the other way around (it a hardware monitor, not an oven ;)). The difference with the ADM1031 is in how the fan speed is computed.
For the ADM1031, each temperature channels has its trip points. You use them to compute a (virtual) fan speed, then for each fan, see which temperature channels are linked to it, and pick the faster speed.
For the IT87xx, each *fan* (not temperature channel) has its trip points. You use the fan vs. temperature mapping to find which temperatures apply to this fan, pick the hottest temperature, and determine the fan speed for that temperature.
The trick is that a fan can be driven by more than one temperature, and one temperature can drive more than just one fan, which makes things kinda complex, and, more importantly, makes both models incompatible as far as I can see.
Feel free to read the IT87xx and ADM1031 datasheets again to confirm that my descriptions of both chips are OK.
If you think it is possible to merge both models in a single interface, let me know. I couldn't find a way. Or, if there is a way, it's so complex that we would make the drivers unreadable, and we don't want to do that, do we? And even then it's not perfect, IIRC.
I would like to propose a Documentation/i2c/sysfs-interface update quite soon now, we have delayed this for too long already (although I am not the only one to blame here - anyone can do it). The it87 and w83627hf drivers have people interested in adding auto-fan control support, and are basically blocked by the lack of standardized interface.
One point which was still debated is whether pwm_enable should have value 2 in auto mode (MDS' proposal), or if we would simply rely on a non-empty temperature vs. fan mapping to mean that auto mode is enabled (my original proposal). Now that I come to think of it, I think that's MDS' way is better, because it's more likely to match the chips internals, and that way we can remember the temperature vs. fan mappings when not in non-auto mode. It also makes it more clear that pwm_enable is the master control. Comments?
Thanks.
Signature · 2 lines
Jean "Khali" Delvare http://khali.linux-fr.org/
Hello:
* Jean Delvare <[email protected]> [2004-07-05 16:49:45 +0200]:
<snip>
Quoted 9 lines
It looks like the possibility to select more than one temp channel for a given fan controler is needed (Philip Pokorny), so we wouldn't simplify this. As in the first proposal, the values would be bitfields, 1<<N = temp channel N matters to compute the considered fan's speed.
Files :
fan1_auto_channelsfan2_auto_channels
<snip>
I think these should be named e.g. pwm1_auto_channels to make clear the distinction between a tacho input (fanX) and a pwm output (pwmX).
(/me goes off to look at 2.6 sysfs_interface doc again)
Oh dear. I'm sorry I wasn't paying attention to this sooner, but I think our interface needs revision again. All of the fan[nr]_pwm* files should really just be pwm[nr]*.
The association between tacho input and pwm output is arbitrary and depends on mainboard maker. E.g. our script prog/pwm/pwmconfig is made to discover the relationships.
Would anyone object to such a patch for 2.6 kernel drivers?
* * * * *
This also seems like a good time to introduce an idea that Khali and I discussed on IRC some days ago, actually, a rule-of-thumb:
Any patch to the 2.6 kernel which changes/breaks some part of the documented sysfs interface must be accompanied by a patch to libsensors. The libsensors patch must preserve backwards compat. to the sysfs interface as it existed in every kernel.org kernel from 2.6.5-rc1 to present.
I'm not suggesting we support forward-compat... nobody should complain if, after upgrading to a newer kernel, they are asked to upgrade to a newer libsensors.
We've had sort of a honeymoon period where we could change the 2.6 kernel interface at will, and not support older ones with our current libsensors. That pissed some people off, and now that distros are releasing not-quite-current 2.6 kernels, it's a real PIA all around. So, let's declare the honeymoon over.
Regards,
Signature · 2 lines
Mark M. Hoffman [email protected]
Quoted 27 lines · Mark M. Hoffman
Hello:
* Jean Delvare <[email protected]> [2004-07-05 16:49:45 +0200]:
<snip>
Quoted 9 lines
It looks like the possibility to select more than one temp channel for a given fan controler is needed (Philip Pokorny), so we wouldn't simplify this. As in the first proposal, the values would be bitfields, 1<<N = temp channel N matters to compute the considered fan's speed.
Files :
fan1_auto_channelsfan2_auto_channels<snip>
I think these should be named e.g.
pwm1_auto_channelsto make clear the distinction between a tacho input (fanX) and a pwm output (pwmX).(/me goes off to look at 2.6
sysfs_interfacedoc again)Oh dear. I'm sorry I wasn't paying attention to this sooner, but I think our interface needs revision again. All of the fan[nr]_pwm* files should really just be pwm[nr]*.
Quoted 5 lines
The association between tacho input and pwm output is arbitrary and depends on mainboard maker. E.g. our script prog/pwm/pwmconfig is made to discover the relationships.
Would anyone object to such a patch for 2.6 kernel drivers?
I'll let you and Jean argue this out :)
Quoted 5 lines
Any patch to the 2.6 kernel which changes/breaks some part of the documented sysfs interface must be accompanied by a patch to libsensors. The libsensors patch must preserve backwards compat. to the sysfs interface as it existed in every kernel.org kernel from 2.6.5-rc1 to present.
That sounds good to me.
thanks,
greg k-h
Hi Jean:
Quoted 28 lines · Jean Delvare
Quoted 9 lines
I think these should be named e.g.
pwm1_auto_channelsto make clear the distinction between a tacho input (fanX) and a pwm output (pwmX).(/me goes off to look at 2.6
sysfs_interfacedoc again)Oh dear. I'm sorry I wasn't paying attention to this sooner, but I think our interface needs revision again. All of the fan[nr]_pwm* files should really just be pwm[nr]*.
Quoted 5 lines
The association between tacho input and pwm output is arbitrary and depends on mainboard maker. E.g. our script prog/pwm/pwmconfig is made to discover the relationships.
Would anyone object to such a patch for 2.6 kernel drivers?
I wish someone noticed that *before* I did the change the other way around back in version 2.6.5...
I'm not sure I agree with you. Old chips clearly had PWM outputs and tachometers unlinked, but newer chips (Analog ADM1031, SMSC LPC47M1xx, National PC8736x) clearly assume that pwmN and fanN refer to the same physical fan. Of course, some motherboard manufacturers will ignore that recommendation, but they are to blame. For example, the SMSC LPC47M1xx chips will stop monitoring fan1 when pwm1 is enabled and has a duty cycle of 0%. Thus the driver has to force fan1 to 0 in this case. If the manufacturer used fan1 and pwm1 for different fans, then the monitored fan cannot be monitored anymore when the controlled fan is turned off.
Quoted 3 lines
Are there examples of recent chips which obviously don't consider that pwmN and fanN are linked? For example chips having a different count of tachometers and PWM outputs?
Yeah, LM93... four tachos, two PWM outputs. Odd, but it seems like one anticipated configuration is to drive fans 1-2 (tacho's 1-2) *both* from pwm1. I could be wrong about that though.
Quoted 4 lines
If fanN and pwmN match like 90% of the time and the trend is to increase that rate even more, then changing the names again now doesn't make much sense (IMHO). But since I am the one who broke the interface in the first place, I guess that my opinion doesn't really matter here.
Well, it is just a name, so I don't feel too strongly about it.
Quoted 19 lines
Quoted 13 lines
This also seems like a good time to introduce an idea that Khali and I discussed on IRC some days ago, actually, a rule-of-thumb:
Any patch to the 2.6 kernel which changes/breaks some part of the documented sysfs interface must be accompanied by a patch to libsensors. The libsensors patch must preserve backwards compat. to the sysfs interface as it existed in every kernel.org kernel from 2.6.5-rc1 to present.
I'm not suggesting we support forward-compat... nobody should complain if, after upgrading to a newer kernel, they are asked to upgrade to a newer libsensors.
Quoted 5 lines
We've had sort of a honeymoon period where we could change the 2.6 kernel interface at will, and not support older ones with our current libsensors. That pissed some people off, and now that distros are releasing not-quite-current 2.6 kernels, it's a real PIA all around. So, let's declare the honeymoon over.
Quoted 5 lines
Agreed. If you failed to notice, I've already added the needed code in libsensors. Basically it lets you define 2 sysfs files instead of 1 for each symbol. Both files are tried in turn, and the operation fails if both files are missing. I have not defined an alternate magnitude yet, because I doubt we'll need it, but this could be added if needed.
I did notice - thanks, btw.
Quoted 10 lines
This change in libsensors isn't exactly elegant, but the previous code wasn't either, and it was actually less complex that I first feared.
I've already included the
in0_ref<->cpu0_vidcompatibility, although the 2.6 drivers have not been updated yet. Thein0_refname was one other unnoticed mistake I made back in version 2.6.5 or so. And this time I definitely agree that we can never say which "in" channel will be used for vcore monitoring, since even on recent chips the motherboard manufacturers don't follow the recommendations.
Quoted 2 lines
There's also a lm83-specific compatibility rule for critical temperature
- driver update has already been sent to Greg.
Regards,
Signature · 2 lines
Mark M. Hoffman [email protected]
Quoted 9 lines
I think these should be named e.g.
pwm1_auto_channelsto make clear the distinction between a tacho input (fanX) and a pwm output (pwmX).(/me goes off to look at 2.6
sysfs_interfacedoc again)Oh dear. I'm sorry I wasn't paying attention to this sooner, but I think our interface needs revision again. All of the fan[nr]_pwm* files should really just be pwm[nr]*.
Quoted 5 lines
The association between tacho input and pwm output is arbitrary and depends on mainboard maker. E.g. our script prog/pwm/pwmconfig is made to discover the relationships.
Would anyone object to such a patch for 2.6 kernel drivers?
I wish someone noticed that *before* I did the change the other way around back in version 2.6.5...
I'm not sure I agree with you. Old chips clearly had PWM outputs and tachometers unlinked, but newer chips (Analog ADM1031, SMSC LPC47M1xx, National PC8736x) clearly assume that pwmN and fanN refer to the same physical fan. Of course, some motherboard manufacturers will ignore that recommendation, but they are to blame. For example, the SMSC LPC47M1xx chips will stop monitoring fan1 when pwm1 is enabled and has a duty cycle of 0%. Thus the driver has to force fan1 to 0 in this case. If the manufacturer used fan1 and pwm1 for different fans, then the monitored fan cannot be monitored anymore when the controlled fan is turned off.
Are there examples of recent chips which obviously don't consider that pwmN and fanN are linked? For example chips having a different count of tachometers and PWM outputs?
If fanN and pwmN match like 90% of the time and the trend is to increase that rate even more, then changing the names again now doesn't make much sense (IMHO). But since I am the one who broke the interface in the first place, I guess that my opinion doesn't really matter here.
Quoted 13 lines
This also seems like a good time to introduce an idea that Khali and I discussed on IRC some days ago, actually, a rule-of-thumb:
Any patch to the 2.6 kernel which changes/breaks some part of the documented sysfs interface must be accompanied by a patch to libsensors. The libsensors patch must preserve backwards compat. to the sysfs interface as it existed in every kernel.org kernel from 2.6.5-rc1 to present.
I'm not suggesting we support forward-compat... nobody should complain if, after upgrading to a newer kernel, they are asked to upgrade to a newer libsensors.
Quoted 5 lines
We've had sort of a honeymoon period where we could change the 2.6 kernel interface at will, and not support older ones with our current libsensors. That pissed some people off, and now that distros are releasing not-quite-current 2.6 kernels, it's a real PIA all around. So, let's declare the honeymoon over.
Agreed. If you failed to notice, I've already added the needed code in libsensors. Basically it lets you define 2 sysfs files instead of 1 for each symbol. Both files are tried in turn, and the operation fails if both files are missing. I have not defined an alternate magnitude yet, because I doubt we'll need it, but this could be added if needed.
This change in libsensors isn't exactly elegant, but the previous code wasn't either, and it was actually less complex that I first feared.
I've already included the in0_ref <-> cpu0_vid compatibility, although the 2.6 drivers have not been updated yet. The in0_ref name was one other unnoticed mistake I made back in version 2.6.5 or so. And this time I definitely agree that we can never say which "in" channel will be used for vcore monitoring, since even on recent chips the motherboard manufacturers don't follow the recommendations.
There's also a lm83-specific compatibility rule for critical temperature
- driver update has already been sent to Greg.
Thanks.
Signature · 2 lines
Jean "Khali" Delvare http://khali.linux-fr.org/
Quoted 17 lines · Jean Delvare
Quoted 6 lines
Quoted 4 lines
Yeah, LM93... four tachos, two PWM outputs. Odd, but it seems like one anticipated configuration is to drive fans 1-2 (tacho's 1-2) *both* from pwm1. I could be wrong about that though.
Your not. A real pending configuration looks like:
Quoted 8 lines
Fan A1----\ Fan A2----|---\ >-------PWM1 Fan B1----|---/ Fan B2----/ Fan C1----|------------PWM2 Fan C2----/OK, I have to accept Mark's idea then.
Quoted 8 lines
Would it make sense to accept both
fanN_pwmand pwmN, and use the approriate entries depending on the chip? It would also mean two possible names for auto-fan contol files (it87 model), so there would be three possible sets of names instead of two. This is not good, but OTOH, using pwmN for SMSC-like chips will probably make the user wonder why fan1 will stop monitoring when pwm1 is set to 0% duty cycle...So I guess we better simply revert to pwmN as Mark suggested.
OK. :) I'll do the patches in a few days, since I brought it up.
Regards,
Signature · 2 lines
Mark M. Hoffman [email protected]
Quoted 6 lines
Quoted 4 lines
Yeah, LM93... four tachos, two PWM outputs. Odd, but it seems like one anticipated configuration is to drive fans 1-2 (tacho's 1-2) *both* from pwm1. I could be wrong about that though.
Your not. A real pending configuration looks like:
Quoted 8 lines
Fan A1----\
Fan A2----|---\
>-------PWM1
Fan B1----|---/
Fan B2----/
Fan C1----|------------PWM2
Fan C2----/ OK, I have to accept Mark's idea then.
Would it make sense to accept both fanN_pwm and pwmN, and use the approriate entries depending on the chip? It would also mean two possible names for auto-fan contol files (it87 model), so there would be three possible sets of names instead of two. This is not good, but OTOH, using pwmN for SMSC-like chips will probably make the user wonder why fan1 will stop monitoring when pwm1 is set to 0% duty cycle...
So I guess we better simply revert to pwmN as Mark suggested.
Signature · 2 lines
Jean "Khali" Delvare http://khali.linux-fr.org/
Quoted 31 lines · Mark M. Hoffman
Hi Jean:
Quoted 28 lines · Jean Delvare
Quoted 9 lines
I think these should be named e.g.
pwm1_auto_channelsto make clear the distinction between a tacho input (fanX) and a pwm output (pwmX).(/me goes off to look at 2.6
sysfs_interfacedoc again)Oh dear. I'm sorry I wasn't paying attention to this sooner, but I think our interface needs revision again. All of the fan[nr]_pwm* files should really just be pwm[nr]*.
Quoted 5 lines
The association between tacho input and pwm output is arbitrary and depends on mainboard maker. E.g. our script prog/pwm/pwmconfig is made to discover the relationships.
Would anyone object to such a patch for 2.6 kernel drivers?
I wish someone noticed that *before* I did the change the other way around back in version 2.6.5...
I'm not sure I agree with you. Old chips clearly had PWM outputs and tachometers unlinked, but newer chips (Analog ADM1031, SMSC LPC47M1xx, National PC8736x) clearly assume that pwmN and fanN refer to the same physical fan. Of course, some motherboard manufacturers will ignore that recommendation, but they are to blame. For example, the SMSC LPC47M1xx chips will stop monitoring fan1 when pwm1 is enabled and has a duty cycle of 0%. Thus the driver has to force fan1 to 0 in this case. If the manufacturer used fan1 and pwm1 for different fans, then the monitored fan cannot be monitored anymore when the controlled fan is turned off.
Quoted 8 lines
Quoted 3 lines
Are there examples of recent chips which obviously don't consider that pwmN and fanN are linked? For example chips having a different count of tachometers and PWM outputs?
Yeah, LM93... four tachos, two PWM outputs. Odd, but it seems like one anticipated configuration is to drive fans 1-2 (tacho's 1-2) *both* from pwm1. I could be wrong about that though.
Your not. A real pending configuration looks like:
Fan A1----\
Fan A2----|---\
>-------PWM1
Fan B1----|---/
Fan B2----/
Fan C1----|------------PWM2
Fan C2----/ Cheers...james
<snip>