Commit b71e318cdb1dc301d734fdd4983dfc6dc167235a
Committed by
Greg Kroah-Hartman
1 parent
d5ae36dd43
Exists in
master
and in
7 other branches
[PATCH] USB: yealink: fix htons usage, documentation updates
Signed-off-by: Henk Vergonet <henk.vergonet@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 2 changed files with 28 additions and 12 deletions Side-by-side Diff
Documentation/input/yealink.txt
1 | -yealink - Linux driver for usb-p1k phones | |
1 | +Driver documentation for yealink usb-p1k phones | |
2 | 2 | |
3 | 3 | 0. Status |
4 | 4 | ~~~~~~~~~ |
5 | 5 | |
6 | 6 | The p1k is a relatively cheap usb 1.1 phone with: |
7 | - - keyboard full support | |
8 | - - LCD full support | |
9 | - - LED 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 | |
7 | + - keyboard full support, yealink.ko / input event API | |
8 | + - LCD full support, yealink.ko / sysfs API | |
9 | + - LED full support, yealink.ko / sysfs API | |
10 | + - dialtone full support, yealink.ko / sysfs API | |
11 | + - ringtone full support, yealink.ko / sysfs API | |
12 | + - audio playback full support, snd_usb_audio.ko / alsa API | |
13 | + - audio record full support, snd_usb_audio.ko / alsa API | |
14 | 14 | |
15 | +For vendor documentation see http://www.yealink.com | |
15 | 16 | |
17 | + | |
16 | 18 | 1. Compilation (stand alone version) |
17 | 19 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
18 | 20 | |
... | ... | @@ -178,7 +180,21 @@ |
178 | 180 | echo -n RINGTONE > /sys/..../hide_icon |
179 | 181 | |
180 | 182 | |
181 | -5. Credits & Acknowledgments | |
183 | +5. Sound features | |
184 | +~~~~~~~~~~~~~~~~~ | |
185 | +Sound is supported by the ALSA driver: snd_usb_audio | |
186 | + | |
187 | +One 16-bit channel with sample and playback rates of 8000 Hz is the practical | |
188 | +limit of the device. | |
189 | + | |
190 | + Example - recording test: | |
191 | + arecord -v -d 10 -r 8000 -f S16_LE -t wav foobar.wav | |
192 | + | |
193 | + Example - playback test: | |
194 | + aplay foobar.wav | |
195 | + | |
196 | + | |
197 | +6. Credits & Acknowledgments | |
182 | 198 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
183 | 199 | - Olivier Vandorpe, for starting the usbb2k-api project doing much of |
184 | 200 | the reverse engineering. |
drivers/usb/input/yealink.c
... | ... | @@ -318,7 +318,7 @@ |
318 | 318 | if (len > sizeof(p->data)) |
319 | 319 | len = sizeof(p->data); |
320 | 320 | p->size = len; |
321 | - p->offset = htons(ix); | |
321 | + p->offset = cpu_to_be16(ix); | |
322 | 322 | memcpy(p->data, &buf[ix], len); |
323 | 323 | yealink_cmd(yld, p); |
324 | 324 | ix += len; |
... | ... | @@ -383,7 +383,7 @@ |
383 | 383 | val--; |
384 | 384 | val &= 0x1f; |
385 | 385 | yld->ctl_data->cmd = CMD_SCANCODE; |
386 | - yld->ctl_data->offset = htons(val); | |
386 | + yld->ctl_data->offset = cpu_to_be16(val); | |
387 | 387 | yld->ctl_data->data[0] = 0; |
388 | 388 | yld->ctl_data->sum = -1 - CMD_SCANCODE - val; |
389 | 389 | break; |
... | ... | @@ -395,7 +395,7 @@ |
395 | 395 | /* Combine up to <len> consecutive LCD bytes in a singe request |
396 | 396 | */ |
397 | 397 | yld->ctl_data->cmd = CMD_LCD; |
398 | - yld->ctl_data->offset = htons(ix); | |
398 | + yld->ctl_data->offset = cpu_to_be16(ix); | |
399 | 399 | yld->ctl_data->size = len; |
400 | 400 | yld->ctl_data->sum = -CMD_LCD - ix - val - len; |
401 | 401 | for(i=1; i<len; i++) { |