xref: /freebsd/share/man/man4/asmc.4 (revision 2be1a816b9ff69588e55be0a84cbe2a31efc0f2f)
1.\"-
2.\" Copyright (c) 2007, 2008 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.\" $FreeBSD$
27.\"
28.Dd April 7, 2008
29.Dt ASMC 4
30.Os
31.Sh NAME
32.Nm asmc
33.Nd device driver for the Apple System Management Console (SMC)
34.Sh SYNOPSIS
35To compile this driver into the kernel, place the following line in your
36kernel configuration file:
37.Bd -ragged -offset indent
38.Cd "device asmc"
39.Ed
40.Pp
41Alternatively, to load the driver as a
42module at boot time, place the following line in
43.Xr loader.conf 5 :
44.Bd -literal -offset indent
45asmc_load="YES"
46.Ed
47.Sh DESCRIPTION
48The
49.Nm
50driver controls the Apple System Management Console (SMC for short)
51found on Intel Apple systems.
52.Pp
53The SMC is known to be found on the following systems:
54.Pp
55.Bl -bullet -offset indent -compact
56.It
57MacBook (any generation)
58.It
59MacBook Pro (any generation)
60.It
61Intel MacMini
62.El
63.Pp
64With this driver, you can configure your keyboard backlight
65brightness, check temperatures of several sensors, check the speed of
66the internal fans and check the status of the Sudden Motion Sensor.
67.Pp
68Variables related to the SMC control and inspection are exported via
69.Xr sysctl 3
70under the device tree
71.Va dev.asmc .
72.Sh KEYBOARD BACKLIGHT
73On
74.Tn MacBook Pro
75systems, you can control the keyboard brightness by writing values to
76the
77.Va dev.asmc.%d.light.left
78or
79.Va dev.asmc.%d.light.right
80sysctl MIBs.
81.Pp
82Each of these sysctl MIBs contains the raw value returned by the left
83and right light sensors.
84.Sh TEMPERATURES
85The number of temperature sensors and their description varies among
86systems.
87You can inspect the temperature sensors on your system by traversing
88the
89.Va dev.asmc.temp
90sysctl MIB.
91.Pp
92All values are in degrees celsius.
93.Sh SYSTEM FANS
94The
95.Va dev.asmc.fan.%d
96sysctl tree contains the leaf nodes
97.Va speed ,
98.Va safespeed ,
99.Va minspeed ,
100.Va maxspeed
101and
102.Va targetspeed .
103Each of these leaf nodes represent the current fan speed, the safest
104minimum fan speed, the mininum speed and the maximum speed
105respectively.
106.Pp
107All values are in RPM.
108.Sh SUDDEN MOTION SENSOR
109The Sudden Motion Sensor (SMS for short) is a device that detects
110laptop movement and notifies the operating system via an interrupt.
111The sysctl MIBs present under
112.Va dev.asmc.sms
113all relate to the SMS.
114.Pp
115The most interesting usage of this device is to park the disk heads
116when the laptop is moved harshly.
117First, you need to install
118.Xr ataidle 8 Pq Pa ports/sysutils/ataidle
119and then configure
120.Xr devd 8
121the following way:
122.Bd -literal -offset indent
123notify 0 {
124	match "system"		"ACPI";
125	match "subsystem"	"asmc";
126	action			"/usr/local/sbin/ataidle -s X Y";
127};
128.Ed
129.Pp
130Do not forget to change the
131.Ar X
132and
133.Ar Y
134values in the command above.
135.Pp
136Also, please note that parking the disk heads too many times can
137dramatically reduce your hard drive's life span.
138Do not rely solely on
139the SMS to protect your hard drive: good care and common sense can
140increase your hard drive's life.
141.Sh SEE ALSO
142.Xr ataidle 8 Pq Pa ports/sysutils/ataidle ,
143.Xr devd 8 ,
144.Xr sysctl 8
145.Sh HISTORY
146The
147.Nm
148driver first appeared in
149.Fx 8.0 .
150.Sh AUTHORS
151.An -nosplit
152.An Rui Paulo Aq rpaulo@FreeBSD.org
153(Google Summer of Code project).
154.Sh BUGS
155Support for the latest models was never tested and is most likely not
156fully working.
157