2017-04-04 17:50:20 -07:00
|
|
|
===============================================
|
2005-08-17 01:40:26 -07:00
|
|
|
Driver documentation for yealink usb-p1k phones
|
2017-04-04 17:50:20 -07:00
|
|
|
===============================================
|
|
|
|
|
|
|
|
Status
|
|
|
|
======
|
2005-08-16 07:17:43 -07:00
|
|
|
|
|
|
|
The p1k is a relatively cheap usb 1.1 phone with:
|
2017-04-04 17:50:20 -07:00
|
|
|
|
2005-08-17 01:40:26 -07:00
|
|
|
- keyboard full support, yealink.ko / input event API
|
|
|
|
- LCD full support, yealink.ko / sysfs API
|
|
|
|
- LED full support, yealink.ko / sysfs API
|
|
|
|
- dialtone full support, yealink.ko / sysfs API
|
|
|
|
- ringtone full support, yealink.ko / sysfs API
|
|
|
|
- audio playback full support, snd_usb_audio.ko / alsa API
|
|
|
|
- audio record full support, snd_usb_audio.ko / alsa API
|
|
|
|
|
|
|
|
For vendor documentation see http://www.yealink.com
|
2005-08-16 07:17:43 -07:00
|
|
|
|
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
keyboard features
|
|
|
|
=================
|
|
|
|
|
2005-08-16 07:17:43 -07:00
|
|
|
The current mapping in the kernel is provided by the map_p1k_to_key
|
2017-04-04 17:50:20 -07:00
|
|
|
function::
|
2005-08-16 07:17:43 -07:00
|
|
|
|
|
|
|
Physical USB-P1K button layout input events
|
|
|
|
|
|
|
|
|
|
|
|
up up
|
|
|
|
IN OUT left, right
|
|
|
|
down down
|
|
|
|
|
|
|
|
pickup C hangup enter, backspace, escape
|
|
|
|
1 2 3 1, 2, 3
|
|
|
|
4 5 6 4, 5, 6,
|
|
|
|
7 8 9 7, 8, 9,
|
|
|
|
* 0 # *, 0, #,
|
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
The "up" and "down" keys, are symbolised by arrows on the button.
|
|
|
|
The "pickup" and "hangup" keys are symbolised by a green and red phone
|
|
|
|
on the button.
|
2005-08-16 07:17:43 -07:00
|
|
|
|
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
LCD features
|
|
|
|
============
|
|
|
|
|
|
|
|
The LCD is divided and organised as a 3 line display::
|
2005-08-16 07:17:43 -07:00
|
|
|
|
|
|
|
|[] [][] [][] [][] in |[][]
|
|
|
|
|[] M [][] D [][] : [][] out |[][]
|
|
|
|
store
|
|
|
|
|
|
|
|
NEW REP SU MO TU WE TH FR SA
|
|
|
|
|
|
|
|
[] [] [] [] [] [] [] [] [] [] [] []
|
|
|
|
[] [] [] [] [] [] [] [] [] [] [] []
|
|
|
|
|
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
Line 1 Format (see below) : 18.e8.M8.88...188
|
|
|
|
Icon names : M D : IN OUT STORE
|
|
|
|
Line 2 Format : .........
|
|
|
|
Icon name : NEW REP SU MO TU WE TH FR SA
|
|
|
|
Line 3 Format : 888888888888
|
2005-08-16 07:17:43 -07:00
|
|
|
|
|
|
|
|
|
|
|
Format description:
|
2006-10-03 13:55:17 -07:00
|
|
|
From a userspace perspective the world is separated into "digits" and "icons".
|
2005-08-16 07:17:43 -07:00
|
|
|
A digit can have a character set, an icon can only be ON or OFF.
|
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
Format specifier::
|
|
|
|
|
2005-08-16 07:17:43 -07:00
|
|
|
'8' : Generic 7 segment digit with individual addressable segments
|
|
|
|
|
2015-02-25 04:30:22 -07:00
|
|
|
Reduced capability 7 segment digit, when segments are hard wired together.
|
2005-08-16 07:17:43 -07:00
|
|
|
'1' : 2 segments digit only able to produce a 1.
|
|
|
|
'e' : Most significant day of the month digit,
|
|
|
|
able to produce at least 1 2 3.
|
|
|
|
'M' : Most significant minute digit,
|
|
|
|
able to produce at least 0 1 2 3 4 5.
|
|
|
|
|
|
|
|
Icons or pictograms:
|
|
|
|
'.' : For example like AM, PM, SU, a 'dot' .. or other single segment
|
|
|
|
elements.
|
|
|
|
|
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
Driver usage
|
|
|
|
============
|
|
|
|
|
|
|
|
For userland the following interfaces are available using the sysfs interface::
|
|
|
|
|
2005-08-16 07:17:43 -07:00
|
|
|
/sys/.../
|
|
|
|
line1 Read/Write, lcd line1
|
|
|
|
line2 Read/Write, lcd line2
|
|
|
|
line3 Read/Write, lcd line3
|
|
|
|
|
|
|
|
get_icons Read, returns a set of available icons.
|
|
|
|
hide_icon Write, hide the element by writing the icon name.
|
|
|
|
show_icon Write, display the element by writing the icon name.
|
|
|
|
|
|
|
|
map_seg7 Read/Write, the 7 segments char set, common for all
|
2017-04-04 17:50:20 -07:00
|
|
|
yealink phones. (see map_to_7segment.h)
|
2005-08-16 07:17:43 -07:00
|
|
|
|
|
|
|
ringtone Write, upload binary representation of a ringtone,
|
2017-04-04 17:50:20 -07:00
|
|
|
see yealink.c. status EXPERIMENTAL due to potential
|
2005-08-16 07:17:43 -07:00
|
|
|
races between async. and sync usb calls.
|
|
|
|
|
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
lineX
|
|
|
|
~~~~~
|
|
|
|
|
|
|
|
Reading /sys/../lineX will return the format string with its current value.
|
2005-08-16 07:17:43 -07:00
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
Example::
|
|
|
|
|
|
|
|
cat ./line3
|
|
|
|
888888888888
|
|
|
|
Linux Rocks!
|
2005-08-16 07:17:43 -07:00
|
|
|
|
2006-11-29 21:21:10 -07:00
|
|
|
Writing to /sys/../lineX will set the corresponding LCD line.
|
2017-04-04 17:50:20 -07:00
|
|
|
|
2005-08-16 07:17:43 -07:00
|
|
|
- Excess characters are ignored.
|
|
|
|
- If less characters are written than allowed, the remaining digits are
|
|
|
|
unchanged.
|
|
|
|
- The tab '\t'and '\n' char does not overwrite the original content.
|
|
|
|
- Writing a space to an icon will always hide its content.
|
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
Example::
|
|
|
|
|
|
|
|
date +"%m.%e.%k:%M" | sed 's/^0/ /' > ./line1
|
2005-08-16 07:17:43 -07:00
|
|
|
|
|
|
|
Will update the LCD with the current date & time.
|
|
|
|
|
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
get_icons
|
|
|
|
~~~~~~~~~
|
|
|
|
|
|
|
|
Reading will return all available icon names and its current settings::
|
2005-08-16 07:17:43 -07:00
|
|
|
|
|
|
|
cat ./get_icons
|
|
|
|
on M
|
|
|
|
on D
|
|
|
|
on :
|
|
|
|
IN
|
|
|
|
OUT
|
|
|
|
STORE
|
|
|
|
NEW
|
|
|
|
REP
|
|
|
|
SU
|
|
|
|
MO
|
|
|
|
TU
|
|
|
|
WE
|
|
|
|
TH
|
|
|
|
FR
|
|
|
|
SA
|
|
|
|
LED
|
|
|
|
DIALTONE
|
|
|
|
RINGTONE
|
|
|
|
|
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
show/hide icons
|
|
|
|
~~~~~~~~~~~~~~~
|
|
|
|
|
2005-08-16 07:17:43 -07:00
|
|
|
Writing to these files will update the state of the icon.
|
|
|
|
Only one icon at a time can be updated.
|
|
|
|
|
|
|
|
If an icon is also on a ./lineX the corresponding value is
|
|
|
|
updated with the first letter of the icon.
|
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
Example - light up the store icon::
|
2005-08-16 07:17:43 -07:00
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
echo -n "STORE" > ./show_icon
|
2005-08-16 07:17:43 -07:00
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
cat ./line1
|
|
|
|
18.e8.M8.88...188
|
|
|
|
S
|
2005-08-16 07:17:43 -07:00
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
Example - sound the ringtone for 10 seconds::
|
|
|
|
|
|
|
|
echo -n RINGTONE > /sys/..../show_icon
|
|
|
|
sleep 10
|
|
|
|
echo -n RINGTONE > /sys/..../hide_icon
|
|
|
|
|
|
|
|
|
|
|
|
Sound features
|
|
|
|
==============
|
2005-08-16 07:17:43 -07:00
|
|
|
|
2005-08-17 01:40:26 -07:00
|
|
|
Sound is supported by the ALSA driver: snd_usb_audio
|
|
|
|
|
|
|
|
One 16-bit channel with sample and playback rates of 8000 Hz is the practical
|
|
|
|
limit of the device.
|
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
Example - recording test::
|
|
|
|
|
|
|
|
arecord -v -d 10 -r 8000 -f S16_LE -t wav foobar.wav
|
2005-08-17 01:40:26 -07:00
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
Example - playback test::
|
2005-08-17 01:40:26 -07:00
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
aplay foobar.wav
|
|
|
|
|
|
|
|
|
2017-04-06 18:08:42 -07:00
|
|
|
Troubleshooting
|
|
|
|
===============
|
|
|
|
|
|
|
|
:Q: Module yealink compiled and installed without any problem but phone
|
|
|
|
is not initialized and does not react to any actions.
|
|
|
|
:A: If you see something like:
|
|
|
|
hiddev0: USB HID v1.00 Device [Yealink Network Technology Ltd. VOIP USB Phone
|
|
|
|
in dmesg, it means that the hid driver has grabbed the device first. Try to
|
|
|
|
load module yealink before any other usb hid driver. Please see the
|
|
|
|
instructions provided by your distribution on module configuration.
|
|
|
|
|
|
|
|
:Q: Phone is working now (displays version and accepts keypad input) but I can't
|
|
|
|
find the sysfs files.
|
|
|
|
:A: The sysfs files are located on the particular usb endpoint. On most
|
|
|
|
distributions you can do: "find /sys/ -name get_icons" for a hint.
|
|
|
|
|
|
|
|
|
2017-04-04 17:50:20 -07:00
|
|
|
Credits & Acknowledgments
|
|
|
|
=========================
|
2005-08-17 01:40:26 -07:00
|
|
|
|
2005-08-16 07:17:43 -07:00
|
|
|
- Olivier Vandorpe, for starting the usbb2k-api project doing much of
|
2017-04-04 17:50:20 -07:00
|
|
|
the reverse engineering.
|
2005-08-16 07:17:43 -07:00
|
|
|
- Martin Diehl, for pointing out how to handle USB memory allocation.
|
|
|
|
- Dmitry Torokhov, for the numerous code reviews and suggestions.
|