[62bd8d3] | 1 | /*
|
---|
| 2 | * Copyright (c) 2011 Lubos Slovak
|
---|
| 3 | * All rights reserved.
|
---|
| 4 | *
|
---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
---|
| 6 | * modification, are permitted provided that the following conditions
|
---|
| 7 | * are met:
|
---|
| 8 | *
|
---|
| 9 | * - Redistributions of source code must retain the above copyright
|
---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 13 | * documentation and/or other materials provided with the distribution.
|
---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
---|
| 15 | * derived from this software without specific prior written permission.
|
---|
| 16 | *
|
---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /** @addtogroup drvusbhid
|
---|
| 30 | * @{
|
---|
| 31 | */
|
---|
| 32 | /** @file
|
---|
| 33 | * USB HID subdriver mappings.
|
---|
| 34 | */
|
---|
| 35 |
|
---|
| 36 | #include "subdrivers.h"
|
---|
[faa44e58] | 37 | #include <usb/hid/usages/core.h>
|
---|
| 38 | #include <usb/hid/hidpath.h>
|
---|
[1e94e09] | 39 | #include "kbd/kbddev.h"
|
---|
[7bb8036] | 40 | #include "mouse/mousedev.h"
|
---|
[1e94e09] | 41 | #include "multimedia/multimedia.h"
|
---|
| 42 | #include "blink1/blink1.h"
|
---|
[78bfae9] | 43 | #include "generic/hiddev.h"
|
---|
[e3b5129] | 44 |
|
---|
[3f8f09f] | 45 | static const usb_hid_subdriver_usage_t path_kbd[] = {
|
---|
[1e94e09] | 46 | {
|
---|
| 47 | USB_HIDUT_PAGE_GENERIC_DESKTOP,
|
---|
| 48 | USB_HIDUT_USAGE_GENERIC_DESKTOP_KEYBOARD
|
---|
| 49 | },
|
---|
[777e336] | 50 | {0, 0}
|
---|
| 51 | };
|
---|
[62bd8d3] | 52 |
|
---|
[3f8f09f] | 53 | static const usb_hid_subdriver_usage_t path_mouse[] = {
|
---|
[1e94e09] | 54 | {
|
---|
| 55 | USB_HIDUT_PAGE_GENERIC_DESKTOP,
|
---|
| 56 | USB_HIDUT_USAGE_GENERIC_DESKTOP_MOUSE
|
---|
| 57 | },
|
---|
[7bb8036] | 58 | {0, 0}
|
---|
| 59 | };
|
---|
| 60 |
|
---|
[1e94e09] | 61 | static const usb_hid_subdriver_usage_t path_multim_key[] = {
|
---|
| 62 | {
|
---|
| 63 | USB_HIDUT_PAGE_CONSUMER,
|
---|
| 64 | USB_HIDUT_USAGE_CONSUMER_CONSUMER_CONTROL
|
---|
| 65 | },
|
---|
[e3b5129] | 66 | {0, 0}
|
---|
| 67 | };
|
---|
| 68 |
|
---|
[62bd8d3] | 69 | const usb_hid_subdriver_mapping_t usb_hid_subdrivers[] = {
|
---|
| 70 | {
|
---|
| 71 | path_kbd,
|
---|
[78bfae9] | 72 | 0,
|
---|
[37f87fa] | 73 | USB_HID_PATH_COMPARE_BEGIN,
|
---|
[d0a6e54] | 74 | -1,
|
---|
| 75 | -1,
|
---|
[62bd8d3] | 76 | {
|
---|
[777e336] | 77 | .init = usb_kbd_init,
|
---|
| 78 | .deinit = usb_kbd_deinit,
|
---|
| 79 | .poll = usb_kbd_polling_callback,
|
---|
| 80 | .poll_end = NULL
|
---|
[62bd8d3] | 81 | },
|
---|
| 82 | },
|
---|
[e3b5129] | 83 | {
|
---|
[1e94e09] | 84 | path_multim_key,
|
---|
[e3b5129] | 85 | 1,
|
---|
[37f87fa] | 86 | USB_HID_PATH_COMPARE_BEGIN,
|
---|
[cecb1a97] | 87 | -1,
|
---|
| 88 | -1,
|
---|
[e3b5129] | 89 | {
|
---|
[d3b6d5e] | 90 | .init = usb_multimedia_init,
|
---|
| 91 | .deinit = usb_multimedia_deinit,
|
---|
| 92 | .poll = usb_multimedia_polling_callback,
|
---|
[e3b5129] | 93 | .poll_end = NULL
|
---|
| 94 | }
|
---|
| 95 | },
|
---|
[7bb8036] | 96 | {
|
---|
[84b240f] | 97 | path_mouse,
|
---|
[78bfae9] | 98 | 0,
|
---|
[37f87fa] | 99 | USB_HID_PATH_COMPARE_BEGIN,
|
---|
[7bb8036] | 100 | -1,
|
---|
| 101 | -1,
|
---|
| 102 | {
|
---|
| 103 | .init = usb_mouse_init,
|
---|
| 104 | .deinit = usb_mouse_deinit,
|
---|
| 105 | .poll = usb_mouse_polling_callback,
|
---|
| 106 | .poll_end = NULL
|
---|
| 107 | }
|
---|
| 108 | },
|
---|
[1e94e09] | 109 | {
|
---|
| 110 | NULL,
|
---|
| 111 | 0,
|
---|
| 112 | USB_HID_PATH_COMPARE_BEGIN,
|
---|
| 113 | 0x27b8,
|
---|
| 114 | 0x01ed,
|
---|
| 115 | {
|
---|
| 116 | .init = usb_blink1_init,
|
---|
| 117 | .deinit = usb_blink1_deinit,
|
---|
| 118 | .poll = NULL,
|
---|
| 119 | .poll_end = NULL
|
---|
| 120 | }
|
---|
| 121 | }
|
---|
[62bd8d3] | 122 | };
|
---|
| 123 |
|
---|
[07b9cbae] | 124 | const size_t USB_HID_MAX_SUBDRIVERS =
|
---|
[93d2684] | 125 | sizeof(usb_hid_subdrivers) / sizeof(usb_hid_subdrivers[0]);
|
---|
| 126 |
|
---|
[62bd8d3] | 127 | /**
|
---|
| 128 | * @}
|
---|
| 129 | */
|
---|