summaryrefslogtreecommitdiff
path: root/sys/dev/asmc
AgeCommit message (Collapse)Author
7 daysasmc: Add support for MacBookPro11,5Abdelkader Boudih
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
2026-01-05Add ASMC_DEBUG make optionEnji Cooper
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
2026-01-05asmc: add per-fan manual mode control via sysctlAbdelkader Boudih
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
2026-01-03asmc: improve asmc_dumpall to read actual SMC key countAbdelkader Boudih
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
2025-04-24asmc: Add support for macmini 6,1 and 6,2 (late 2012) modelsHrant Dadivanyan
This adds the ASMC support for the macmini 6,1 and 6,2. PR: kern/268141 Differential Revision: https://reviews.freebsd.org/D49929
2024-08-26asmc: Add support for MacbookPro11,4Joshua Rogers
Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu> MFC after: 2 weeks Pull Request: https://github.com/freebsd/freebsd-src/pull/1366
2023-11-26sys: Automated cleanup of cdefs and other formattingWarner Losh
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
2023-08-16sys: Remove $FreeBSD$: one-line .c patternWarner Losh
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16sys: Remove $FreeBSD$: two-line .h patternWarner Losh
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-05-12spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh
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
2023-02-08asmc: Add support for 10 byte light sensor payloads; MacBookAir6,1Adrian Chadd
The later macbook models use a different packet payload for the light sensors: * There's only one, done in the camera * It's a 4 byte sensor value, not a 2 byte value * It's in a 10 byte payload. So, this adds support for that and flips it on for the MacbookAir6,2. It also adds support for MacBookAir6,1 as that now works fine here. Tested - MacBookAir6,1 and 6,2 Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D38365
2023-01-21asmc: Add MacbookAir6,2Adrian Chadd
Add in the zones for my MacbookAir6,2, a 2013 Macbook Air. Tested - said Macbook Air 2013. Thermal Zones and keyboard backlight control works fine. Differential Revision: https://reviews.freebsd.org/D38073 Approved by: jrtc27
2023-01-06asmc: Add support for MacBook5,5Michael Gmelin
This is a slightly refined version of a patch[0] by FreeBSD Forums user "tmcclean". [0]https://forums.freebsd.org/threads/success-installing-freebsd-13-0-on-macbook-pro-5-5.80458/ Reviewed by: adrian, emaste, imp Differential Revision: https://reviews.freebsd.org/D37900 MFC after: 1 month
2022-07-25asmc: Add support for MacBookPro6,2ed crowe
Modify asmc_sms_printintr() to be silent when the ambient light sensor interrupt fires on this model, since the messages can otherwise fill up the dmesg. PR: 265005 Reviewed by: markj MFC after: 2 weeks
2022-05-09asmc: Remove unused devclass argument to DRIVER_MODULE.John Baldwin
2022-05-09asmc: Update Mac Pro 6 sensor definitionsAdam S
- Make descriptions a bit more human-friendly. - Don't attempt to probe fan safe speeds, this model does not provide one. PR: 260781 MFC after: 2 weeks
2022-05-04asmc: Add support for Macmini 5,1 (2011) and 5,3 and 7,1 (2014) modelsTrev
PR: 262456 MFC after: 2 weeks
2022-05-04asmc: StyleMark Johnston
MFC after: 2 weeks
2022-05-04asmc: Add support for MacBook Pro 9,1 (mid 2012)Daniel W. Delâtre
PR: 261981 MFC after: 2 weeks
2022-05-04asmc: Make the model table const and local to asmc.cMark Johnston
No functional change intended. MFC after: 2 weeks
2022-05-04asmc: Add support for MacPro 6,1 (2013)Adam S
PR: 260781 MFC after: 2 weeks
2022-05-04asmc: Add support for MacBook Air 4,1 and 4,2 (2011)Mark Johnston
PR: 218574 Submitted by: NapoleonWils0n <t43InvisibleMan@gmail.com> Submitted by: John Hay <john@sanren.ac.za> MFC after: 2 weeks
2021-12-10asmc: plug set-but-not-unused varsMateusz Guzik
Sponsored by: Rubicon Communications, LLC ("Netgate")
2020-09-01asmc: clean up empty lines in .c and .h filesMateusz Guzik
Notes: svn path=/head/; revision=365114
2020-08-27asmc(4): Handle errors from asmc_key_read() properly.Mark Johnston
asmc_key_read() returns only 0 and 1, some callers were checking incorrectly for failure. PR: 248939 Submitted by: Tong Zhang <ztong0001@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=364871
2020-08-17asmc(4): Add support for MacBook7,1.Mark Johnston
PR: 248693 Submitted by: gcx61@interia.pl MFC after: 1 week Notes: svn path=/head/; revision=364300
2020-02-26Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki
r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
2019-02-25asmc: Add support for Mac mini 2,1David Bright
PR: 235798 Submitted by: Trev <fbsdbugs4@sentry.org> Reported by: Trev <fbsdbugs4@sentry.org> MFC after: 1 week Notes: svn path=/head/; revision=344553
2019-01-06asmc: Add support for Mac mini 4,1 (Mid-2010)David Bright
MFC after: 1 week Notes: svn path=/head/; revision=342822
2019-01-04asmc: Patch to add MacBook Pro 9,2 supportDavid Bright
PR: 211513 Submitted by: William Theesfeld Jr <wtheesfeld@mailbox.org> Reported by: William Theesfeld Jr <wtheesfeld@mailbox.org> MFC after: 1 week Notes: svn path=/head/; revision=342770
2018-12-19asmc: Add support for MacPro1,1David Bright
PR: 203431 Submitted by: jjr@alisa.org & holindho@saunalahti.fi Reported by: jjr@alisa.org MFC after: 1 week Notes: svn path=/head/; revision=342218
2018-12-17asmc: Add support for mid-2011 Macmini 5,2David Bright
PR: 225911 Submitted by: trev <fbsdbugs4@sentry.org> Reported by: trev <fbsdbugs4@sentry.org> MFC after: 1 week Notes: svn path=/head/; revision=342171
2018-12-12asmc: Add Support for Macbook Pro 8,1David Bright
PR: 217505 Submitted by: John O. Brickley <obryan.brickley@gmail.com>, updated by Maciej Pasternacki <maciej@pasternacki.net> Reported by: John O. Brickley <obryan.brickley@gmail.com> MFC after: 1 week Notes: svn path=/head/; revision=341988
2018-12-11asmc: Add Support for MacBookAir 7,1 and 7,2David Bright
PR: 226172 Submitted by: James Wright <james.wright@jigsawdezign.com> Reported by: James Wright <james.wright@jigsawdezign.com> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18396 Notes: svn path=/head/; revision=341820
2018-10-26Distinguish _CID match and _HID match and make lower priority probeTakanori Watanabe
when _CID match. Reviewed by: jhb, imp Differential Revision:https://reviews.freebsd.org/D16468 Notes: svn path=/head/; revision=339754
2018-05-24Yank crufty INTR_FILTER optionConrad Meyer
It was introduced to the tree in r169320 and r169321 in May 2007. It never got much use and never became a kernel default. The code duplicates the default path quite a bit, with slight modifications. Just yank out the cruft. Whatever goals were being aimed for can probably be met within the existing framework, without a flag day option. Mostly mechanical change: 'unifdef -m -UINTR_FILTER'. Reviewed by: mmacy Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D15546 Notes: svn path=/head/; revision=334170
2018-03-08asmc: update temperature sensor name/descriptionEd Maste
PR: 225911 Submitted by: Trev <fbsdbugs4 at sentry.org> MFC after: 1 week Notes: svn path=/head/; revision=330667
2017-11-27sys/dev: further adoption of SPDX licensing ID tags.Pedro F. Giffuni
Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326255
2017-02-17[asmc] Add support for MacBook Pro 11,2Adrian Chadd
This patch will add support for MacBookPro 11.2. For the macros, the MBP11_* macros (for the existing MacBookPro11.3) did not match so they have been renamed to MBP113_* and a new MBP112_* has been added (modified copy of MBP11_*). Some trailing whitespaces may have been removed automatically. PR: kern/214836 Obtained from: Johannes Lundberg <johannes@brilliantservice.co.jp Notes: svn path=/head/; revision=313880
2016-05-03[asmc] Add support for MacBookPro5,1Adrian Chadd
Tested by: Johannes Lundberg <johannes@brilliantservice.co.jp> PR: kern/209179 Submitted by: Thomas Brierley <tomxor@gmail.com> Notes: svn path=/head/; revision=298990
2016-05-03sys/dev: minor spelling fixes.Pedro F. Giffuni
Most affect comments, very few have user-visible effects. Notes: svn path=/head/; revision=298955
2016-05-02[asmc] add support for more models and restore keyboard backlight after resume.Adrian Chadd
This patch adds support for restoring backlight after resume and adds models Macbook3,1 MacbookAir5,1 MacbookAir5,2 It also incorporates fixes for bug #175260, bug #203610 and bug #203512 so those can be closed if this patch is applied. PR: kern/209156 PR: kern/175260 PR: kern/203610 PR: kern/203512 Submitted by: Johannes Lundberg <johannes@brilliantservice.co.jp> Notes: svn path=/head/; revision=298937
2016-01-05Fix undefined behavior when using asmc_fan_getstring()Ulrich Spörlein
It was returning a pointer to stack-allocated memory, so make the allocation at the caller instead. Found by: clang static analyzer Coverity: CID 1245774 Reviewed by: ed, rpaulo Review URL: https://reviews.freebsd.org/D4740 Notes: svn path=/head/; revision=293193
2014-10-28The SYSCTL data pointers can come from userspace and must not beHans Petter Selasky
directly accessed. Although this will work on some platforms, it can throw an exception if the pointer is invalid and then panic the kernel. Add a missing SYSCTL_IN() of "SCTP_BASE_STATS" structure. MFC after: 3 days Sponsored by: Mellanox Technologies Notes: svn path=/head/; revision=273773
2014-10-16Follow up to r225617. In order to maximize the re-usability of kernel codeDavide Italiano
in userland rename in-kernel getenv()/setenv() to kern_setenv()/kern_getenv(). This fixes a namespace collision with libc symbols. Submitted by: kmacy Tested by: make universe Notes: svn path=/head/; revision=273174
2014-09-22Improvements to asmc(4):Rui Paulo
1. changed the code so that 2**16 keys are supported 2. changed the number of possible fans in a system from 2 to 6 3. added write support for some fan sysctls 4. added a new sysctl which shows the ID of the fan 5. added four more apple models with their temperature keys 6. changed the maxnumber of temperature keys from 36 to 80 7. replaced several fixed buf sizes to sizeof buf Obtained from: Denis Ahrens denis at h3q.com MFC after: 4 weeks Notes: svn path=/head/; revision=271975
2014-07-05Add support to asmc(4) for Macmini 3,1.Gavin Atkinson
PR: 190195 Submitted by: fbsdbugs2 sentry.org MFC after: 1 week Relnotes: yes Notes: svn path=/head/; revision=268303
2012-11-09Give device_printf format string to pacify clang warning.Roman Divacky
Notes: svn path=/head/; revision=242826
2012-10-22This isn't functionally identical. In some cases a hint to disableEitan Adler
unit 0 would in fact disable all units. This reverts r241856 Approved by: cperciva (implicit) Notes: svn path=/head/; revision=241885
2012-10-22Now that device disabling is generic, remove extraneous code from theEitan Adler
device drivers that used to provide this feature. Reviewed by: des Approved by: cperciva MFC after: 1 week Notes: svn path=/head/; revision=241856