sony-laptop.txt 5.4 KB

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