History log of /src/sys/dev/asmc/asmc.c (Results 1 – 25 of 307)
Revision Date Author Comments
# 16c82e28 27-Jan-2026 tslight <tslight@pm.com>

Add ASMC support for Macbook Pro 8,3

Signed-off-by: tslight <tslight@pm.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1992


# cecd12ac 26-Feb-2026 tslight <tslight@pm.com>

use ASMC_FAN_FUNCS2 to avoid trying to read non-existent keys

Signed-off-by: tslight <tslight@pm.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/2051


# e81e7243 01-Mar-2026 Enji Cooper <ngie@FreeBSD.org>

asmc: output the SMC firmware revision on attach

The SMC firmware revision can prove helpful when determining why the
behavior of a given controller varies from the maintainers' expected
behavior.

asmc: output the SMC firmware revision on attach

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

show more ...


# 3023bb49 20-Feb-2026 Enji Cooper <ngie@FreeBSD.org>

asmc: introduce the concept of generic models

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 cap

asmc: introduce the concept of generic models

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

show more ...


# 94db3650 25-Feb-2026 Abdelkader Boudih <freebsd@seuros.com>

asmc: add Wake-on-LAN control via sysctl

Apple Mac systems support Wake-on-LAN from powered-off state (S5/G2) via
the AUPO SMC key.

This change adds a convenience sysctl, `dev.asmc.0.wol`. This can

asmc: add Wake-on-LAN control via sysctl

Apple Mac systems support Wake-on-LAN from powered-off state (S5/G2) via
the AUPO SMC key.

This change adds a convenience sysctl, `dev.asmc.0.wol`. This can be
disabled if set to 0 and enabled if set to 1.

The AUPO key is volatile and resets to 0x00 on every boot, so WoL must
be manually enabled before each shutdown to work from powered-off state.
Users need to run: `sysctl dev.asmc.0.wol=1` before shutting down the
system. The sysctl is best set to persist in `/etc/sysctl.conf`.

MFC after: 1 week
Reviewed By: markj, ngie
Differential Revision: https://reviews.freebsd.org/D54439

show more ...


# 0fc6c3f7 21-Feb-2026 Enji Cooper <ngie@FreeBSD.org>

chore: replace {0, 0} with {DEV,KOBJ}METHOD_END

Both of the aforementioned macros have been present in FreeBSD
for well over a decade: 2009 for `KOBJMETHOD_END`; 2011 for
`DEVMETHOD_END`.

Adapt all

chore: replace {0, 0} with {DEV,KOBJ}METHOD_END

Both of the aforementioned macros have been present in FreeBSD
for well over a decade: 2009 for `KOBJMETHOD_END`; 2011 for
`DEVMETHOD_END`.

Adapt all hardcoded references of `{0, 0}` with `DEVMETHOD_END`
and `KOBJMETHOD_END` as appropriate. This helps ensure that
future adaptations to drivers following patterns documented
in driver(9) can be made more easily/without issue.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55414

show more ...


# eda36ae0 30-Jan-2026 Enji Cooper <ngie@FreeBSD.org>

asmc: resource cleanup simplifications

This change makes `asmc_detach(..)` reentrant by setting freed resources
to known invalid values when done, and makes `asmc_attach(..)` call
`asmc_detach(..)`

asmc: resource cleanup simplifications

This change makes `asmc_detach(..)` reentrant by setting freed resources
to known invalid values when done, and makes `asmc_attach(..)` call
`asmc_detach(..)` instead of attempting to the semi-equivalent way of
cleaning up the driver resources allocated in `asmc_detach(..)`.

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55413

show more ...


# e20e26e4 20-Feb-2026 Enji Cooper <ngie@FreeBSD.org>

asmc: code style modernization and minor cleanups

- Allow `ASMC_DEBUG` to be treated as a variadic macro.
- Add ellipses around `sizeof(..)` calls.
- Reindent some of the lines to better follow styl

asmc: code style modernization and minor cleanups

- Allow `ASMC_DEBUG` to be treated as a variadic macro.
- Add ellipses around `sizeof(..)` calls.
- Reindent some of the lines to better follow style(9) with line
wrapping.

A number of other clang-format changes were not taken as they are not
compatible with style(9).

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D55394

show more ...


# ef1cde51 20-Feb-2026 Enji Cooper <ngie@FreeBSD.org>

chore: asmc: use designated initializers in macros

This code cleanup makes it easier for human readers to understand what each
of the fields actually represents, as well as makes it easier to modify

chore: asmc: use designated initializers in macros

This code cleanup makes it easier for human readers to understand what each
of the fields actually represents, as well as makes it easier to modify
what the macros actually do under the covers, without introducing
potential human errors.

No functional change intended.

MFC after: 1 week

show more ...


# 90edc161 20-Feb-2026 Enji Cooper <ngie@FreeBSD.org>

asmc: use symbolic names with the MacPro3,1 model

Use `ASMC_LIGHT_FUNCS_DISABLED` and `ASMC_SMS_FUNCS_DISABLED` instead of
the unrolled versions of the macros.

This makes it easier to adjust the un

asmc: use symbolic names with the MacPro3,1 model

Use `ASMC_LIGHT_FUNCS_DISABLED` and `ASMC_SMS_FUNCS_DISABLED` instead of
the unrolled versions of the macros.

This makes it easier to adjust the underlying macros/fields for
`struct asmc_model`.

No functional change intended.

MFC after: 1 week

show more ...


# 7b862cf8 20-Feb-2026 Enji Cooper <ngie@FreeBSD.org>

asmc: use `ASMC_FAN_FUNCS2` with the Macmini4,1

The Macmini4,1 model does not have "fansafespeed" support. This issue
typically manifests with messages like so:

```
asmc0: asmc_key_read for key F0S

asmc: use `ASMC_FAN_FUNCS2` with the Macmini4,1

The Macmini4,1 model does not have "fansafespeed" support. This issue
typically manifests with messages like so:

```
asmc0: asmc_key_read for key F0Sf failed 10 times, giving up
```

Swap out `ASMC_FAN_FUNCS` with `ASMC_FAN_FUNCS2` to explicitly drop
"fansafespeed" checks in the driver for the model as it doesn't support
that hardware feature.

MFC after: 1 week
Reported by: @probonopd
Closes: https://github.com/helloSystem/ISO/issues/357

show more ...


# 90d79dd5 15-Feb-2026 Abdelkader Boudih <freebsd@seuros.com>

asmc: Add MacPro3,1 temperature sensor support

Test and verified with Sonicblue7

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D54952


# 1a6bdd62 13-Feb-2026 Abdelkader Boudih <freebsd@seuros.com>

asmc: Convert driver to CTLFLAG_MPSAFE

Replace CTLFLAG_NEEDGIANT with CTLFLAG_MPSAFE for all sysctls.
The driver already uses spin mutexes (sc->sc_mtx) for hardware
access protection and does not re

asmc: Convert driver to CTLFLAG_MPSAFE

Replace CTLFLAG_NEEDGIANT with CTLFLAG_MPSAFE for all sysctls.
The driver already uses spin mutexes (sc->sc_mtx) for hardware
access protection and does not require the Giant lock.

This improves scalability by allowing concurrent sysctl access
without Giant serialization.

Reviewed by: ngie, adrian
Differential Revision: https://reviews.freebsd.org/D54613

show more ...


# 9ccdf3f3 08-Feb-2026 Enji Cooper <ngie@FreeBSD.org>

asmc: unbreak build: add missing curly brace

Fixes: d76bb14e022 ("chore: asmc: additional style(9) cleanup")


# d76bb14e 08-Feb-2026 Enji Cooper <ngie@FreeBSD.org>

chore: asmc: additional style(9) cleanup

Pick out non-gratuitous style(9) changes suggested by `clang-format` on
the driver. This helps eliminate minor stylistic issues with spaces,
braces, line len

chore: asmc: additional style(9) cleanup

Pick out non-gratuitous style(9) changes suggested by `clang-format` on
the driver. This helps eliminate minor stylistic issues with spaces,
braces, line lengths, etc, so future functional changes in the driver
will be easier to pick out.

Many of the other `clang-format` suggested changes were not taken because
they were considerably more gratuitous.

No functional change intended.

MFC after: 1 week

show more ...


# a8f3c3b5 01-Jan-2026 Enji Cooper <ngie@FreeBSD.org>

chore: asmc: minor code cleanup

- Use symbolic names in Mac definitions in lieu of the unrolled values
they represent.
- Delete trailing whitespace.
- Fix indentation.

No functional change intend

chore: asmc: minor code cleanup

- Use symbolic names in Mac definitions in lieu of the unrolled values
they represent.
- Delete trailing whitespace.
- Fix indentation.

No functional change intended.

MFC after: 1 week

show more ...


# c498eaa2 14-Jan-2026 Abdelkader Boudih <oss@seuros.com>

asmc: Add support for MacBookPro11,5

Add support for the MacBookPro11,5 (Mid 2015, 15-inch with AMD Radeon R9 M370X GPU)
to the Apple SMC driver.

Debug testing revealed this model lacks sever

asmc: Add support for MacBookPro11,5

Add support for the MacBookPro11,5 (Mid 2015, 15-inch with AMD Radeon R9 M370X GPU)
to the Apple SMC driver.

Debug testing revealed this model lacks several SMC keys present on MacBookPro11,4
(IBLC, ICMC, IC2C), that model-specific sensor definitions.

Differential Revision: https://reviews.freebsd.org/D54665
Reviewed by: adrian

show more ...


# f2245917 04-Jan-2026 Enji Cooper <ngie@FreeBSD.org>

Add ASMC_DEBUG make option

This allows folks to enable debug statements in asmc(4) using kernel
configs via the `options ASMC_DEBUG` directive.

While here, remove a duplicate `device vt_efifb` dire

Add ASMC_DEBUG make option

This allows folks to enable debug statements in asmc(4) using kernel
configs via the `options ASMC_DEBUG` directive.

While here, remove a duplicate `device vt_efifb` directive in `NOTES`
as it's already handled in the `GENERIC` config

MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D54511

show more ...


# 1ecac45c 05-Jan-2026 Abdelkader Boudih <oss@seuros.com>

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 wher

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

show more ...


# 2a7c4685 03-Jan-2026 Abdelkader Boudih <oss@seuros.com>

asmc: improve asmc_dumpall to read actual SMC key count

The asmc_dumpall debug function previously used a hardcoded loop limit
of 0x100 (256) keys with a "XXX magic number" comment.

This change imp

asmc: improve asmc_dumpall to read actual SMC key count

The asmc_dumpall debug function previously used a hardcoded loop limit
of 0x100 (256) keys with a "XXX magic number" comment.

This change improves asmc_dumpall to:

* Read the actual number of keys from the ASMC_NKEYS SMC key
* Print the key count being dumped for better debugging output
* Loop only up to the actual key count (e.g., 297 on Mac Mini 5,1)

This provides more accurate debug output and removes the magic number.

Tested on Mac Mini 5,1 (FreeBSD 16.0-CURRENT):

* Rebuild kernel with DEBUG enabled in asmc driver
* Boot with new kernel
* Verify dmesg shows "asmc_dumpall: dumping 297 keys" (or actual count)
* Verify all 297 keys are dumped

Differential Revision: https://reviews.freebsd.org/D54436
Reviewed by: markj, adrian

show more ...


# 93ca9e44 20-Apr-2025 Hrant Dadivanyan <hrant@dadivanyan.net>

asmc: Add support for macmini 6,1 and 6,2 (late 2012) models

This adds the ASMC support for the macmini 6,1 and 6,2.

PR: kern/268141
Differential Revision: https://reviews.freebsd.org/D49929


# 49a5fe1a 11-Jun-2024 Joshua Rogers <Joshua@Joshua.Hu>

asmc: Add support for MacbookPro11,4

Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>

MFC after: 2 weeks
Pull Request: https://github.com/freebsd/freebsd-src/pull/1366


# fdafd315 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remov

sys: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix

show more ...


# 685dc743 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 4d846d26 10-May-2023 Warner Losh <imp@FreeBSD.org>

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of

spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD

The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix

show more ...


12345678910>>...13