aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2021-03-13 17:45:52 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2021-04-18 12:06:35 +0200
commit66e470594adc43d0eb7a4ab969a376435d2e0863 (patch)
tree20e5666c1ce8b83cce439cd924f688f26f43f616
parentec7cd3808de1f6a830c9e99c2f30b85d80cd4046 (diff)
downloadupstream-66e470594adc43d0eb7a4ab969a376435d2e0863.tar.gz
upstream-66e470594adc43d0eb7a4ab969a376435d2e0863.tar.bz2
upstream-66e470594adc43d0eb7a4ab969a376435d2e0863.zip
realtek: enable HWMON for SFP sensors
This adds SFP sensors as a hwmon device, allowing readout of temperatures, DOM and other sensor readings available from the SFP. Example from a ZyXEL GS1900-10HP with a DOM capable 1000Base-SX SFP: root@gs1900-10hp:~# grep . /sys/class/hwmon/hwmon0/* /sys/class/hwmon/hwmon0/curr1_crit:90 /sys/class/hwmon/hwmon0/curr1_crit_alarm:0 /sys/class/hwmon/hwmon0/curr1_input:4 /sys/class/hwmon/hwmon0/curr1_label:bias /sys/class/hwmon/hwmon0/curr1_lcrit:0 /sys/class/hwmon/hwmon0/curr1_lcrit_alarm:0 /sys/class/hwmon/hwmon0/curr1_max:85 /sys/class/hwmon/hwmon0/curr1_max_alarm:0 /sys/class/hwmon/hwmon0/curr1_min:0 /sys/class/hwmon/hwmon0/curr1_min_alarm:0 /sys/class/hwmon/hwmon0/in0_crit:3795 /sys/class/hwmon/hwmon0/in0_crit_alarm:0 /sys/class/hwmon/hwmon0/in0_input:3317 /sys/class/hwmon/hwmon0/in0_label:VCC /sys/class/hwmon/hwmon0/in0_lcrit:2805 /sys/class/hwmon/hwmon0/in0_lcrit_alarm:0 /sys/class/hwmon/hwmon0/in0_max:3465 /sys/class/hwmon/hwmon0/in0_max_alarm:0 /sys/class/hwmon/hwmon0/in0_min:3135 /sys/class/hwmon/hwmon0/in0_min_alarm:0 /sys/class/hwmon/hwmon0/name:sfp_p10 /sys/class/hwmon/hwmon0/power1_crit:708 /sys/class/hwmon/hwmon0/power1_crit_alarm:0 /sys/class/hwmon/hwmon0/power1_input:259 /sys/class/hwmon/hwmon0/power1_label:TX_power /sys/class/hwmon/hwmon0/power1_lcrit:89 /sys/class/hwmon/hwmon0/power1_lcrit_alarm:0 /sys/class/hwmon/hwmon0/power1_max:501 /sys/class/hwmon/hwmon0/power1_max_alarm:0 /sys/class/hwmon/hwmon0/power1_min:126 /sys/class/hwmon/hwmon0/power1_min_alarm:0 /sys/class/hwmon/hwmon0/power2_crit:1259 /sys/class/hwmon/hwmon0/power2_crit_alarm:0 /sys/class/hwmon/hwmon0/power2_input:404 /sys/class/hwmon/hwmon0/power2_label:RX_power /sys/class/hwmon/hwmon0/power2_lcrit:6 /sys/class/hwmon/hwmon0/power2_lcrit_alarm:0 /sys/class/hwmon/hwmon0/power2_max:794 /sys/class/hwmon/hwmon0/power2_max_alarm:0 /sys/class/hwmon/hwmon0/power2_min:10 /sys/class/hwmon/hwmon0/power2_min_alarm:0 /sys/class/hwmon/hwmon0/temp1_crit:100000 /sys/class/hwmon/hwmon0/temp1_crit_alarm:0 /sys/class/hwmon/hwmon0/temp1_input:22547 /sys/class/hwmon/hwmon0/temp1_label:temperature /sys/class/hwmon/hwmon0/temp1_lcrit:-50000 /sys/class/hwmon/hwmon0/temp1_lcrit_alarm:0 /sys/class/hwmon/hwmon0/temp1_max:85000 /sys/class/hwmon/hwmon0/temp1_max_alarm:0 /sys/class/hwmon/hwmon0/temp1_min:-40000 /sys/class/hwmon/hwmon0/temp1_min_alarm:0 /sys/class/hwmon/hwmon0/uevent:OF_NAME=sfp-p10 /sys/class/hwmon/hwmon0/uevent:OF_FULLNAME=/sfp-p10 /sys/class/hwmon/hwmon0/uevent:OF_COMPATIBLE_0=sff,sfp /sys/class/hwmon/hwmon0/uevent:OF_COMPATIBLE_N=1 Tested-by: Birger Koblitz <mail@birger-koblitz.de> Signed-off-by: Bjørn Mork <bjorn@mork.no> (cherry picked from commit 2a912fb63adc3fb3a1ee746589f6df4bb02e4296)
-rw-r--r--target/linux/realtek/config-5.41
1 files changed, 1 insertions, 0 deletions
diff --git a/target/linux/realtek/config-5.4 b/target/linux/realtek/config-5.4
index 2fbd904376..ed8c602337 100644
--- a/target/linux/realtek/config-5.4
+++ b/target/linux/realtek/config-5.4
@@ -82,6 +82,7 @@ CONFIG_HAS_DMA=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT_MAP=y
# CONFIG_HIGH_RES_TIMERS is not set
+CONFIG_HWMON=y
CONFIG_HZ=250
CONFIG_HZ_250=y
CONFIG_HZ_PERIODIC=y