Commit 1ad1473f authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Dmitry Torokhov

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: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 3f0a2975
===============================================
Driver documentation for yealink usb-p1k phones Driver documentation for yealink usb-p1k phones
===============================================
Status
======
0. Status
~~~~~~~~~
The p1k is a relatively cheap usb 1.1 phone with: The p1k is a relatively cheap usb 1.1 phone with:
- keyboard full support, yealink.ko / input event API - keyboard full support, yealink.ko / input event API
- LCD full support, yealink.ko / sysfs API - LCD full support, yealink.ko / sysfs API
- LED full support, yealink.ko / sysfs API - LED full support, yealink.ko / sysfs API
...@@ -14,10 +18,11 @@ The p1k is a relatively cheap usb 1.1 phone with: ...@@ -14,10 +18,11 @@ The p1k is a relatively cheap usb 1.1 phone with:
For vendor documentation see http://www.yealink.com For vendor documentation see http://www.yealink.com
1. Compilation (stand alone version) Compilation (stand alone version)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =================================
Currently only kernel 2.6.x.y versions are supported. Currently only kernel 2.6.x.y versions are supported.
In order to build the yealink.ko module do In order to build the yealink.ko module do::
make make
...@@ -26,26 +31,28 @@ the Makefile is pointing to the location where your kernel sources ...@@ -26,26 +31,28 @@ the Makefile is pointing to the location where your kernel sources
are located, default /usr/src/linux. are located, default /usr/src/linux.
1.1 Troubleshooting Troubleshooting
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
Q: Module yealink compiled and installed without any problem but phone
:Q: Module yealink compiled and installed without any problem but phone
is not initialized and does not react to any actions. is not initialized and does not react to any actions.
A: If you see something like: :A: If you see something like:
hiddev0: USB HID v1.00 Device [Yealink Network Technology Ltd. VOIP USB Phone 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 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 load module yealink before any other usb hid driver. Please see the
instructions provided by your distribution on module configuration. instructions provided by your distribution on module configuration.
Q: Phone is working now (displays version and accepts keypad input) but I can't :Q: Phone is working now (displays version and accepts keypad input) but I can't
find the sysfs files. find the sysfs files.
A: The sysfs files are located on the particular usb endpoint. On most :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. distributions you can do: "find /sys/ -name get_icons" for a hint.
2. keyboard features keyboard features
~~~~~~~~~~~~~~~~~~~~ =================
The current mapping in the kernel is provided by the map_p1k_to_key The current mapping in the kernel is provided by the map_p1k_to_key
function: function::
Physical USB-P1K button layout input events Physical USB-P1K button layout input events
...@@ -60,14 +67,15 @@ function: ...@@ -60,14 +67,15 @@ function:
7 8 9 7, 8, 9, 7 8 9 7, 8, 9,
* 0 # *, 0, #, * 0 # *, 0, #,
The "up" and "down" keys, are symbolised by arrows on the button. 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 The "pickup" and "hangup" keys are symbolised by a green and red phone
on the button. on the button.
3. LCD features LCD features
~~~~~~~~~~~~~~~ ============
The LCD is divided and organised as a 3 line display:
The LCD is divided and organised as a 3 line display::
|[] [][] [][] [][] in |[][] |[] [][] [][] [][] in |[][]
|[] M [][] D [][] : [][] out |[][] |[] M [][] D [][] : [][] out |[][]
...@@ -79,18 +87,19 @@ The LCD is divided and organised as a 3 line display: ...@@ -79,18 +87,19 @@ The LCD is divided and organised as a 3 line display:
[] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
Line 1 Format (see below) : 18.e8.M8.88...188 Line 1 Format (see below) : 18.e8.M8.88...188
Icon names : M D : IN OUT STORE Icon names : M D : IN OUT STORE
Line 2 Format : ......... Line 2 Format : .........
Icon name : NEW REP SU MO TU WE TH FR SA Icon name : NEW REP SU MO TU WE TH FR SA
Line 3 Format : 888888888888 Line 3 Format : 888888888888
Format description: Format description:
From a userspace perspective the world is separated into "digits" and "icons". From a userspace perspective the world is separated into "digits" and "icons".
A digit can have a character set, an icon can only be ON or OFF. A digit can have a character set, an icon can only be ON or OFF.
Format specifier Format specifier::
'8' : Generic 7 segment digit with individual addressable segments '8' : Generic 7 segment digit with individual addressable segments
Reduced capability 7 segment digit, when segments are hard wired together. Reduced capability 7 segment digit, when segments are hard wired together.
...@@ -105,9 +114,11 @@ Format description: ...@@ -105,9 +114,11 @@ Format description:
elements. elements.
4. Driver usage Driver usage
~~~~~~~~~~~~~~~ ============
For userland the following interfaces are available using the sysfs interface:
For userland the following interfaces are available using the sysfs interface::
/sys/.../ /sys/.../
line1 Read/Write, lcd line1 line1 Read/Write, lcd line1
line2 Read/Write, lcd line2 line2 Read/Write, lcd line2
...@@ -125,31 +136,36 @@ For userland the following interfaces are available using the sysfs interface: ...@@ -125,31 +136,36 @@ For userland the following interfaces are available using the sysfs interface:
races between async. and sync usb calls. races between async. and sync usb calls.
4.1 lineX lineX
~~~~~~~~~ ~~~~~
Reading /sys/../lineX will return the format string with its current value:
Reading /sys/../lineX will return the format string with its current value.
Example::
Example:
cat ./line3 cat ./line3
888888888888 888888888888
Linux Rocks! Linux Rocks!
Writing to /sys/../lineX will set the corresponding LCD line. Writing to /sys/../lineX will set the corresponding LCD line.
- Excess characters are ignored. - Excess characters are ignored.
- If less characters are written than allowed, the remaining digits are - If less characters are written than allowed, the remaining digits are
unchanged. unchanged.
- The tab '\t'and '\n' char does not overwrite the original content. - The tab '\t'and '\n' char does not overwrite the original content.
- Writing a space to an icon will always hide its content. - Writing a space to an icon will always hide its content.
Example: Example::
date +"%m.%e.%k:%M" | sed 's/^0/ /' > ./line1 date +"%m.%e.%k:%M" | sed 's/^0/ /' > ./line1
Will update the LCD with the current date & time. Will update the LCD with the current date & time.
4.2 get_icons get_icons
~~~~~~~~~~~~~ ~~~~~~~~~
Reading will return all available icon names and its current settings:
Reading will return all available icon names and its current settings::
cat ./get_icons cat ./get_icons
on M on M
...@@ -172,45 +188,51 @@ Reading will return all available icon names and its current settings: ...@@ -172,45 +188,51 @@ Reading will return all available icon names and its current settings:
RINGTONE RINGTONE
4.3 show/hide icons show/hide icons
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
Writing to these files will update the state of the icon. Writing to these files will update the state of the icon.
Only one icon at a time can be updated. Only one icon at a time can be updated.
If an icon is also on a ./lineX the corresponding value is If an icon is also on a ./lineX the corresponding value is
updated with the first letter of the icon. updated with the first letter of the icon.
Example - light up the store icon: Example - light up the store icon::
echo -n "STORE" > ./show_icon echo -n "STORE" > ./show_icon
cat ./line1 cat ./line1
18.e8.M8.88...188 18.e8.M8.88...188
S S
Example - sound the ringtone for 10 seconds: Example - sound the ringtone for 10 seconds::
echo -n RINGTONE > /sys/..../show_icon echo -n RINGTONE > /sys/..../show_icon
sleep 10 sleep 10
echo -n RINGTONE > /sys/..../hide_icon echo -n RINGTONE > /sys/..../hide_icon
5. Sound features Sound features
~~~~~~~~~~~~~~~~~ ==============
Sound is supported by the ALSA driver: snd_usb_audio 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 One 16-bit channel with sample and playback rates of 8000 Hz is the practical
limit of the device. limit of the device.
Example - recording test: Example - recording test::
arecord -v -d 10 -r 8000 -f S16_LE -t wav foobar.wav arecord -v -d 10 -r 8000 -f S16_LE -t wav foobar.wav
Example - playback test: Example - playback test::
aplay foobar.wav aplay foobar.wav
6. Credits & Acknowledgments Credits & Acknowledgments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =========================
- Olivier Vandorpe, for starting the usbb2k-api project doing much of - Olivier Vandorpe, for starting the usbb2k-api project doing much of
the reverse engineering. the reverse engineering.
- Martin Diehl, for pointing out how to handle USB memory allocation. - Martin Diehl, for pointing out how to handle USB memory allocation.
- Dmitry Torokhov, for the numerous code reviews and suggestions. - Dmitry Torokhov, for the numerous code reviews and suggestions.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment