Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

/sys/class/hwmon

FieldValue
Subsystemhardware monitoring (hwmon) core, drivers/hwmon/hwmon.c
Config gateCONFIG_HWMON (obj-$(CONFIG_HWMON) += hwmon.o in drivers/hwmon/Makefile, torvalds/linux master)
ABI documentationDocumentation/ABI/testing/sysfs-class-hwmon
Sincenot stated: the ABI file carries no KernelVersion: lines (What: entries only)
Live (5.10.134 host)class directory present, 0 devices (no sensor chip driver bound in the container)
Ledger IDSYSC-hwmon

What it represents

One directory per hardware monitoring chip registered with the hwmon core: voltage, temperature, fan, current, power, energy, and humidity sensors plus fan-speed (PWM) controls. Chip drivers register a hwmon device; the core creates hwmonX entries and forwards attribute names to the driver. This is the interface sensors (lm-sensors) and fancontrol read.

Relationship to the device model

/sys/class/hwmon/hwmonX is a class view of a device that also lives under /sys/devices/... (the device link inside hwmonX points at the parent, typically an i2c or platform device). There is no bus of its own and no /sys/dev entry: hwmon devices carry no major:minor. The legacy per-driver sysfs layout is described in Documentation/hwmon/sysfs-interface.rst, which the class ABI mirrors.

Attributes

120 attribute paths spell /sys/class/hwmon/... in What: lines across the ABI tree (119 of them in sysfs-class-hwmon itself, 1 in a driver ABI file); the sysfs-attrs.json cross-check and the ledger both record 120. The table below is representative.

AttributeR/WUnit/formatConditional?Source
hwmonX/nameROshort lowercase chip name; only mandatory attributenoABI What hwmonX/name
hwmonX/labelROfree-form textdriver-dependentABI What hwmonX/label
hwmonX/update_intervalRWmillisecondsdriver-dependentABI What hwmonX/update_interval
hwmonX/tempY_inputROmillidegree Celsiusper channel YABI What tempY_input
hwmonX/tempY_maxRWmillidegree Celsiusper channelABI What tempY_max
hwmonX/tempY_max_alarmRO0/1 flagper channelABI What tempY_max_alarm
hwmonX/fanY_inputROrevolution/min (RPM)per channelABI What fanY_input
hwmonX/fanY_faultRO0/1 flagper channelABI What fanY_fault
hwmonX/pwmYRW0-255 (255 = 100%)fan-control chipsABI What pwmY
hwmonX/pwmY_enableRW0 none, 1 manual, 2+ automaticfan-control chipsABI What pwmY_enable
hwmonX/inY_inputROmillivolt (board scaling not applied)per channelABI What inY_input
hwmonX/currY_inputROmilliampereper channelABI What currY_input
hwmonX/powerY_inputROmicroWatt; energyY_input is microJouleper channelABI What powerY_input, energyY_input
hwmonX/humidityY_inputROmilli-percent (per cent mille)per channelABI What humidityY_input
hwmonX/intrusionY_alarmRW0/1; sticks until cleared by writing 0chassis intrusion supportABI What intrusionY_alarm

Channel numbering (Y) and the subset present are driver-specific; limits, alarms, _enable, _label, and rated/history variants follow the same per-family naming. Live values were not sampled: the host has no hwmon device.

Safety and writes

All readings are safe to read as any user. Writes (limits, pwmY, *_enable, history resets) affect sensor policy or fan control and need root; writing a wrong pwmY_enable mode can force fans to full speed or hand control to the chip. Alarm flags other than intrusionY_alarm clear on read; the intrusion flag persists until explicitly cleared. powerY_cap and friends state that the system reacts when limits are crossed, so treat them as safety-critical configuration, not telemetry.

References

  • Documentation/ABI/testing/sysfs-class-hwmon (cached copy: 1089 lines, What: inventory)
  • drivers/hwmon/hwmon.c, drivers/hwmon/Makefile (torvalds/linux master)
  • Documentation/hwmon/sysfs-interface.rst
  • Ledger row SYSC-hwmon (src/linux/sysfs/ledger.md); prior research: worklog Task 2-b