aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2017-04-04 20:50:20 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-04-05 18:45:06 -0400
commit1ad1473f65da8e61120e8f1b68bc92f2b71ba879 (patch)
tree5fef5e0f80aadef8fc1e79548514f89a403729ae
parent3f0a2975788df13d3d6d3cffab52482064201099 (diff)
Input: yealink - convert documentation into ReST format
This file require minimum adjustments to be a valid ReST file. Do it, in order to be able to parse it with Sphinx. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--Documentation/input/yealink.txt164
1 files changed, 93 insertions, 71 deletions
diff --git a/Documentation/input/yealink.txt b/Documentation/input/yealink.txt
index 8277b76ec506..b231d8baf4bb 100644
--- a/Documentation/input/yealink.txt
+++ b/Documentation/input/yealink.txt
@@ -1,8 +1,12 @@
1===============================================
1Driver documentation for yealink usb-p1k phones 2Driver documentation for yealink usb-p1k phones
3===============================================
4
5Status
6======
2 7
30. Status
4~~~~~~~~~
5The p1k is a relatively cheap usb 1.1 phone with: 8The p1k is a relatively cheap usb 1.1 phone with:
9
6 - keyboard full support, yealink.ko / input event API 10 - keyboard full support, yealink.ko / input event API
7 - LCD full support, yealink.ko / sysfs API 11 - LCD full support, yealink.ko / sysfs API
8 - LED full support, yealink.ko / sysfs API 12 - LED full support, yealink.ko / sysfs API
@@ -14,10 +18,11 @@ The p1k is a relatively cheap usb 1.1 phone with:
14For vendor documentation see http://www.yealink.com 18For vendor documentation see http://www.yealink.com
15 19
16 20
171. Compilation (stand alone version) 21Compilation (stand alone version)
18~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 22=================================
23
19Currently only kernel 2.6.x.y versions are supported. 24Currently only kernel 2.6.x.y versions are supported.
20In order to build the yealink.ko module do 25In order to build the yealink.ko module do::
21 26
22 make 27 make
23 28
@@ -26,26 +31,28 @@ the Makefile is pointing to the location where your kernel sources
26are located, default /usr/src/linux. 31are located, default /usr/src/linux.
27 32
28 33
291.1 Troubleshooting 34Troubleshooting
30~~~~~~~~~~~~~~~~~~~ 35~~~~~~~~~~~~~~~
31Q: Module yealink compiled and installed without any problem but phone 36
32 is not initialized and does not react to any actions. 37:Q: Module yealink compiled and installed without any problem but phone
33A: If you see something like: 38 is not initialized and does not react to any actions.
34 hiddev0: USB HID v1.00 Device [Yealink Network Technology Ltd. VOIP USB Phone 39:A: If you see something like:
35 in dmesg, it means that the hid driver has grabbed the device first. Try to 40 hiddev0: USB HID v1.00 Device [Yealink Network Technology Ltd. VOIP USB Phone
36 load module yealink before any other usb hid driver. Please see the 41 in dmesg, it means that the hid driver has grabbed the device first. Try to
37 instructions provided by your distribution on module configuration. 42 load module yealink before any other usb hid driver. Please see the
43 instructions provided by your distribution on module configuration.
38 44
39Q: Phone is working now (displays version and accepts keypad input) but I can't 45:Q: Phone is working now (displays version and accepts keypad input) but I can't
40 find the sysfs files. 46 find the sysfs files.
41A: The sysfs files are located on the particular usb endpoint. On most 47:A: The sysfs files are located on the particular usb endpoint. On most
42 distributions you can do: "find /sys/ -name get_icons" for a hint. 48 distributions you can do: "find /sys/ -name get_icons" for a hint.
43 49
44 50
452. keyboard features 51keyboard features
46~~~~~~~~~~~~~~~~~~~~ 52=================
53
47The current mapping in the kernel is provided by the map_p1k_to_key 54The current mapping in the kernel is provided by the map_p1k_to_key
48function: 55function::
49 56
50 Physical USB-P1K button layout input events 57 Physical USB-P1K button layout input events
51 58
@@ -60,14 +67,15 @@ function:
60 7 8 9 7, 8, 9, 67 7 8 9 7, 8, 9,
61 * 0 # *, 0, #, 68 * 0 # *, 0, #,
62 69
63 The "up" and "down" keys, are symbolised by arrows on the button. 70The "up" and "down" keys, are symbolised by arrows on the button.
64 The "pickup" and "hangup" keys are symbolised by a green and red phone 71The "pickup" and "hangup" keys are symbolised by a green and red phone
65 on the button. 72on the button.
66 73
67 74
683. LCD features 75LCD features
69~~~~~~~~~~~~~~~ 76============
70The LCD is divided and organised as a 3 line display: 77
78The LCD is divided and organised as a 3 line display::
71 79
72 |[] [][] [][] [][] in |[][] 80 |[] [][] [][] [][] in |[][]
73 |[] M [][] D [][] : [][] out |[][] 81 |[] M [][] D [][] : [][] out |[][]
@@ -79,18 +87,19 @@ The LCD is divided and organised as a 3 line display:
79 [] [] [] [] [] [] [] [] [] [] [] [] 87 [] [] [] [] [] [] [] [] [] [] [] []
80 88
81 89
82Line 1 Format (see below) : 18.e8.M8.88...188 90 Line 1 Format (see below) : 18.e8.M8.88...188
83 Icon names : M D : IN OUT STORE 91 Icon names : M D : IN OUT STORE
84Line 2 Format : ......... 92 Line 2 Format : .........
85 Icon name : NEW REP SU MO TU WE TH FR SA 93 Icon name : NEW REP SU MO TU WE TH FR SA
86Line 3 Format : 888888888888 94 Line 3 Format : 888888888888
87 95
88 96
89Format description: 97Format description:
90 From a userspace perspective the world is separated into "digits" and "icons". 98 From a userspace perspective the world is separated into "digits" and "icons".
91 A digit can have a character set, an icon can only be ON or OFF. 99 A digit can have a character set, an icon can only be ON or OFF.
92 100
93 Format specifier 101 Format specifier::
102
94 '8' : Generic 7 segment digit with individual addressable segments 103 '8' : Generic 7 segment digit with individual addressable segments
95 104
96 Reduced capability 7 segment digit, when segments are hard wired together. 105 Reduced capability 7 segment digit, when segments are hard wired together.
@@ -105,9 +114,11 @@ Format description:
105 elements. 114 elements.
106 115
107 116
1084. Driver usage 117Driver usage
109~~~~~~~~~~~~~~~ 118============
110For userland the following interfaces are available using the sysfs interface: 119
120For userland the following interfaces are available using the sysfs interface::
121
111 /sys/.../ 122 /sys/.../
112 line1 Read/Write, lcd line1 123 line1 Read/Write, lcd line1
113 line2 Read/Write, lcd line2 124 line2 Read/Write, lcd line2
@@ -118,38 +129,43 @@ For userland the following interfaces are available using the sysfs interface:
118 show_icon Write, display the element by writing the icon name. 129 show_icon Write, display the element by writing the icon name.
119 130
120 map_seg7 Read/Write, the 7 segments char set, common for all 131 map_seg7 Read/Write, the 7 segments char set, common for all
121 yealink phones. (see map_to_7segment.h) 132 yealink phones. (see map_to_7segment.h)
122 133
123 ringtone Write, upload binary representation of a ringtone, 134 ringtone Write, upload binary representation of a ringtone,
124 see yealink.c. status EXPERIMENTAL due to potential 135 see yealink.c. status EXPERIMENTAL due to potential
125 races between async. and sync usb calls. 136 races between async. and sync usb calls.
126 137
127 138
1284.1 lineX 139lineX
129~~~~~~~~~ 140~~~~~
130Reading /sys/../lineX will return the format string with its current value: 141
142Reading /sys/../lineX will return the format string with its current value.
131 143
132 Example: 144 Example::
133 cat ./line3 145
134 888888888888 146 cat ./line3
135 Linux Rocks! 147 888888888888
148 Linux Rocks!
136 149
137Writing to /sys/../lineX will set the corresponding LCD line. 150Writing to /sys/../lineX will set the corresponding LCD line.
151
138 - Excess characters are ignored. 152 - Excess characters are ignored.
139 - If less characters are written than allowed, the remaining digits are 153 - If less characters are written than allowed, the remaining digits are
140 unchanged. 154 unchanged.
141 - The tab '\t'and '\n' char does not overwrite the original content. 155 - The tab '\t'and '\n' char does not overwrite the original content.
142 - Writing a space to an icon will always hide its content. 156 - Writing a space to an icon will always hide its content.
143 157
144 Example: 158 Example::
145 date +"%m.%e.%k:%M" | sed 's/^0/ /' > ./line1 159
160 date +"%m.%e.%k:%M" | sed 's/^0/ /' > ./line1
146 161
147 Will update the LCD with the current date & time. 162 Will update the LCD with the current date & time.
148 163
149 164
1504.2 get_icons 165get_icons
151~~~~~~~~~~~~~ 166~~~~~~~~~
152Reading will return all available icon names and its current settings: 167
168Reading will return all available icon names and its current settings::
153 169
154 cat ./get_icons 170 cat ./get_icons
155 on M 171 on M
@@ -172,45 +188,51 @@ Reading will return all available icon names and its current settings:
172 RINGTONE 188 RINGTONE
173 189
174 190
1754.3 show/hide icons 191show/hide icons
176~~~~~~~~~~~~~~~~~~~ 192~~~~~~~~~~~~~~~
193
177Writing to these files will update the state of the icon. 194Writing to these files will update the state of the icon.
178Only one icon at a time can be updated. 195Only one icon at a time can be updated.
179 196
180If an icon is also on a ./lineX the corresponding value is 197If an icon is also on a ./lineX the corresponding value is
181updated with the first letter of the icon. 198updated with the first letter of the icon.
182 199
183 Example - light up the store icon: 200 Example - light up the store icon::
184 echo -n "STORE" > ./show_icon
185 201
186 cat ./line1 202 echo -n "STORE" > ./show_icon
187 18.e8.M8.88...188
188 S
189 203
190 Example - sound the ringtone for 10 seconds: 204 cat ./line1
191 echo -n RINGTONE > /sys/..../show_icon 205 18.e8.M8.88...188
192 sleep 10 206 S
193 echo -n RINGTONE > /sys/..../hide_icon
194 207
208 Example - sound the ringtone for 10 seconds::
209
210 echo -n RINGTONE > /sys/..../show_icon
211 sleep 10
212 echo -n RINGTONE > /sys/..../hide_icon
213
214
215Sound features
216==============
195 217
1965. Sound features
197~~~~~~~~~~~~~~~~~
198Sound is supported by the ALSA driver: snd_usb_audio 218Sound is supported by the ALSA driver: snd_usb_audio
199 219
200One 16-bit channel with sample and playback rates of 8000 Hz is the practical 220One 16-bit channel with sample and playback rates of 8000 Hz is the practical
201limit of the device. 221limit of the device.
202 222
203 Example - recording test: 223 Example - recording test::
204 arecord -v -d 10 -r 8000 -f S16_LE -t wav foobar.wav 224
225 arecord -v -d 10 -r 8000 -f S16_LE -t wav foobar.wav
205 226
206 Example - playback test: 227 Example - playback test::
207 aplay foobar.wav
208 228
229 aplay foobar.wav
230
231
232Credits & Acknowledgments
233=========================
209 234
2106. Credits & Acknowledgments
211~~~~~~~~~~~~~~~~~~~~~~~~~~~~
212 - Olivier Vandorpe, for starting the usbb2k-api project doing much of 235 - Olivier Vandorpe, for starting the usbb2k-api project doing much of
213 the reverse engineering. 236 the reverse engineering.
214 - Martin Diehl, for pointing out how to handle USB memory allocation. 237 - Martin Diehl, for pointing out how to handle USB memory allocation.
215 - Dmitry Torokhov, for the numerous code reviews and suggestions. 238 - Dmitry Torokhov, for the numerous code reviews and suggestions.
216