blob: 2bd4e82e5d9ff2085f78f44c6a9351a61a2512e5 [file] [log] [blame]
Mattia Dongiliab5bd202007-02-08 20:16:41 +01001Sony Notebook Control Driver (SNC) Readme
2-----------------------------------------
3 Copyright (C) 2004- 2005 Stelian Pop <stelian@popies.net>
4 Copyright (C) 2007 Mattia Dongili <malattia@linux.it>
5
malattia@linux.it3d2b8a92007-04-09 19:31:16 +02006This mini-driver drives the SNC and SPIC device present in the ACPI BIOS of the
7Sony Vaio laptops. This driver mixes both devices functions under the same
8(hopefully consistent) interface. This also means that the sonypi driver is
9obsoleted by sony-laptop now.
Mattia Dongiliab5bd202007-02-08 20:16:41 +010010
malattia@linux.it3d2b8a92007-04-09 19:31:16 +020011Fn keys (hotkeys):
12------------------
13Some models report hotkeys through the SNC or SPIC devices, such events are
14reported both through the ACPI subsystem as acpi events and through the INPUT
15subsystem. See the logs of acpid or /proc/acpi/event and
16/proc/bus/input/devices to find out what those events are and which input
Mattia Dongili54286fd2011-02-19 11:52:26 +090017devices are created by the driver. Additionally, loading the driver with the
18debug option will report all events in the kernel log.
Mattia Dongiliab5bd202007-02-08 20:16:41 +010019
20Backlight control:
21------------------
22If your laptop model supports it, you will find sysfs files in the
23/sys/class/backlight/sony/
24directory. You will be able to query and set the current screen
25brightness:
Matt LaPlante19f59462009-04-27 15:06:31 +020026 brightness get/set screen brightness (an integer
Mattia Dongiliab5bd202007-02-08 20:16:41 +010027 between 0 and 7)
28 actual_brightness reading from this file will query the HW
29 to get real brightness value
30 max_brightness the maximum brightness value
31
32
33Platform specific:
34------------------
35Loading the sony-laptop module will create a
36/sys/devices/platform/sony-laptop/
37directory populated with some files.
38
39You then read/write integer values from/to those files by using
40standard UNIX tools.
41
42The files are:
43 brightness_default screen brightness which will be set
44 when the laptop will be rebooted
45 cdpower power on/off the internal CD drive
46 audiopower power on/off the internal sound card
47 lanpower power on/off the internal ethernet card
48 (only in debug mode)
malattia@linux.it3d2b8a92007-04-09 19:31:16 +020049 bluetoothpower power on/off the internal bluetooth device
50 fanspeed get/set the fan speed
Mattia Dongiliab5bd202007-02-08 20:16:41 +010051
52Note that some files may be missing if they are not supported
53by your particular laptop model.
54
55Example usage:
56 # echo "1" > /sys/devices/platform/sony-laptop/brightness_default
57sets the lowest screen brightness for the next and later reboots,
58 # echo "8" > /sys/devices/platform/sony-laptop/brightness_default
59sets the highest screen brightness for the next and later reboots,
60 # cat /sys/devices/platform/sony-laptop/brightness_default
61retrieves the value.
62
63 # echo "0" > /sys/devices/platform/sony-laptop/audiopower
64powers off the sound card,
65 # echo "1" > /sys/devices/platform/sony-laptop/audiopower
66powers on the sound card.
67
Mattia Dongili54286fd2011-02-19 11:52:26 +090068
69RFkill control:
70---------------
71More recent Vaio models expose a consistent set of ACPI methods to
72control radio frequency emitting devices. If you are a lucky owner of
73such a laptop you will find the necessary rfkill devices under
74/sys/class/rfkill. Check those starting with sony-* in
75 # grep . /sys/class/rfkill/*/{state,name}
76
77
Mattia Dongiliab5bd202007-02-08 20:16:41 +010078Development:
79------------
80
81If you want to help with the development of this driver (and
82you are not afraid of any side effects doing strange things with
83your ACPI BIOS could have on your laptop), load the driver and
84pass the option 'debug=1'.
85
86REPEAT: DON'T DO THIS IF YOU DON'T LIKE RISKY BUSINESS.
87
88In your kernel logs you will find the list of all ACPI methods
Mattia Dongili54286fd2011-02-19 11:52:26 +090089the SNC device has on your laptop.
90
91* For new models you will see a long list of meaningless method names,
92reading the DSDT table source should reveal that:
93(1) the SNC device uses an internal capability lookup table
94(2) SN00 is used to find values in the lookup table
95(3) SN06 and SN07 are used to call into the real methods based on
96 offsets you can obtain iterating the table using SN00
97(4) SN02 used to enable events.
98Some values in the capability lookup table are more or less known, see
99the code for all sony_call_snc_handle calls, others are more obscure.
100
101* For old models you can see the GCDP/GCDP methods used to pwer on/off
102the CD drive, but there are others and they are usually different from
103model to model.
Mattia Dongiliab5bd202007-02-08 20:16:41 +0100104
105I HAVE NO IDEA WHAT THOSE METHODS DO.
106
107The sony-laptop driver creates, for some of those methods (the most
108current ones found on several Vaio models), an entry under
109/sys/devices/platform/sony-laptop, just like the 'cdpower' one.
110You can create other entries corresponding to your own laptop methods by
malattia@linux.it3d2b8a92007-04-09 19:31:16 +0200111further editing the source (see the 'sony_nc_values' table, and add a new
Mattia Dongiliab5bd202007-02-08 20:16:41 +0100112entry to this table with your get/set method names using the
malattia@linux.it3d2b8a92007-04-09 19:31:16 +0200113SNC_HANDLE_NAMES macro).
Mattia Dongiliab5bd202007-02-08 20:16:41 +0100114
115Your mission, should you accept it, is to try finding out what
116those entries are for, by reading/writing random values from/to those
117files and find out what is the impact on your laptop.
118
119Should you find anything interesting, please report it back to me,
120I will not disavow all knowledge of your actions :)
121
malattia@linux.it3d2b8a92007-04-09 19:31:16 +0200122See also http://www.linux.it/~malattia/wiki/index.php/Sony_drivers for other
123useful info.
124
Mattia Dongiliab5bd202007-02-08 20:16:41 +0100125Bugs/Limitations:
126-----------------
127
128* This driver is not based on official documentation from Sony
129 (because there is none), so there is no guarantee this driver
130 will work at all, or do the right thing. Although this hasn't
131 happened to me, this driver could do very bad things to your
132 laptop, including permanent damage.
133
134* The sony-laptop and sonypi drivers do not interact at all. In the
Mattia Dongili54286fd2011-02-19 11:52:26 +0900135 future, sonypi will be removed and replaced by sony-laptop.
Mattia Dongiliab5bd202007-02-08 20:16:41 +0100136
137* spicctrl, which is the userspace tool used to communicate with the
Mattia Dongili54286fd2011-02-19 11:52:26 +0900138 sonypi driver (through /dev/sonypi) is deprecated as well since all
139 its features are now available under the sysfs tree via sony-laptop.