Back to home page

OSCL-LXR

 
 

    


0001 =========================================
0002 Sony Notebook Control Driver (SNC) Readme
0003 =========================================
0004 
0005         - Copyright (C) 2004- 2005 Stelian Pop <stelian@popies.net>
0006         - Copyright (C) 2007 Mattia Dongili <malattia@linux.it>
0007 
0008 This mini-driver drives the SNC and SPIC device present in the ACPI BIOS of the
0009 Sony Vaio laptops. This driver mixes both devices functions under the same
0010 (hopefully consistent) interface. This also means that the sonypi driver is
0011 obsoleted by sony-laptop now.
0012 
0013 Fn keys (hotkeys):
0014 ------------------
0015 
0016 Some models report hotkeys through the SNC or SPIC devices, such events are
0017 reported both through the ACPI subsystem as acpi events and through the INPUT
0018 subsystem. See the logs of /proc/bus/input/devices to find out what those
0019 events are and which input devices are created by the driver.
0020 Additionally, loading the driver with the debug option will report all events
0021 in the kernel log.
0022 
0023 The "scancodes" passed to the input system (that can be remapped with udev)
0024 are indexes to the table "sony_laptop_input_keycode_map" in the sony-laptop.c
0025 module.  For example the "FN/E" key combination (EJECTCD on some models)
0026 generates the scancode 20 (0x14).
0027 
0028 Backlight control:
0029 ------------------
0030 If your laptop model supports it, you will find sysfs files in the
0031 /sys/class/backlight/sony/
0032 directory. You will be able to query and set the current screen
0033 brightness:
0034 
0035         ======================  =========================================
0036         brightness              get/set screen brightness (an integer
0037                                 between 0 and 7)
0038         actual_brightness       reading from this file will query the HW
0039                                 to get real brightness value
0040         max_brightness          the maximum brightness value
0041         ======================  =========================================
0042 
0043 
0044 Platform specific:
0045 ------------------
0046 Loading the sony-laptop module will create a
0047 /sys/devices/platform/sony-laptop/
0048 directory populated with some files.
0049 
0050 You then read/write integer values from/to those files by using
0051 standard UNIX tools.
0052 
0053 The files are:
0054 
0055         ======================  ==========================================
0056         brightness_default      screen brightness which will be set
0057                                 when the laptop will be rebooted
0058         cdpower                 power on/off the internal CD drive
0059         audiopower              power on/off the internal sound card
0060         lanpower                power on/off the internal ethernet card
0061                                 (only in debug mode)
0062         bluetoothpower          power on/off the internal bluetooth device
0063         fanspeed                get/set the fan speed
0064         ======================  ==========================================
0065 
0066 Note that some files may be missing if they are not supported
0067 by your particular laptop model.
0068 
0069 Example usage::
0070 
0071         # echo "1" > /sys/devices/platform/sony-laptop/brightness_default
0072 
0073 sets the lowest screen brightness for the next and later reboots
0074 
0075 ::
0076 
0077         # echo "8" > /sys/devices/platform/sony-laptop/brightness_default
0078 
0079 sets the highest screen brightness for the next and later reboots
0080 
0081 ::
0082 
0083         # cat /sys/devices/platform/sony-laptop/brightness_default
0084 
0085 retrieves the value
0086 
0087 ::
0088 
0089         # echo "0" > /sys/devices/platform/sony-laptop/audiopower
0090 
0091 powers off the sound card
0092 
0093 ::
0094 
0095         # echo "1" > /sys/devices/platform/sony-laptop/audiopower
0096 
0097 powers on the sound card.
0098 
0099 
0100 RFkill control:
0101 ---------------
0102 More recent Vaio models expose a consistent set of ACPI methods to
0103 control radio frequency emitting devices. If you are a lucky owner of
0104 such a laptop you will find the necessary rfkill devices under
0105 /sys/class/rfkill. Check those starting with sony-* in::
0106 
0107         # grep . /sys/class/rfkill/*/{state,name}
0108 
0109 
0110 Development:
0111 ------------
0112 
0113 If you want to help with the development of this driver (and
0114 you are not afraid of any side effects doing strange things with
0115 your ACPI BIOS could have on your laptop), load the driver and
0116 pass the option 'debug=1'.
0117 
0118 REPEAT:
0119         **DON'T DO THIS IF YOU DON'T LIKE RISKY BUSINESS.**
0120 
0121 In your kernel logs you will find the list of all ACPI methods
0122 the SNC device has on your laptop.
0123 
0124 * For new models you will see a long list of meaningless method names,
0125   reading the DSDT table source should reveal that:
0126 
0127 (1) the SNC device uses an internal capability lookup table
0128 (2) SN00 is used to find values in the lookup table
0129 (3) SN06 and SN07 are used to call into the real methods based on
0130     offsets you can obtain iterating the table using SN00
0131 (4) SN02 used to enable events.
0132 
0133 Some values in the capability lookup table are more or less known, see
0134 the code for all sony_call_snc_handle calls, others are more obscure.
0135 
0136 * For old models you can see the GCDP/GCDP methods used to pwer on/off
0137   the CD drive, but there are others and they are usually different from
0138   model to model.
0139 
0140 **I HAVE NO IDEA WHAT THOSE METHODS DO.**
0141 
0142 The sony-laptop driver creates, for some of those methods (the most
0143 current ones found on several Vaio models), an entry under
0144 /sys/devices/platform/sony-laptop, just like the 'cdpower' one.
0145 You can create other entries corresponding to your own laptop methods by
0146 further editing the source (see the 'sony_nc_values' table, and add a new
0147 entry to this table with your get/set method names using the
0148 SNC_HANDLE_NAMES macro).
0149 
0150 Your mission, should you accept it, is to try finding out what
0151 those entries are for, by reading/writing random values from/to those
0152 files and find out what is the impact on your laptop.
0153 
0154 Should you find anything interesting, please report it back to me,
0155 I will not disavow all knowledge of your actions :)
0156 
0157 See also http://www.linux.it/~malattia/wiki/index.php/Sony_drivers for other
0158 useful info.
0159 
0160 Bugs/Limitations:
0161 -----------------
0162 
0163 * This driver is not based on official documentation from Sony
0164   (because there is none), so there is no guarantee this driver
0165   will work at all, or do the right thing. Although this hasn't
0166   happened to me, this driver could do very bad things to your
0167   laptop, including permanent damage.
0168 
0169 * The sony-laptop and sonypi drivers do not interact at all. In the
0170   future, sonypi will be removed and replaced by sony-laptop.
0171 
0172 * spicctrl, which is the userspace tool used to communicate with the
0173   sonypi driver (through /dev/sonypi) is deprecated as well since all
0174   its features are now available under the sysfs tree via sony-laptop.