xref: /openbmc/linux/Documentation/admin-guide/laptops/sonypi.rst (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
19e1cbedeSMauro Carvalho Chehab==================================================
29e1cbedeSMauro Carvalho ChehabSony Programmable I/O Control Device Driver Readme
39e1cbedeSMauro Carvalho Chehab==================================================
49e1cbedeSMauro Carvalho Chehab
59e1cbedeSMauro Carvalho Chehab	- Copyright (C) 2001-2004 Stelian Pop <stelian@popies.net>
69e1cbedeSMauro Carvalho Chehab	- Copyright (C) 2001-2002 Alcôve <www.alcove.com>
79e1cbedeSMauro Carvalho Chehab	- Copyright (C) 2001 Michael Ashley <m.ashley@unsw.edu.au>
89e1cbedeSMauro Carvalho Chehab	- Copyright (C) 2001 Junichi Morita <jun1m@mars.dti.ne.jp>
99e1cbedeSMauro Carvalho Chehab	- Copyright (C) 2000 Takaya Kinjo <t-kinjo@tc4.so-net.ne.jp>
109e1cbedeSMauro Carvalho Chehab	- Copyright (C) 2000 Andrew Tridgell <tridge@samba.org>
119e1cbedeSMauro Carvalho Chehab
129e1cbedeSMauro Carvalho ChehabThis driver enables access to the Sony Programmable I/O Control Device which
139e1cbedeSMauro Carvalho Chehabcan be found in many Sony Vaio laptops. Some newer Sony laptops (seems to be
149e1cbedeSMauro Carvalho Chehablimited to new FX series laptops, at least the FX501 and the FX702) lack a
159e1cbedeSMauro Carvalho Chehabsonypi device and are not supported at all by this driver.
169e1cbedeSMauro Carvalho Chehab
179e1cbedeSMauro Carvalho ChehabIt will give access (through a user space utility) to some events those laptops
189e1cbedeSMauro Carvalho Chehabgenerate, like:
199e1cbedeSMauro Carvalho Chehab
209e1cbedeSMauro Carvalho Chehab	- jogdial events (the small wheel on the side of Vaios)
219e1cbedeSMauro Carvalho Chehab	- capture button events (only on Vaio Picturebook series)
229e1cbedeSMauro Carvalho Chehab	- Fn keys
239e1cbedeSMauro Carvalho Chehab	- bluetooth button (only on C1VR model)
249e1cbedeSMauro Carvalho Chehab	- programmable keys, back, help, zoom, thumbphrase buttons, etc.
259e1cbedeSMauro Carvalho Chehab	  (when available)
269e1cbedeSMauro Carvalho Chehab
279e1cbedeSMauro Carvalho ChehabThose events (see linux/sonypi.h) can be polled using the character device node
289e1cbedeSMauro Carvalho Chehab/dev/sonypi (major 10, minor auto allocated or specified as a option).
299e1cbedeSMauro Carvalho ChehabA simple daemon which translates the jogdial movements into mouse wheel events
309e1cbedeSMauro Carvalho Chehabcan be downloaded at: <http://popies.net/sonypi/>
319e1cbedeSMauro Carvalho Chehab
329e1cbedeSMauro Carvalho ChehabAnother option to intercept the events is to get them directly through the
339e1cbedeSMauro Carvalho Chehabinput layer.
349e1cbedeSMauro Carvalho Chehab
359e1cbedeSMauro Carvalho ChehabThis driver supports also some ioctl commands for setting the LCD screen
369e1cbedeSMauro Carvalho Chehabbrightness and querying the batteries charge information (some more
379e1cbedeSMauro Carvalho Chehabcommands may be added in the future).
389e1cbedeSMauro Carvalho Chehab
399e1cbedeSMauro Carvalho ChehabThis driver can also be used to set the camera controls on Picturebook series
409e1cbedeSMauro Carvalho Chehab(brightness, contrast etc), and is used by the video4linux driver for the
419e1cbedeSMauro Carvalho ChehabMotion Eye camera.
429e1cbedeSMauro Carvalho Chehab
439e1cbedeSMauro Carvalho ChehabPlease note that this driver was created by reverse engineering the Windows
449e1cbedeSMauro Carvalho Chehabdriver and the ACPI BIOS, because Sony doesn't agree to release any programming
459e1cbedeSMauro Carvalho Chehabspecs for its laptops. If someone convinces them to do so, drop me a note.
469e1cbedeSMauro Carvalho Chehab
479e1cbedeSMauro Carvalho ChehabDriver options:
489e1cbedeSMauro Carvalho Chehab---------------
499e1cbedeSMauro Carvalho Chehab
509e1cbedeSMauro Carvalho ChehabSeveral options can be passed to the sonypi driver using the standard
519e1cbedeSMauro Carvalho Chehabmodule argument syntax (<param>=<value> when passing the option to the
529e1cbedeSMauro Carvalho Chehabmodule or sonypi.<param>=<value> on the kernel boot line when sonypi is
539e1cbedeSMauro Carvalho Chehabstatically linked into the kernel). Those options are:
549e1cbedeSMauro Carvalho Chehab
559e1cbedeSMauro Carvalho Chehab	=============== =======================================================
569e1cbedeSMauro Carvalho Chehab	minor:		minor number of the misc device /dev/sonypi,
579e1cbedeSMauro Carvalho Chehab			default is -1 (automatic allocation, see /proc/misc
589e1cbedeSMauro Carvalho Chehab			or kernel logs)
599e1cbedeSMauro Carvalho Chehab
609e1cbedeSMauro Carvalho Chehab	camera:		if you have a PictureBook series Vaio (with the
619e1cbedeSMauro Carvalho Chehab			integrated MotionEye camera), set this parameter to 1
629e1cbedeSMauro Carvalho Chehab			in order to let the driver access to the camera
639e1cbedeSMauro Carvalho Chehab
649e1cbedeSMauro Carvalho Chehab	fnkeyinit:	on some Vaios (C1VE, C1VR etc), the Fn key events don't
659e1cbedeSMauro Carvalho Chehab			get enabled unless you set this parameter to 1.
669e1cbedeSMauro Carvalho Chehab			Do not use this option unless it's actually necessary,
679e1cbedeSMauro Carvalho Chehab			some Vaio models don't deal well with this option.
689e1cbedeSMauro Carvalho Chehab			This option is available only if the kernel is
699e1cbedeSMauro Carvalho Chehab			compiled without ACPI support (since it conflicts
709e1cbedeSMauro Carvalho Chehab			with it and it shouldn't be required anyway if
719e1cbedeSMauro Carvalho Chehab			ACPI is already enabled).
729e1cbedeSMauro Carvalho Chehab
739e1cbedeSMauro Carvalho Chehab	verbose:	set to 1 to print unknown events received from the
749e1cbedeSMauro Carvalho Chehab			sonypi device.
759e1cbedeSMauro Carvalho Chehab			set to 2 to print all events received from the
769e1cbedeSMauro Carvalho Chehab			sonypi device.
779e1cbedeSMauro Carvalho Chehab
789e1cbedeSMauro Carvalho Chehab	compat:		uses some compatibility code for enabling the sonypi
799e1cbedeSMauro Carvalho Chehab			events. If the driver worked for you in the past
809e1cbedeSMauro Carvalho Chehab			(prior to version 1.5) and does not work anymore,
819e1cbedeSMauro Carvalho Chehab			add this option and report to the author.
829e1cbedeSMauro Carvalho Chehab
839e1cbedeSMauro Carvalho Chehab	mask:		event mask telling the driver what events will be
849e1cbedeSMauro Carvalho Chehab			reported to the user. This parameter is required for
859e1cbedeSMauro Carvalho Chehab			some Vaio models where the hardware reuses values
869e1cbedeSMauro Carvalho Chehab			used in other Vaio models (like the FX series who does
879e1cbedeSMauro Carvalho Chehab			not have a jogdial but reuses the jogdial events for
889e1cbedeSMauro Carvalho Chehab			programmable keys events). The default event mask is
899e1cbedeSMauro Carvalho Chehab			set to 0xffffffff, meaning that all possible events
909e1cbedeSMauro Carvalho Chehab			will be tried. You can use the following bits to
919e1cbedeSMauro Carvalho Chehab			construct your own event mask (from
92eddeed12SMauro Carvalho Chehab			drivers/char/sonypi.h)::
939e1cbedeSMauro Carvalho Chehab
949e1cbedeSMauro Carvalho Chehab				SONYPI_JOGGER_MASK		0x0001
959e1cbedeSMauro Carvalho Chehab				SONYPI_CAPTURE_MASK		0x0002
969e1cbedeSMauro Carvalho Chehab				SONYPI_FNKEY_MASK		0x0004
979e1cbedeSMauro Carvalho Chehab				SONYPI_BLUETOOTH_MASK		0x0008
989e1cbedeSMauro Carvalho Chehab				SONYPI_PKEY_MASK		0x0010
999e1cbedeSMauro Carvalho Chehab				SONYPI_BACK_MASK		0x0020
1009e1cbedeSMauro Carvalho Chehab				SONYPI_HELP_MASK		0x0040
1019e1cbedeSMauro Carvalho Chehab				SONYPI_LID_MASK			0x0080
1029e1cbedeSMauro Carvalho Chehab				SONYPI_ZOOM_MASK		0x0100
1039e1cbedeSMauro Carvalho Chehab				SONYPI_THUMBPHRASE_MASK		0x0200
1049e1cbedeSMauro Carvalho Chehab				SONYPI_MEYE_MASK		0x0400
1059e1cbedeSMauro Carvalho Chehab				SONYPI_MEMORYSTICK_MASK		0x0800
1069e1cbedeSMauro Carvalho Chehab				SONYPI_BATTERY_MASK		0x1000
1079e1cbedeSMauro Carvalho Chehab				SONYPI_WIRELESS_MASK		0x2000
1089e1cbedeSMauro Carvalho Chehab
1099e1cbedeSMauro Carvalho Chehab	useinput:	if set (which is the default) two input devices are
1109e1cbedeSMauro Carvalho Chehab			created, one which interprets the jogdial events as
1119e1cbedeSMauro Carvalho Chehab			mouse events, the other one which acts like a
1129e1cbedeSMauro Carvalho Chehab			keyboard reporting the pressing of the special keys.
1139e1cbedeSMauro Carvalho Chehab	=============== =======================================================
1149e1cbedeSMauro Carvalho Chehab
1159e1cbedeSMauro Carvalho ChehabModule use:
1169e1cbedeSMauro Carvalho Chehab-----------
1179e1cbedeSMauro Carvalho Chehab
1189e1cbedeSMauro Carvalho ChehabIn order to automatically load the sonypi module on use, you can put those
1199e1cbedeSMauro Carvalho Chehablines a configuration file in /etc/modprobe.d/::
1209e1cbedeSMauro Carvalho Chehab
1219e1cbedeSMauro Carvalho Chehab	alias char-major-10-250 sonypi
1229e1cbedeSMauro Carvalho Chehab	options sonypi minor=250
1239e1cbedeSMauro Carvalho Chehab
1249e1cbedeSMauro Carvalho ChehabThis supposes the use of minor 250 for the sonypi device::
1259e1cbedeSMauro Carvalho Chehab
1269e1cbedeSMauro Carvalho Chehab	# mknod /dev/sonypi c 10 250
1279e1cbedeSMauro Carvalho Chehab
1289e1cbedeSMauro Carvalho ChehabBugs:
1299e1cbedeSMauro Carvalho Chehab-----
1309e1cbedeSMauro Carvalho Chehab
1319e1cbedeSMauro Carvalho Chehab	- several users reported that this driver disables the BIOS-managed
1329e1cbedeSMauro Carvalho Chehab	  Fn-keys which put the laptop in sleeping state, or switch the
1339e1cbedeSMauro Carvalho Chehab	  external monitor on/off. There is no workaround yet, since this
1349e1cbedeSMauro Carvalho Chehab	  driver disables all APM management for those keys, by enabling the
1359e1cbedeSMauro Carvalho Chehab	  ACPI management (and the ACPI core stuff is not complete yet). If
1369e1cbedeSMauro Carvalho Chehab	  you have one of those laptops with working Fn keys and want to
1379e1cbedeSMauro Carvalho Chehab	  continue to use them, don't use this driver.
1389e1cbedeSMauro Carvalho Chehab
1399e1cbedeSMauro Carvalho Chehab	- some users reported that the laptop speed is lower (dhrystone
1409e1cbedeSMauro Carvalho Chehab	  tested) when using the driver with the fnkeyinit parameter. I cannot
1419e1cbedeSMauro Carvalho Chehab	  reproduce it on my laptop and not all users have this problem.
1429e1cbedeSMauro Carvalho Chehab	  This happens because the fnkeyinit parameter enables the ACPI
1439e1cbedeSMauro Carvalho Chehab	  mode (but without additional ACPI control, like processor
1449e1cbedeSMauro Carvalho Chehab	  speed handling etc). Use ACPI instead of APM if it works on your
1459e1cbedeSMauro Carvalho Chehab	  laptop.
1469e1cbedeSMauro Carvalho Chehab
1479e1cbedeSMauro Carvalho Chehab	- sonypi lacks the ability to distinguish between certain key
1489e1cbedeSMauro Carvalho Chehab	  events on some models.
1499e1cbedeSMauro Carvalho Chehab
1509e1cbedeSMauro Carvalho Chehab	- some models with the nvidia card (geforce go 6200 tc) uses a
1519e1cbedeSMauro Carvalho Chehab	  different way to adjust the backlighting of the screen. There
1529e1cbedeSMauro Carvalho Chehab	  is a userspace utility to adjust the brightness on those models,
1539e1cbedeSMauro Carvalho Chehab	  which can be downloaded from
154*6b2484e1SAlexander A. Klimov	  https://www.acc.umu.se/~erikw/program/smartdimmer-0.1.tar.bz2
1559e1cbedeSMauro Carvalho Chehab
1569e1cbedeSMauro Carvalho Chehab	- since all development was done by reverse engineering, there is
1579e1cbedeSMauro Carvalho Chehab	  *absolutely no guarantee* that this driver will not crash your
1589e1cbedeSMauro Carvalho Chehab	  laptop. Permanently.
159