1.\"- 2.\" Copyright (c) 2007, 2008, 2009 Rui Paulo <rpaulo@FreeBSD.org> 3.\" All rights reserved. 4.\" 5.\" Redistribution and use in source and binary forms, with or without 6.\" modification, are permitted provided that the following conditions 7.\" are met: 8.\" 1. Redistributions of source code must retain the above copyright 9.\" notice, this list of conditions and the following disclaimer. 10.\" 2. Redistributions in binary form must reproduce the above copyright 11.\" notice, this list of conditions and the following disclaimer in the 12.\" documentation and/or other materials provided with the distribution. 13.\" 14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 18.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 22.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 23.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24.\" POSSIBILITY OF SUCH DAMAGE. 25.\" 26.Dd April 2, 2019 27.Dt ASMC 4 28.Os 29.Sh NAME 30.Nm asmc 31.Nd device driver for the Apple System Management Controller (SMC) 32.Sh SYNOPSIS 33To compile this driver into the kernel, place the following line in your 34kernel configuration file: 35.Bd -ragged -offset indent 36.Cd "device asmc" 37.Ed 38.Pp 39Alternatively, to load the driver as a 40module at boot time, place the following line in 41.Xr loader.conf 5 : 42.Bd -literal -offset indent 43asmc_load="YES" 44.Ed 45.Sh DESCRIPTION 46The 47.Nm 48driver controls the Apple System Management Controller (SMC for short) 49found on Intel Apple systems. 50.Pp 51The SMC is known to be found on the following systems: 52.Pp 53.Bl -bullet -offset indent -compact 54.It 55MacBook 56.It 57MacBook Pro 58.It 59Intel MacMini 60.It 61Mac Pro 62.It 63MacBook Air 64.It 65Intel iMac 66.El 67.Pp 68With this driver, you can configure your keyboard backlight 69brightness, check temperatures of several sensors, check the speed of 70the internal fans and check the status of the Sudden Motion Sensor. 71.Pp 72Variables related to the SMC control and inspection are exported via 73.Xr sysctl 3 74under the device tree 75.Va dev.asmc . 76.Sh KEYBOARD BACKLIGHT 77On 78.Tn MacBook Pro 79systems, you can control the keyboard brightness by writing a value to 80the 81.Va dev.asmc.%d.light.control 82sysctl MIB. 83.Pp 84The following sysctl MIBs contains the raw value returned by the left 85and right light sensors: 86.Va dev.asmc.%d.light.left 87or 88.Va dev.asmc.%d.light.right . 89.Sh TEMPERATURES 90The number of temperature sensors and their description varies among 91systems. 92You can inspect the temperature sensors on your system by traversing 93the 94.Va dev.asmc.temp 95sysctl MIB. 96.Pp 97All values are in degrees celsius. 98.Sh SYSTEM FANS 99The 100.Va dev.asmc.fan.%d 101sysctl tree contains the leaf nodes 102.Va speed , 103.Va safespeed , 104.Va minspeed , 105.Va maxspeed 106and 107.Va targetspeed . 108Each of these leaf nodes represent the current fan speed, the safest 109minimum fan speed, the minimum speed and the maximum speed 110respectively. 111.Pp 112All values are in RPM. 113.Sh SUDDEN MOTION SENSOR 114The Sudden Motion Sensor (SMS for short) is a device that detects 115laptop movement and notifies the operating system via an interrupt. 116The sysctl MIBs present under 117.Va dev.asmc.sms 118all relate to the SMS. 119.Pp 120The most interesting usage of this device is to park the disk heads 121when the laptop is moved harshly. 122First, you need to install 123.Xr ataidle 8 Pq Pa ports/sysutils/ataidle 124and then configure 125.Xr devd 8 126the following way: 127.Bd -literal -offset indent 128notify 0 { 129 match "system" "ACPI"; 130 match "subsystem" "asmc"; 131 action "/usr/local/sbin/ataidle -s X Y"; 132}; 133.Ed 134.Pp 135Do not forget to change the 136.Ar X 137and 138.Ar Y 139values in the command above. 140.Pp 141Also, please note that parking the disk heads too many times can 142dramatically reduce your hard drive's life span. 143Do not rely solely on 144the SMS to protect your hard drive: good care and common sense can 145increase your hard drive's life. 146.Sh SEE ALSO 147.Xr ataidle 8 Pq Pa ports/sysutils/ataidle , 148.Xr devd 8 , 149.Xr sysctl 8 150.Sh HISTORY 151The 152.Nm 153driver first appeared in 154.Fx 8.0 . 155.Sh AUTHORS 156.An Rui Paulo Aq Mt rpaulo@FreeBSD.org 157(Google Summer of Code project) 158.Sh BUGS 159Support for the latest models was never tested and is most likely not 160fully working. 161