Bug 218574

Summary: asmc(4): Add support for MacBook Air 2011, 11inch model (4,1 & 4,2) to control backlight / fans
Product: Base System Reporter: NapoleonWils0n <t43InvisibleMan>
Component: kernAssignee: Mark Johnston <markj>
Status: Closed FIXED    
Severity: Affects Many People CC: adrian, dab, emaste, john, markj, tm
Priority: --- Keywords: easy, feature, needs-qa
Version: CURRENTFlags: koobs: maintainer-feedback? (markj)
koobs: maintainer-feedback? (adrian)
koobs: maintainer-feedback? (dab)
koobs: mfc-stable13?
koobs: mfc-stable12?
Hardware: Any   
OS: Any   
Attachments:
Description Flags
asmc patch for macbook air 2011 11 inch model 4,1
none
Combined patch for Macbook Air 2011, 11 (4,1) and 13 (4,2) inch models none

Description NapoleonWils0n 2017-04-11 22:01:45 UTC
Created attachment 181703 [details]
asmc patch for macbook air 2011 11 inch model 4,1

I have created a patch for asmc for the Macbook Air 2011, 11 inch model 4,1

I dumped the smc stats from the macbook air using smc fan control

This patch enables the keyboard backlight and fan control
Comment 1 Thomas Merkel 2017-08-07 08:31:51 UTC
I would like to let you know that I've running a similar patch to yours at my MacBook Air which works perfect!
Comment 2 Ed Maste freebsd_committer freebsd_triage 2018-03-08 18:54:20 UTC
Do you have the names/descriptions for the temperature sensors?
Comment 3 NapoleonWils0n 2018-10-23 16:00:26 UTC
Hi Ed

sorry for late reply, 
i havent checked the post for a while my bad

I actually followed someones blog post about dumping smc settings from the mac,
so i dont have any names description for the temp sensors

I have all the notes i made at the time, 
and the smc settings i dumped from the mac if thats any help

+ my notes on dumping smc and creating asmc entry

https://github.com/NapoleonWils0n/cerberus/blob/master/freebsd/freebsd-macbook.md#build-custom-kernel

+ smc stats dumped from my mac

https://github.com/NapoleonWils0n/cerberus/blob/master/freebsd/smc-macbook-air.txt

+ asmc patch

https://github.com/NapoleonWils0n/cerberus/blob/master/freebsd/asmc-patch.txt

+ asmc.c and asmcvar.h

https://github.com/NapoleonWils0n/cerberus/tree/master/freebsd/asmc-macbook-air


I think it was this post on reddit i followed

https://www.reddit.com/r/freebsd/comments/4ufu92/can_anyone_explain_to_me_how_i_can_add_my_own/
Comment 4 John Hay 2019-06-22 08:20:57 UTC
Created attachment 205277 [details]
Combined patch for Macbook Air 2011, 11 (4,1) and 13 (4,2) inch models

The patch was created on FreeBSD 12
Comment 5 John Hay 2019-06-22 08:26:30 UTC
If someone is interested in descriptions for the sensors, the openbsd driver with the same name, although with a different layout, have a lot of them:

https://cvsweb.openbsd.org/src/sys/dev/isa/asmc.c?rev=1.32&content-type=text/x-cvsweb-markup
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2022-04-27 03:42:19 UTC
^Triage: Request feedback / commit from the folks who have landed asmc support before. Please cancel flag if you don't have any available cycles.

With specific hardware model availability being unlikely, whats the best way to get these landed?
Comment 7 commit-hook freebsd_committer freebsd_triage 2022-05-04 15:34:37 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=308340cce2f02f06855f3ed355a2936fbc5c16bf

commit 308340cce2f02f06855f3ed355a2936fbc5c16bf
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-05-04 14:33:40 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-05-04 15:30:47 +0000

    asmc: Add support for MacBook Air 4,1 and 4,2 (2011)

    PR:             218574
    Submitted by:   NapoleonWils0n <t43InvisibleMan@gmail.com>
    Submitted by:   John Hay <john@sanren.ac.za>
    MFC after:      2 weeks

 sys/dev/asmc/asmc.c    | 16 ++++++++++++++++
 sys/dev/asmc/asmcvar.h | 24 ++++++++++++++++++++++++
 2 files changed, 40 insertions(+)
Comment 8 commit-hook freebsd_committer freebsd_triage 2022-05-18 21:27:41 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=85f0cdff6ff18d44fb17cafb705ce692c9598dd9

commit 85f0cdff6ff18d44fb17cafb705ce692c9598dd9
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-05-04 14:33:40 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-05-18 21:15:43 +0000

    asmc: Add support for MacBook Air 4,1 and 4,2 (2011)

    PR:             218574
    Submitted by:   NapoleonWils0n <t43InvisibleMan@gmail.com>
    Submitted by:   John Hay <john@sanren.ac.za>

    (cherry picked from commit 308340cce2f02f06855f3ed355a2936fbc5c16bf)

 sys/dev/asmc/asmc.c    | 16 ++++++++++++++++
 sys/dev/asmc/asmcvar.h | 24 ++++++++++++++++++++++++
 2 files changed, 40 insertions(+)