Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Mauro Carvalho Chehab and committed by
Dmitry Torokhov
1ad1473f 3f0a2975

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