sony-laptop.txt 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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.
  16. Backlight control:
  17. ------------------
  18. If your laptop model supports it, you will find sysfs files in the
  19. /sys/class/backlight/sony/
  20. directory. You will be able to query and set the current screen
  21. brightness:
  22. brightness get/set screen brightness (an iteger
  23. between 0 and 7)
  24. actual_brightness reading from this file will query the HW
  25. to get real brightness value
  26. max_brightness the maximum brightness value
  27. Platform specific:
  28. ------------------
  29. Loading the sony-laptop module will create a
  30. /sys/devices/platform/sony-laptop/
  31. directory populated with some files.
  32. You then read/write integer values from/to those files by using
  33. standard UNIX tools.
  34. The files are:
  35. brightness_default screen brightness which will be set
  36. when the laptop will be rebooted
  37. cdpower power on/off the internal CD drive
  38. audiopower power on/off the internal sound card
  39. lanpower power on/off the internal ethernet card
  40. (only in debug mode)
  41. bluetoothpower power on/off the internal bluetooth device
  42. fanspeed get/set the fan speed
  43. Note that some files may be missing if they are not supported
  44. by your particular laptop model.
  45. Example usage:
  46. # echo "1" > /sys/devices/platform/sony-laptop/brightness_default
  47. sets the lowest screen brightness for the next and later reboots,
  48. # echo "8" > /sys/devices/platform/sony-laptop/brightness_default
  49. sets the highest screen brightness for the next and later reboots,
  50. # cat /sys/devices/platform/sony-laptop/brightness_default
  51. retrieves the value.
  52. # echo "0" > /sys/devices/platform/sony-laptop/audiopower
  53. powers off the sound card,
  54. # echo "1" > /sys/devices/platform/sony-laptop/audiopower
  55. powers on the sound card.
  56. Development:
  57. ------------
  58. If you want to help with the development of this driver (and
  59. you are not afraid of any side effects doing strange things with
  60. your ACPI BIOS could have on your laptop), load the driver and
  61. pass the option 'debug=1'.
  62. REPEAT: DON'T DO THIS IF YOU DON'T LIKE RISKY BUSINESS.
  63. In your kernel logs you will find the list of all ACPI methods
  64. the SNC device has on your laptop. You can see the GCDP/GCDP methods
  65. used to pwer on/off the CD drive, but there are others.
  66. I HAVE NO IDEA WHAT THOSE METHODS DO.
  67. The sony-laptop driver creates, for some of those methods (the most
  68. current ones found on several Vaio models), an entry under
  69. /sys/devices/platform/sony-laptop, just like the 'cdpower' one.
  70. You can create other entries corresponding to your own laptop methods by
  71. further editing the source (see the 'sony_nc_values' table, and add a new
  72. entry to this table with your get/set method names using the
  73. SNC_HANDLE_NAMES macro).
  74. Your mission, should you accept it, is to try finding out what
  75. those entries are for, by reading/writing random values from/to those
  76. files and find out what is the impact on your laptop.
  77. Should you find anything interesting, please report it back to me,
  78. I will not disavow all knowledge of your actions :)
  79. See also http://www.linux.it/~malattia/wiki/index.php/Sony_drivers for other
  80. useful info.
  81. Bugs/Limitations:
  82. -----------------
  83. * This driver is not based on official documentation from Sony
  84. (because there is none), so there is no guarantee this driver
  85. will work at all, or do the right thing. Although this hasn't
  86. happened to me, this driver could do very bad things to your
  87. laptop, including permanent damage.
  88. * The sony-laptop and sonypi drivers do not interact at all. In the
  89. future, sonypi could use sony-laptop to do (part of) its business.
  90. * spicctrl, which is the userspace tool used to communicate with the
  91. sonypi driver (through /dev/sonypi) does not try to use the
  92. sony-laptop driver. In the future, spicctrl could try sonypi first,
  93. and if it isn't present, try sony-laptop instead.