subdrivers.c

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2011 Lubos Slovak
00003  * All rights reserved.
00004  *
00005  * Redistribution and use in source and binary forms, with or without
00006  * modification, are permitted provided that the following conditions
00007  * are met:
00008  *
00009  * - Redistributions of source code must retain the above copyright
00010  *   notice, this list of conditions and the following disclaimer.
00011  * - Redistributions in binary form must reproduce the above copyright
00012  *   notice, this list of conditions and the following disclaimer in the
00013  *   documentation and/or other materials provided with the distribution.
00014  * - The name of the author may not be used to endorse or promote products
00015  *   derived from this software without specific prior written permission.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
00018  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00019  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
00020  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
00021  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
00022  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00023  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00024  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00025  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
00026  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00027  */
00028 
00036 #include "subdrivers.h"
00037 #include <usb/hid/usages/core.h>
00038 #include <usb/hid/hidpath.h>
00039 
00040 #include "multimedia/multimedia.h"
00041 #include "mouse/mousedev.h"
00042 #include "generic/hiddev.h"
00043 
00044 static usb_hid_subdriver_usage_t path_kbd[] = {
00045         {USB_HIDUT_PAGE_GENERIC_DESKTOP, 
00046          USB_HIDUT_USAGE_GENERIC_DESKTOP_KEYBOARD}, 
00047         {0, 0}
00048 };
00049 
00050 static usb_hid_subdriver_usage_t path_mouse[] = {
00051         {USB_HIDUT_PAGE_GENERIC_DESKTOP, USB_HIDUT_USAGE_GENERIC_DESKTOP_MOUSE},
00052         {0, 0}
00053 };
00054 
00055 static usb_hid_subdriver_usage_t multim_key_path[] = {
00056         {USB_HIDUT_PAGE_CONSUMER, USB_HIDUT_USAGE_CONSUMER_CONSUMER_CONTROL},
00057         {0, 0}
00058 };
00059 
00060 const usb_hid_subdriver_mapping_t usb_hid_subdrivers[] = {
00061         {
00062                 path_kbd,
00063                 0,
00064                 USB_HID_PATH_COMPARE_BEGIN,
00065                 -1,
00066                 -1,
00067                 {
00068                         .init = usb_kbd_init,
00069                         .deinit = usb_kbd_deinit,
00070                         .poll = usb_kbd_polling_callback,
00071                         .poll_end = NULL
00072                 },
00073                 
00074         },
00075         {
00076                 multim_key_path,
00077                 1,
00078                 USB_HID_PATH_COMPARE_BEGIN,
00079                 -1,
00080                 -1,
00081                 {
00082                         .init = usb_multimedia_init,
00083                         .deinit = usb_multimedia_deinit,
00084                         .poll = usb_multimedia_polling_callback,
00085                         .poll_end = NULL
00086                 }
00087         },
00088         {
00089                 path_mouse,
00090                 0,
00091                 USB_HID_PATH_COMPARE_BEGIN,
00092                 -1,
00093                 -1,
00094                 {
00095                         .init = usb_mouse_init,
00096                         .deinit = usb_mouse_deinit,
00097                         .poll = usb_mouse_polling_callback,
00098                         .poll_end = NULL
00099                 }
00100         },
00101         {NULL, -1, 0, -1, -1, {NULL, NULL, NULL, NULL, NULL}}
00102 };
00103 

Generated on Thu Jun 2 07:45:44 2011 for HelenOS/USB by  doxygen 1.4.7