xref: /OK3568_Linux_fs/kernel/Documentation/admin-guide/laptops/sonypi.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun==================================================
2*4882a593SmuzhiyunSony Programmable I/O Control Device Driver Readme
3*4882a593Smuzhiyun==================================================
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun	- Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net>
6*4882a593Smuzhiyun	- Copyright (C) 2001-2002 Alcôve <www.alcove.com>
7*4882a593Smuzhiyun	- Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au>
8*4882a593Smuzhiyun	- Copyright (C) 2001 Junichi Morita <jun1m@mars.dti.ne.jp>
9*4882a593Smuzhiyun	- Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp>
10*4882a593Smuzhiyun	- Copyright (C) 2000 Andrew Tridgell <tridge@samba.org>
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunThis driver enables access to the Sony Programmable I/O Control Device which
13*4882a593Smuzhiyuncan be found in many Sony Vaio laptops. Some newer Sony laptops (seems to be
14*4882a593Smuzhiyunlimited to new FX series laptops, at least the FX501 and the FX702) lack a
15*4882a593Smuzhiyunsonypi device and are not supported at all by this driver.
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunIt will give access (through a user space utility) to some events those laptops
18*4882a593Smuzhiyungenerate, like:
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun	- jogdial events (the small wheel on the side of Vaios)
21*4882a593Smuzhiyun	- capture button events (only on Vaio Picturebook series)
22*4882a593Smuzhiyun	- Fn keys
23*4882a593Smuzhiyun	- bluetooth button (only on C1VR model)
24*4882a593Smuzhiyun	- programmable keys, back, help, zoom, thumbphrase buttons, etc.
25*4882a593Smuzhiyun	  (when available)
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunThose events (see linux/sonypi.h) can be polled using the character device node
28*4882a593Smuzhiyun/dev/sonypi (major 10, minor auto allocated or specified as a option).
29*4882a593SmuzhiyunA simple daemon which translates the jogdial movements into mouse wheel events
30*4882a593Smuzhiyuncan be downloaded at: <http://popies.net/sonypi/>
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunAnother option to intercept the events is to get them directly through the
33*4882a593Smuzhiyuninput layer.
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunThis driver supports also some ioctl commands for setting the LCD screen
36*4882a593Smuzhiyunbrightness and querying the batteries charge information (some more
37*4882a593Smuzhiyuncommands may be added in the future).
38*4882a593Smuzhiyun
39*4882a593SmuzhiyunThis driver can also be used to set the camera controls on Picturebook series
40*4882a593Smuzhiyun(brightness, contrast etc), and is used by the video4linux driver for the
41*4882a593SmuzhiyunMotion Eye camera.
42*4882a593Smuzhiyun
43*4882a593SmuzhiyunPlease note that this driver was created by reverse engineering the Windows
44*4882a593Smuzhiyundriver and the ACPI BIOS, because Sony doesn't agree to release any programming
45*4882a593Smuzhiyunspecs for its laptops. If someone convinces them to do so, drop me a note.
46*4882a593Smuzhiyun
47*4882a593SmuzhiyunDriver options:
48*4882a593Smuzhiyun---------------
49*4882a593Smuzhiyun
50*4882a593SmuzhiyunSeveral options can be passed to the sonypi driver using the standard
51*4882a593Smuzhiyunmodule argument syntax (<param>=<value> when passing the option to the
52*4882a593Smuzhiyunmodule or sonypi.<param>=<value> on the kernel boot line when sonypi is
53*4882a593Smuzhiyunstatically linked into the kernel). Those options are:
54*4882a593Smuzhiyun
55*4882a593Smuzhiyun	=============== =======================================================
56*4882a593Smuzhiyun	minor:		minor number of the misc device /dev/sonypi,
57*4882a593Smuzhiyun			default is -1 (automatic allocation, see /proc/misc
58*4882a593Smuzhiyun			or kernel logs)
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun	camera:		if you have a PictureBook series Vaio (with the
61*4882a593Smuzhiyun			integrated MotionEye camera), set this parameter to 1
62*4882a593Smuzhiyun			in order to let the driver access to the camera
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun	fnkeyinit:	on some Vaios (C1VE, C1VR etc), the Fn key events don't
65*4882a593Smuzhiyun			get enabled unless you set this parameter to 1.
66*4882a593Smuzhiyun			Do not use this option unless it's actually necessary,
67*4882a593Smuzhiyun			some Vaio models don't deal well with this option.
68*4882a593Smuzhiyun			This option is available only if the kernel is
69*4882a593Smuzhiyun			compiled without ACPI support (since it conflicts
70*4882a593Smuzhiyun			with it and it shouldn't be required anyway if
71*4882a593Smuzhiyun			ACPI is already enabled).
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun	verbose:	set to 1 to print unknown events received from the
74*4882a593Smuzhiyun			sonypi device.
75*4882a593Smuzhiyun			set to 2 to print all events received from the
76*4882a593Smuzhiyun			sonypi device.
77*4882a593Smuzhiyun
78*4882a593Smuzhiyun	compat:		uses some compatibility code for enabling the sonypi
79*4882a593Smuzhiyun			events. If the driver worked for you in the past
80*4882a593Smuzhiyun			(prior to version 1.5) and does not work anymore,
81*4882a593Smuzhiyun			add this option and report to the author.
82*4882a593Smuzhiyun
83*4882a593Smuzhiyun	mask:		event mask telling the driver what events will be
84*4882a593Smuzhiyun			reported to the user. This parameter is required for
85*4882a593Smuzhiyun			some Vaio models where the hardware reuses values
86*4882a593Smuzhiyun			used in other Vaio models (like the FX series who does
87*4882a593Smuzhiyun			not have a jogdial but reuses the jogdial events for
88*4882a593Smuzhiyun			programmable keys events). The default event mask is
89*4882a593Smuzhiyun			set to 0xffffffff, meaning that all possible events
90*4882a593Smuzhiyun			will be tried. You can use the following bits to
91*4882a593Smuzhiyun			construct your own event mask (from
92*4882a593Smuzhiyun			drivers/char/sonypi.h)::
93*4882a593Smuzhiyun
94*4882a593Smuzhiyun				SONYPI_JOGGER_MASK		0x0001
95*4882a593Smuzhiyun				SONYPI_CAPTURE_MASK		0x0002
96*4882a593Smuzhiyun				SONYPI_FNKEY_MASK		0x0004
97*4882a593Smuzhiyun				SONYPI_BLUETOOTH_MASK		0x0008
98*4882a593Smuzhiyun				SONYPI_PKEY_MASK		0x0010
99*4882a593Smuzhiyun				SONYPI_BACK_MASK		0x0020
100*4882a593Smuzhiyun				SONYPI_HELP_MASK		0x0040
101*4882a593Smuzhiyun				SONYPI_LID_MASK			0x0080
102*4882a593Smuzhiyun				SONYPI_ZOOM_MASK		0x0100
103*4882a593Smuzhiyun				SONYPI_THUMBPHRASE_MASK		0x0200
104*4882a593Smuzhiyun				SONYPI_MEYE_MASK		0x0400
105*4882a593Smuzhiyun				SONYPI_MEMORYSTICK_MASK		0x0800
106*4882a593Smuzhiyun				SONYPI_BATTERY_MASK		0x1000
107*4882a593Smuzhiyun				SONYPI_WIRELESS_MASK		0x2000
108*4882a593Smuzhiyun
109*4882a593Smuzhiyun	useinput:	if set (which is the default) two input devices are
110*4882a593Smuzhiyun			created, one which interprets the jogdial events as
111*4882a593Smuzhiyun			mouse events, the other one which acts like a
112*4882a593Smuzhiyun			keyboard reporting the pressing of the special keys.
113*4882a593Smuzhiyun	=============== =======================================================
114*4882a593Smuzhiyun
115*4882a593SmuzhiyunModule use:
116*4882a593Smuzhiyun-----------
117*4882a593Smuzhiyun
118*4882a593SmuzhiyunIn order to automatically load the sonypi module on use, you can put those
119*4882a593Smuzhiyunlines a configuration file in /etc/modprobe.d/::
120*4882a593Smuzhiyun
121*4882a593Smuzhiyun	alias char-major-10-250 sonypi
122*4882a593Smuzhiyun	options sonypi minor=250
123*4882a593Smuzhiyun
124*4882a593SmuzhiyunThis supposes the use of minor 250 for the sonypi device::
125*4882a593Smuzhiyun
126*4882a593Smuzhiyun	# mknod /dev/sonypi c 10 250
127*4882a593Smuzhiyun
128*4882a593SmuzhiyunBugs:
129*4882a593Smuzhiyun-----
130*4882a593Smuzhiyun
131*4882a593Smuzhiyun	- several users reported that this driver disables the BIOS-managed
132*4882a593Smuzhiyun	  Fn-keys which put the laptop in sleeping state, or switch the
133*4882a593Smuzhiyun	  external monitor on/off. There is no workaround yet, since this
134*4882a593Smuzhiyun	  driver disables all APM management for those keys, by enabling the
135*4882a593Smuzhiyun	  ACPI management (and the ACPI core stuff is not complete yet). If
136*4882a593Smuzhiyun	  you have one of those laptops with working Fn keys and want to
137*4882a593Smuzhiyun	  continue to use them, don't use this driver.
138*4882a593Smuzhiyun
139*4882a593Smuzhiyun	- some users reported that the laptop speed is lower (dhrystone
140*4882a593Smuzhiyun	  tested) when using the driver with the fnkeyinit parameter. I cannot
141*4882a593Smuzhiyun	  reproduce it on my laptop and not all users have this problem.
142*4882a593Smuzhiyun	  This happens because the fnkeyinit parameter enables the ACPI
143*4882a593Smuzhiyun	  mode (but without additional ACPI control, like processor
144*4882a593Smuzhiyun	  speed handling etc). Use ACPI instead of APM if it works on your
145*4882a593Smuzhiyun	  laptop.
146*4882a593Smuzhiyun
147*4882a593Smuzhiyun	- sonypi lacks the ability to distinguish between certain key
148*4882a593Smuzhiyun	  events on some models.
149*4882a593Smuzhiyun
150*4882a593Smuzhiyun	- some models with the nvidia card (geforce go 6200 tc) uses a
151*4882a593Smuzhiyun	  different way to adjust the backlighting of the screen. There
152*4882a593Smuzhiyun	  is a userspace utility to adjust the brightness on those models,
153*4882a593Smuzhiyun	  which can be downloaded from
154*4882a593Smuzhiyun	  https://www.acc.umu.se/~erikw/program/smartdimmer-0.1.tar.bz2
155*4882a593Smuzhiyun
156*4882a593Smuzhiyun	- since all development was done by reverse engineering, there is
157*4882a593Smuzhiyun	  *absolutely no guarantee* that this driver will not crash your
158*4882a593Smuzhiyun	  laptop. Permanently.
159