HomeFreeBSD

asmc: add per-fan manual mode control via sysctl

Description

asmc: add per-fan manual mode control via sysctl

Add per-fan manual mode control via dev.asmc.0.fan.N.manual sysctl.

Apple SMCs support manual fan control via the FS! SMC key,
a 16-bit bitmask where each bit controls one fan (0=auto, 1=manual).

This change adds a new sysctl per fan:

dev.asmc.0.fan.N.manual (0=auto, 1=manual)

When set to manual mode (1), the fan runs at the speed set via
dev.asmc.0.fan.N.targetspeed instead of automatic thermal control. When
set to auto mode (0), the SMC controls fan speed automatically.

The FS! key was already defined in asmcvar.h but not accessible.
This exposes it for debugging, testing, and advanced fan control.

Implementation uses read-modify-write to allow independent control of
each fan without affecting others.

Reviewed by: adrian, markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D54437

Details

Provenance
guest-seurosAuthored on Jan 5 2026, 6:03 PM
markjCommitted on Jan 5 2026, 6:25 PM
Reviewer
adrian
Differential Revision
D54437: asmc: add per-fan manual mode control via sysctl
Parents
rG161db3a910a4: ipfw: make create_objects_compat() static
Branches
Unknown
Tags
Unknown