<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/sys/dev/asmc, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>asmc: add automatic voltage/current/power/ambient sensor detection</title>
<updated>2026-04-17T02:31:37+00:00</updated>
<author>
<name>Abdelkader Boudih</name>
<email>chaos@seuros.com</email>
</author>
<published>2026-04-17T02:31:21+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=aae9068404947dd9ffd8522359d0f9dffaa70414'/>
<id>aae9068404947dd9ffd8522359d0f9dffaa70414</id>
<content type='text'>
Apple SMCs contain numerous undocumented voltage, current, power,
and ambient light sensors. This change adds automatic detection
and registration of these sensors as sysctls.

New sysctl trees:
  dev.asmc.0.voltage.*  - Voltage sensors (millivolts)
  dev.asmc.0.current.*  - Current sensors (milliamps)
  dev.asmc.0.power.*    - Power sensors (milliwatts)
  dev.asmc.0.ambient.*  - Ambient light sensors

Implementation:
- Scans all SMC keys at attach time via asmc_key_dump_by_index()
- Identifies sensors by key prefix patterns:
  - Voltage: VC*, VD*, VG*, VP*, VI*
  - Current: I{C,D,G,M,N,O,H,P,B,A,L}*
  - Power:   P{C,D,N,S,T,H,F,Z,z}*
  - Light:   ALV*, ALS*
- Dynamically creates sysctls for detected sensors
- Supports 8 fixed-point SMC data types:
  - sp78, sp87, sp4b, sp5a, sp69, sp96, sp2d, ui16
- Auto-converts all values to milli-units (mV, mA, mW)

On Mac Mini 5,1, detects:
- 7 voltage sensors
- 18 current sensors
- 27 power sensors
- 2 ambient light sensors

Enables power consumption monitoring, voltage rail debugging,
and ambient light detection without hardcoding model-specific
sensor lists.

Tested on:
  - Mac Mini 5,1 (2011) running FreeBSD 15.0-RELEASE
  - 54 sensors auto-detected and exposed via sysctl
  - All sensor types verified with multimeter readings
  - Fixed-point conversions validated against known values
  - Memory management tested (malloc/free on detach)

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D55807
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apple SMCs contain numerous undocumented voltage, current, power,
and ambient light sensors. This change adds automatic detection
and registration of these sensors as sysctls.

New sysctl trees:
  dev.asmc.0.voltage.*  - Voltage sensors (millivolts)
  dev.asmc.0.current.*  - Current sensors (milliamps)
  dev.asmc.0.power.*    - Power sensors (milliwatts)
  dev.asmc.0.ambient.*  - Ambient light sensors

Implementation:
- Scans all SMC keys at attach time via asmc_key_dump_by_index()
- Identifies sensors by key prefix patterns:
  - Voltage: VC*, VD*, VG*, VP*, VI*
  - Current: I{C,D,G,M,N,O,H,P,B,A,L}*
  - Power:   P{C,D,N,S,T,H,F,Z,z}*
  - Light:   ALV*, ALS*
- Dynamically creates sysctls for detected sensors
- Supports 8 fixed-point SMC data types:
  - sp78, sp87, sp4b, sp5a, sp69, sp96, sp2d, ui16
- Auto-converts all values to milli-units (mV, mA, mW)

On Mac Mini 5,1, detects:
- 7 voltage sensors
- 18 current sensors
- 27 power sensors
- 2 ambient light sensors

Enables power consumption monitoring, voltage rail debugging,
and ambient light detection without hardcoding model-specific
sensor lists.

Tested on:
  - Mac Mini 5,1 (2011) running FreeBSD 15.0-RELEASE
  - 54 sensors auto-detected and exposed via sysctl
  - All sensor types verified with multimeter readings
  - Fixed-point conversions validated against known values
  - Memory management tested (malloc/free on detach)

Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D55807
</pre>
</div>
</content>
</entry>
<entry>
<title>asmc: correctly label ASMC_KEY_FANMINSPEED as read-write</title>
<updated>2026-04-16T06:05:20+00:00</updated>
<author>
<name>Marcus Gartner</name>
<email>magartner@gmail.com</email>
</author>
<published>2026-04-11T02:02:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=31744051c8a1c8baca219d93ace6e3e1a5463a45'/>
<id>31744051c8a1c8baca219d93ace6e3e1a5463a45</id>
<content type='text'>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2137
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2137
</pre>
</div>
</content>
</entry>
<entry>
<title>asmc: add support for MacBookPro13,1</title>
<updated>2026-04-16T06:05:19+00:00</updated>
<author>
<name>Marcus Gartner</name>
<email>magartner@gmail.com</email>
</author>
<published>2026-04-11T02:03:18+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=b5b9c65a689457e608cc31831ed690d303d63ffa'/>
<id>b5b9c65a689457e608cc31831ed690d303d63ffa</id>
<content type='text'>
This commit adds support for the MacBookPro13,1 (late 2016, 13-inch). The SMC
keys were collected from https://logi.wiki/index.php/SMC_Sensor_Codes. Two
temperature keys are omitted because they fail to be read: TI0P (IO Proximity)
and Ta0P (Ambient Air).

Note that the with this model the `dev.asmc.0.fan.0.minspeed` setting only
applies when the fans have been activated by the system. In my testing, the fans
did not spin up until CPU temperatures hit about 80C. At lower temperatures, the
fans will happily ignore the minimum speed and remain at 0 rpm.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2137
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit adds support for the MacBookPro13,1 (late 2016, 13-inch). The SMC
keys were collected from https://logi.wiki/index.php/SMC_Sensor_Codes. Two
temperature keys are omitted because they fail to be read: TI0P (IO Proximity)
and Ta0P (Ambient Air).

Note that the with this model the `dev.asmc.0.fan.0.minspeed` setting only
applies when the fans have been activated by the system. In my testing, the fans
did not spin up until CPU temperatures hit about 80C. At lower temperatures, the
fans will happily ignore the minimum speed and remain at 0 rpm.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2137
</pre>
</div>
</content>
</entry>
<entry>
<title>asmc: add raw SMC key read/write interface</title>
<updated>2026-04-15T04:21:46+00:00</updated>
<author>
<name>Abdelkader Boudih</name>
<email>chaos@seuros.com</email>
</author>
<published>2026-04-15T04:20:52+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3e27114a7f961aac49d75a663a55332375d0bef3'/>
<id>3e27114a7f961aac49d75a663a55332375d0bef3</id>
<content type='text'>
This patch adds a debugging interface to read and write arbitrary
Apple SMC keys by name through sysctl, enabling hardware exploration
 and control of undocumented features.

The interface provides four sysctls under dev.asmc.0.raw.*:
  - key - Set the 4-character SMC key name (e.g., "AUPO")
  - value - Read/write key value as a hex string
  - len - Auto-detected key value length (can be overridden)
  - type - Read-only 4-character type string (e.g., "ui8", "flt")

Implementation includes a new asmc_key_getinfo() function using SMC
command 0x13 to query key metadata. The interface automatically
detects key lengths and types, uses hex string encoding for
arbitrary binary values, and is safe for concurrent access via
CTLFLAG_NEEDGIANT.

This interface was essential for discovering that the AUPO key
enables Wake-on-LAN from S5 state, and for mapping all 297 SMC keys
on Mac Mini 5,1.

Reviewed by:	ngie, adrian, markj
Differential Revision:	https://reviews.freebsd.org/D54441
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds a debugging interface to read and write arbitrary
Apple SMC keys by name through sysctl, enabling hardware exploration
 and control of undocumented features.

The interface provides four sysctls under dev.asmc.0.raw.*:
  - key - Set the 4-character SMC key name (e.g., "AUPO")
  - value - Read/write key value as a hex string
  - len - Auto-detected key value length (can be overridden)
  - type - Read-only 4-character type string (e.g., "ui8", "flt")

Implementation includes a new asmc_key_getinfo() function using SMC
command 0x13 to query key metadata. The interface automatically
detects key lengths and types, uses hex string encoding for
arbitrary binary values, and is safe for concurrent access via
CTLFLAG_NEEDGIANT.

This interface was essential for discovering that the AUPO key
enables Wake-on-LAN from S5 state, and for mapping all 297 SMC keys
on Mac Mini 5,1.

Reviewed by:	ngie, adrian, markj
Differential Revision:	https://reviews.freebsd.org/D54441
</pre>
</div>
</content>
</entry>
<entry>
<title>asmc(4): Add support for backlight(9) interface</title>
<updated>2026-03-29T19:00:59+00:00</updated>
<author>
<name>Vladimir Kondratyev</name>
<email>wulf@FreeBSD.org</email>
</author>
<published>2026-03-29T19:00:59+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5d7862fb998f48ba71dac7e34106aaad350db348'/>
<id>5d7862fb998f48ba71dac7e34106aaad350db348</id>
<content type='text'>
MFC after:	1 month
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
MFC after:	1 month
</pre>
</div>
</content>
</entry>
<entry>
<title>asmc(4): Add PnP record</title>
<updated>2026-03-29T19:00:59+00:00</updated>
<author>
<name>Vladimir Kondratyev</name>
<email>wulf@FreeBSD.org</email>
</author>
<published>2026-03-29T19:00:59+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=056e29070f083ac4cea31ac0a08619add6370839'/>
<id>056e29070f083ac4cea31ac0a08619add6370839</id>
<content type='text'>
To load asmc(4) automagically on boot with devd(8).

MFC after:	1 month
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
To load asmc(4) automagically on boot with devd(8).

MFC after:	1 month
</pre>
</div>
</content>
</entry>
<entry>
<title>Add ASMC support for Macbook Pro 8,3</title>
<updated>2026-03-07T07:51:15+00:00</updated>
<author>
<name>tslight</name>
<email>tslight@pm.com</email>
</author>
<published>2026-01-27T16:44:40+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=16c82e28404ec959a7335ceae1d4f43881a50d9e'/>
<id>16c82e28404ec959a7335ceae1d4f43881a50d9e</id>
<content type='text'>
Signed-off-by: tslight &lt;tslight@pm.com&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1992
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: tslight &lt;tslight@pm.com&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1992
</pre>
</div>
</content>
</entry>
<entry>
<title>use ASMC_FAN_FUNCS2 to avoid trying to read non-existent keys</title>
<updated>2026-03-07T07:51:15+00:00</updated>
<author>
<name>tslight</name>
<email>tslight@pm.com</email>
</author>
<published>2026-02-26T07:44:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=cecd12ac3b4d98bd52dc0e802a4a38bc72f50e2c'/>
<id>cecd12ac3b4d98bd52dc0e802a4a38bc72f50e2c</id>
<content type='text'>
Signed-off-by: tslight &lt;tslight@pm.com&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2051
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: tslight &lt;tslight@pm.com&gt;
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2051
</pre>
</div>
</content>
</entry>
<entry>
<title>asmc: output the SMC firmware revision on attach</title>
<updated>2026-03-01T19:03:38+00:00</updated>
<author>
<name>Enji Cooper</name>
<email>ngie@FreeBSD.org</email>
</author>
<published>2026-03-01T18:54:56+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=e81e724358e43dcf951e244a9df9df3eaa983fe9'/>
<id>e81e724358e43dcf951e244a9df9df3eaa983fe9</id>
<content type='text'>
The SMC firmware revision can prove helpful when determining why the
behavior of a given controller varies from the maintainers' expected
behavior.

This should be a sysctl (eventually), but for now dumping out the
information via `device_printf(..)` suffices, given that only one
asmc(4) compatible device can exist in an Apple platform at any
given point in time. This will become a sysctl in the future after
additional improvements are incorporated from OpenBSD and NetBSD.

MFC after:	1 week
Obtained from:	https://github.com/openbsd/src/ (sys/dev/acpi/asmc.c @ 142d064)
Differential Revision: https://reviews.freebsd.org/D55577
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The SMC firmware revision can prove helpful when determining why the
behavior of a given controller varies from the maintainers' expected
behavior.

This should be a sysctl (eventually), but for now dumping out the
information via `device_printf(..)` suffices, given that only one
asmc(4) compatible device can exist in an Apple platform at any
given point in time. This will become a sysctl in the future after
additional improvements are incorporated from OpenBSD and NetBSD.

MFC after:	1 week
Obtained from:	https://github.com/openbsd/src/ (sys/dev/acpi/asmc.c @ 142d064)
Differential Revision: https://reviews.freebsd.org/D55577
</pre>
</div>
</content>
</entry>
<entry>
<title>asmc: introduce the concept of generic models</title>
<updated>2026-02-25T06:41:42+00:00</updated>
<author>
<name>Enji Cooper</name>
<email>ngie@FreeBSD.org</email>
</author>
<published>2026-02-20T06:37:05+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=3023bb49e115b4149f9fc0683dabde172ecb1336'/>
<id>3023bb49e115b4149f9fc0683dabde172ecb1336</id>
<content type='text'>
Having to enter in each of the models for Apple hardware, recompiling,
etc, is tedious. Provide generic models so end-users can leverage some
of the capabilities provided by the driver, i.e., common features like
minimal fans and lights (if present on the generic model) support.

The generic models are as follows:
- Macmini
- MacBookAir
- MacBookPro
- MacPro

This sort of follows the pattern established by the `applesmc` driver in
Linux.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D55395
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Having to enter in each of the models for Apple hardware, recompiling,
etc, is tedious. Provide generic models so end-users can leverage some
of the capabilities provided by the driver, i.e., common features like
minimal fans and lights (if present on the generic model) support.

The generic models are as follows:
- Macmini
- MacBookAir
- MacBookPro
- MacPro

This sort of follows the pattern established by the `applesmc` driver in
Linux.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D55395
</pre>
</div>
</content>
</entry>
</feed>
