← Documents Documentation/admin-guide/laptops/sonypi.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / Laptops

Sony Programmable I/O Control Device Driver Readme

구형 Sony Vaio sonypi event, ioctl, module option, 14개 event mask와 알려진 위험을 설명합니다.

Source pathDocumentation/admin-guide/laptops/sonypi.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

Device와 event

sonypi.rst:1-46

character device, input event, camera·battery ioctl과 reverse engineering 배경입니다.

Module option

sonypi.rst:47-114

minor·camera·fnkeyinit·verbose·compat·mask·useinput option을 정리합니다.

Module 사용

sonypi.rst:115-127

modprobe alias와 `/dev/sonypi` device node 생성을 안내합니다.

Bug와 위험

sonypi.rst:128-158

Fn key, 성능, backlight 제한과 영구 손상 가능성을 경고합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Sony Programmable I/O driver 개요

1-46

Copyright: Stelian Pop, Alcôve, Michael Ashley, Junichi Morita, Takaya Kinjo, Andrew Tridgell

이 driver는 많은 Sony Vaio laptop에 있는 Sony Programmable I/O Control Device에 접근할 수 있게 합니다. FX501과 FX702를 포함한 일부 최신 FX series에는 sonypi device가 없어 전혀 지원하지 않습니다.

user-space utility를 통해 jogdial, Vaio Picturebook의 capture button, Fn key, C1VR의 Bluetooth button, programmable·back·help·zoom·thumbphrase button 등의 event에 접근할 수 있습니다.

`linux/sonypi.h`에 정의된 event는 character device `/dev/sonypi`에서 poll할 수 있습니다. major는 10이고 minor는 자동 할당하거나 option으로 지정합니다. jogdial 움직임을 mouse-wheel event로 바꾸는 단순 daemon은 다음 위치에서 받을 수 있습니다.

event를 input layer에서 직접 받는 방법도 있습니다.

driver는 LCD screen brightness 설정과 battery charge 정보 조회를 위한 ioctl command도 지원하며 향후 command가 더 추가될 수 있습니다.

Picturebook series의 camera control(brightness, contrast 등)도 설정할 수 있고 Motion Eye camera용 video4linux driver가 사용합니다.

Sony가 laptop programming specification 공개에 동의하지 않아 Windows driver와 ACPI BIOS를 reverse engineering하여 만든 driver입니다.

Driver option과 event mask

47-114

표준 module argument 문법을 사용합니다. module option은 `<param>=<value>`, kernel에 static link된 경우 boot line에서 `sonypi.<param>=<value>`를 사용합니다.

option설명
minor`/dev/sonypi` misc device의 minor 번호입니다. 기본값 `-1`은 자동 할당이며 `/proc/misc` 또는 kernel log에서 확인합니다.
cameraintegrated MotionEye camera가 있는 PictureBook series라면 `1`로 설정하여 driver가 camera에 접근하게 합니다.
fnkeyinitC1VE·C1VR 등에서 Fn-key event가 enable되지 않을 때 `1`로 설정합니다. 필요한 경우에만 사용하십시오. 일부 Vaio는 이 option을 잘 처리하지 못하며 ACPI와 충돌하므로 ACPI 없이 빌드한 kernel에서만 제공합니다.
verbose`1`은 받은 unknown event를, `2`는 받은 모든 event를 출력합니다.
compatsonypi event enable용 compatibility code를 사용합니다. version 1.5 전에는 동작했지만 지금 동작하지 않을 때 추가하고 작성자에게 보고합니다.
maskuser에게 보고할 event mask입니다. 기본값 `0xffffffff`는 가능한 모든 event를 시도합니다.
useinput기본적으로 enable됩니다. jogdial을 mouse event로 해석하는 input device와 특수 key를 keyboard처럼 보고하는 input device를 만듭니다.

`drivers/char/sonypi.h`에 있는 event-mask bit는 다음과 같습니다.

symbolvalue
SONYPI_JOGGER_MASK0x0001
SONYPI_CAPTURE_MASK0x0002
SONYPI_FNKEY_MASK0x0004
SONYPI_BLUETOOTH_MASK0x0008
SONYPI_PKEY_MASK0x0010
SONYPI_BACK_MASK0x0020
SONYPI_HELP_MASK0x0040
SONYPI_LID_MASK0x0080
SONYPI_ZOOM_MASK0x0100
SONYPI_THUMBPHRASE_MASK0x0200
SONYPI_MEYE_MASK0x0400
SONYPI_MEMORYSTICK_MASK0x0800
SONYPI_BATTERY_MASK0x1000
SONYPI_WIRELESS_MASK0x2000

Module 자동 load와 device node

115-127

사용할 때 `sonypi` module을 자동 load하려면 `/etc/modprobe.d/`의 configuration file에 다음 줄을 넣을 수 있습니다.

alias char-major-10-250 sonypi
options sonypi minor=250

이는 sonypi device에 minor 250을 사용한다고 가정합니다. device node는 다음과 같이 만듭니다.

# mknod /dev/sonypi c 10 250

Bug와 위험 경고

128-158

여러 사용자는 이 driver가 sleep 진입이나 external monitor on/off를 수행하는 BIOS 관리 Fn key를 disable한다고 보고했습니다. driver가 해당 key의 APM 관리를 모두 끄고 아직 불완전한 ACPI 관리를 enable하기 때문에 workaround가 없습니다. Fn key가 잘 동작하고 계속 사용해야 하는 laptop에서는 이 driver를 사용하지 마십시오.

일부 사용자는 `fnkeyinit` parameter로 driver를 사용할 때 dhrystone으로 측정한 laptop 속도가 낮아진다고 보고했습니다. 모든 사용자에게 생기지는 않으며, `fnkeyinit`이 추가 ACPI 제어 없이 ACPI mode를 enable하기 때문에 발생합니다. laptop에서 동작한다면 APM 대신 ACPI를 사용하십시오.

일부 모델에서 `sonypi`는 특정 key event를 구분할 수 없습니다.

NVIDIA GeForce Go 6200 TC card가 있는 일부 모델은 screen backlight 조정 방식이 다릅니다. 해당 모델의 brightness용 user-space utility는 다음 위치에 있습니다.

모든 개발이 reverse engineering으로 이루어졌으므로 이 driver가 laptop을 crash시키지 않는다는 보장은 전혀 없습니다. 영구적인 손상도 가능합니다.