xref: /freebsd-src/share/man/man4/asmc.4 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
175a1ecdaSRui Paulo.\"-
21126d66dSRui Paulo.\" Copyright (c) 2007, 2008, 2009 Rui Paulo <rpaulo@FreeBSD.org>
375a1ecdaSRui Paulo.\" All rights reserved.
475a1ecdaSRui Paulo.\"
575a1ecdaSRui Paulo.\" Redistribution and use in source and binary forms, with or without
675a1ecdaSRui Paulo.\" modification, are permitted provided that the following conditions
775a1ecdaSRui Paulo.\" are met:
875a1ecdaSRui Paulo.\" 1. Redistributions of source code must retain the above copyright
975a1ecdaSRui Paulo.\"    notice, this list of conditions and the following disclaimer.
1075a1ecdaSRui Paulo.\" 2. Redistributions in binary form must reproduce the above copyright
1175a1ecdaSRui Paulo.\"    notice, this list of conditions and the following disclaimer in the
1275a1ecdaSRui Paulo.\"    documentation and/or other materials provided with the distribution.
1375a1ecdaSRui Paulo.\"
1475a1ecdaSRui Paulo.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1575a1ecdaSRui Paulo.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1675a1ecdaSRui Paulo.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
1775a1ecdaSRui Paulo.\" DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
1875a1ecdaSRui Paulo.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
1975a1ecdaSRui Paulo.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2075a1ecdaSRui Paulo.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2175a1ecdaSRui Paulo.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
2275a1ecdaSRui Paulo.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
2375a1ecdaSRui Paulo.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2475a1ecdaSRui Paulo.\" POSSIBILITY OF SUCH DAMAGE.
2575a1ecdaSRui Paulo.\"
26*4224e9d3SGuangyuan Yang.Dd April 2, 2019
2775a1ecdaSRui Paulo.Dt ASMC 4
2875a1ecdaSRui Paulo.Os
2975a1ecdaSRui Paulo.Sh NAME
3075a1ecdaSRui Paulo.Nm asmc
31*4224e9d3SGuangyuan Yang.Nd device driver for the Apple System Management Controller (SMC)
3275a1ecdaSRui Paulo.Sh SYNOPSIS
3375a1ecdaSRui PauloTo compile this driver into the kernel, place the following line in your
3475a1ecdaSRui Paulokernel configuration file:
3575a1ecdaSRui Paulo.Bd -ragged -offset indent
3675a1ecdaSRui Paulo.Cd "device asmc"
3775a1ecdaSRui Paulo.Ed
3875a1ecdaSRui Paulo.Pp
3975a1ecdaSRui PauloAlternatively, to load the driver as a
4075a1ecdaSRui Paulomodule at boot time, place the following line in
4175a1ecdaSRui Paulo.Xr loader.conf 5 :
4275a1ecdaSRui Paulo.Bd -literal -offset indent
4375a1ecdaSRui Pauloasmc_load="YES"
4475a1ecdaSRui Paulo.Ed
4575a1ecdaSRui Paulo.Sh DESCRIPTION
4675a1ecdaSRui PauloThe
4775a1ecdaSRui Paulo.Nm
48*4224e9d3SGuangyuan Yangdriver controls the Apple System Management Controller (SMC for short)
4975a1ecdaSRui Paulofound on Intel Apple systems.
5075a1ecdaSRui Paulo.Pp
5175a1ecdaSRui PauloThe SMC is known to be found on the following systems:
5275a1ecdaSRui Paulo.Pp
5375a1ecdaSRui Paulo.Bl -bullet -offset indent -compact
5475a1ecdaSRui Paulo.It
551126d66dSRui PauloMacBook
5675a1ecdaSRui Paulo.It
571126d66dSRui PauloMacBook Pro
5875a1ecdaSRui Paulo.It
5975a1ecdaSRui PauloIntel MacMini
601126d66dSRui Paulo.It
611126d66dSRui PauloMac Pro
621126d66dSRui Paulo.It
631126d66dSRui PauloMacBook Air
641126d66dSRui Paulo.It
651126d66dSRui PauloIntel iMac
6675a1ecdaSRui Paulo.El
6775a1ecdaSRui Paulo.Pp
6875a1ecdaSRui PauloWith this driver, you can configure your keyboard backlight
69d518b2baSChristian Bruefferbrightness, check temperatures of several sensors, check the speed of
7075a1ecdaSRui Paulothe internal fans and check the status of the Sudden Motion Sensor.
7175a1ecdaSRui Paulo.Pp
72d518b2baSChristian BruefferVariables related to the SMC control and inspection are exported via
73fad4456bSRuslan Ermilov.Xr sysctl 3
7475a1ecdaSRui Paulounder the device tree
7575a1ecdaSRui Paulo.Va dev.asmc .
7675a1ecdaSRui Paulo.Sh KEYBOARD BACKLIGHT
7775a1ecdaSRui PauloOn
78fad4456bSRuslan Ermilov.Tn MacBook Pro
791126d66dSRui Paulosystems, you can control the keyboard brightness by writing a value to
8075a1ecdaSRui Paulothe
811126d66dSRui Paulo.Va dev.asmc.%d.light.control
821126d66dSRui Paulosysctl MIB.
831126d66dSRui Paulo.Pp
841126d66dSRui PauloThe following sysctl MIBs contains the raw value returned by the left
851126d66dSRui Pauloand right light sensors:
8675a1ecdaSRui Paulo.Va dev.asmc.%d.light.left
8775a1ecdaSRui Pauloor
881126d66dSRui Paulo.Va dev.asmc.%d.light.right .
8975a1ecdaSRui Paulo.Sh TEMPERATURES
9075a1ecdaSRui PauloThe number of temperature sensors and their description varies among
9175a1ecdaSRui Paulosystems.
9275a1ecdaSRui PauloYou can inspect the temperature sensors on your system by traversing
93d518b2baSChristian Bruefferthe
9475a1ecdaSRui Paulo.Va dev.asmc.temp
95d518b2baSChristian Brueffersysctl MIB.
9675a1ecdaSRui Paulo.Pp
9775a1ecdaSRui PauloAll values are in degrees celsius.
9875a1ecdaSRui Paulo.Sh SYSTEM FANS
9975a1ecdaSRui PauloThe
10075a1ecdaSRui Paulo.Va dev.asmc.fan.%d
10175a1ecdaSRui Paulosysctl tree contains the leaf nodes
10275a1ecdaSRui Paulo.Va speed ,
10375a1ecdaSRui Paulo.Va safespeed ,
10475a1ecdaSRui Paulo.Va minspeed ,
10575a1ecdaSRui Paulo.Va maxspeed
10675a1ecdaSRui Pauloand
10775a1ecdaSRui Paulo.Va targetspeed .
10875a1ecdaSRui PauloEach of these leaf nodes represent the current fan speed, the safest
109b06cfd40SJoel Dahlminimum fan speed, the minimum speed and the maximum speed
11075a1ecdaSRui Paulorespectively.
11175a1ecdaSRui Paulo.Pp
11275a1ecdaSRui PauloAll values are in RPM.
11375a1ecdaSRui Paulo.Sh SUDDEN MOTION SENSOR
11475a1ecdaSRui PauloThe Sudden Motion Sensor (SMS for short) is a device that detects
11575a1ecdaSRui Paulolaptop movement and notifies the operating system via an interrupt.
11675a1ecdaSRui PauloThe sysctl MIBs present under
11775a1ecdaSRui Paulo.Va dev.asmc.sms
11875a1ecdaSRui Pauloall relate to the SMS.
11975a1ecdaSRui Paulo.Pp
12075a1ecdaSRui PauloThe most interesting usage of this device is to park the disk heads
121d518b2baSChristian Bruefferwhen the laptop is moved harshly.
122d518b2baSChristian BruefferFirst, you need to install
123fad4456bSRuslan Ermilov.Xr ataidle 8 Pq Pa ports/sysutils/ataidle
12475a1ecdaSRui Pauloand then configure
12575a1ecdaSRui Paulo.Xr devd 8
12675a1ecdaSRui Paulothe following way:
12775a1ecdaSRui Paulo.Bd -literal -offset indent
12875a1ecdaSRui Paulonotify 0 {
129b0195910SRui Paulo	match "system"		"ACPI";
13075a1ecdaSRui Paulo	match "subsystem"	"asmc";
13175a1ecdaSRui Paulo	action			"/usr/local/sbin/ataidle -s X Y";
13275a1ecdaSRui Paulo};
13375a1ecdaSRui Paulo.Ed
13475a1ecdaSRui Paulo.Pp
135d518b2baSChristian BruefferDo not forget to change the
136fad4456bSRuslan Ermilov.Ar X
13775a1ecdaSRui Pauloand
138fad4456bSRuslan Ermilov.Ar Y
13975a1ecdaSRui Paulovalues in the command above.
14075a1ecdaSRui Paulo.Pp
14175a1ecdaSRui PauloAlso, please note that parking the disk heads too many times can
142d518b2baSChristian Bruefferdramatically reduce your hard drive's life span.
143d518b2baSChristian BruefferDo not rely solely on
14475a1ecdaSRui Paulothe SMS to protect your hard drive: good care and common sense can
14575a1ecdaSRui Pauloincrease your hard drive's life.
14675a1ecdaSRui Paulo.Sh SEE ALSO
147fad4456bSRuslan Ermilov.Xr ataidle 8 Pq Pa ports/sysutils/ataidle ,
14875a1ecdaSRui Paulo.Xr devd 8 ,
14975a1ecdaSRui Paulo.Xr sysctl 8
15075a1ecdaSRui Paulo.Sh HISTORY
15175a1ecdaSRui PauloThe
15275a1ecdaSRui Paulo.Nm
15375a1ecdaSRui Paulodriver first appeared in
15475a1ecdaSRui Paulo.Fx 8.0 .
15575a1ecdaSRui Paulo.Sh AUTHORS
1566c899950SBaptiste Daroussin.An Rui Paulo Aq Mt rpaulo@FreeBSD.org
1576c899950SBaptiste Daroussin(Google Summer of Code project)
158fad4456bSRuslan Ermilov.Sh BUGS
159fad4456bSRuslan ErmilovSupport for the latest models was never tested and is most likely not
160fad4456bSRuslan Ermilovfully working.
161