[AS5835-54x] Support psu_fan_dir sysfs for YM-1401A PSU #884
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Jostar Yang [email protected]
Because YM-1401A doesn't support psu_fan_dir from pmbus. Read from command = 0xC3 in pmbus that will always get "F2B". But YM-10401A has F2B and B2F PSU. So read PSU fan dir from psu eerpm and add psu_fan_dir sysfs. YM-1401ABR is F2B and YM-1401ACR is B2B.
Test log as below,
(YM-1401ABR)
cat /sys/bus/i2c/devices/12-0053/psu_fan_dir
F2B
onlpdump log as below,
.............
{
Description: PSU 2 - Fan 1
Status: 0x00000009 [ PRESENT,F2B ]
Caps: 0x00000038 [ SET_PERCENTAGE,GET_RPM,GET_PERCENTAGE ]
RPM: 3200
Per: 14
Model: NULL
SN: NULL
( YM-1401ACR)
/sys/bus/i2c/devices/12-0053/psu_fan_dir
B2F
onlpdump log as below,
Description: PSU-1
Model: YM-1401ACR
SN: SA040W261837000030
Status: 0x00000001 [ PRESENT ]
Caps: 0x00000151 [ AC,VOUT,IOUT,POUT ]
Vin: 0
Vout: 11841
Iin: 0
Iout: 3972
Pin: 0
Pout: 44000
fan @ 6 = {
Description: PSU 1 - Fan 1
Status: 0x00000005 [ PRESENT,B2F ]
..............