1 yealink - Linux driver for usb-p1k phones
6 The p1k is a relatively cheap usb 1.1 phone with:
7 - keyboard full support
10 - dialtone full support
11 - ringtone full support
12 - audio playback via generic usb audio diver
13 - audio record via generic usb audio diver
16 1. Compilation (stand alone version)
17 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19 Currently only kernel 2.6.x.y versions are supported.
20 In order to build the yealink.ko module do:
24 If you encounter problems please check if in the MAKE_OPTS variable in
25 the Makefile is pointing to the location where your kernel sources
26 are located, default /usr/src/linux.
32 The current mapping in the kernel is provided by the map_p1k_to_key
35 Physical USB-P1K button layout input events
42 pickup C hangup enter, backspace, escape
48 The "up" and "down" keys, are symbolised by arrows on the button.
49 The "pickup" and "hangup" keys are symbolised by a green and red phone
55 The LCD is divided and organised as a 3 line display:
57 |[] [][] [][] [][] in |[][]
58 |[] M [][] D [][] : [][] out |[][]
61 NEW REP SU MO TU WE TH FR SA
63 [] [] [] [] [] [] [] [] [] [] [] []
64 [] [] [] [] [] [] [] [] [] [] [] []
67 Line 1 Format (see below) : 18.e8.M8.88...188
68 Icon names : M D : IN OUT STORE
69 Line 2 Format : .........
70 Icon name : NEW REP SU MO TU WE TH FR SA
71 Line 3 Format : 888888888888
75 From a user space perspective the world is seperated in "digits" and "icons".
76 A digit can have a character set, an icon can only be ON or OFF.
79 '8' : Generic 7 segment digit with individual addressable segments
81 Reduced capabillity 7 segm digit, when segments are hard wired together.
82 '1' : 2 segments digit only able to produce a 1.
83 'e' : Most significant day of the month digit,
84 able to produce at least 1 2 3.
85 'M' : Most significant minute digit,
86 able to produce at least 0 1 2 3 4 5.
89 '.' : For example like AM, PM, SU, a 'dot' .. or other single segment
95 For userland the following interfaces are available using the sysfs interface:
97 line1 Read/Write, lcd line1
98 line2 Read/Write, lcd line2
99 line3 Read/Write, lcd line3
101 get_icons Read, returns a set of available icons.
102 hide_icon Write, hide the element by writing the icon name.
103 show_icon Write, display the element by writing the icon name.
105 map_seg7 Read/Write, the 7 segments char set, common for all
106 yealink phones. (see map_to_7segment.h)
108 ringtone Write, upload binary representation of a ringtone,
109 see yealink.c. status EXPERIMENTAL due to potential
110 races between async. and sync usb calls.
115 Reading /sys/../lineX will return the format string with its current value:
122 Writing to /sys/../lineX will set the coresponding LCD line.
123 - Excess characters are ignored.
124 - If less characters are written than allowed, the remaining digits are
126 - The tab '\t'and '\n' char does not overwrite the original content.
127 - Writing a space to an icon will always hide its content.
130 date +"%m.%e.%k:%M" | sed 's/^0/ /' > ./line1
132 Will update the LCD with the current date & time.
137 Reading will return all available icon names and its current settings:
162 Writing to these files will update the state of the icon.
163 Only one icon at a time can be updated.
165 If an icon is also on a ./lineX the corresponding value is
166 updated with the first letter of the icon.
168 Example - light up the store icon:
169 echo -n "STORE" > ./show_icon
175 Example - sound the ringtone for 10 seconds:
176 echo -n RINGTONE > /sys/..../show_icon
178 echo -n RINGTONE > /sys/..../hide_icon
181 5. Credits & Acknowledgments
182 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183 - Olivier Vandorpe, for starting the usbb2k-api project doing much of
184 the reverse engineering.
185 - Martin Diehl, for pointing out how to handle USB memory allocation.
186 - Dmitry Torokhov, for the numerous code reviews and suggestions.