| 1 | /* |
| 2 | * arch/ubicom32/include/asm/ubicom32hid.h |
| 3 | * Ubicom32 architecture HID driver platform data definitions. |
| 4 | * |
| 5 | * (C) Copyright 2009, Ubicom, Inc. |
| 6 | * |
| 7 | * This file is part of the Ubicom32 Linux Kernel Port. |
| 8 | * |
| 9 | * The Ubicom32 Linux Kernel Port is free software: you can redistribute |
| 10 | * it and/or modify it under the terms of the GNU General Public License |
| 11 | * as published by the Free Software Foundation, either version 2 of the |
| 12 | * License, or (at your option) any later version. |
| 13 | * |
| 14 | * The Ubicom32 Linux Kernel Port is distributed in the hope that it |
| 15 | * will be useful, but WITHOUT ANY WARRANTY; without even the implied |
| 16 | * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
| 17 | * the GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with the Ubicom32 Linux Kernel Port. If not, |
| 21 | * see <http://www.gnu.org/licenses/>. |
| 22 | * |
| 23 | * Ubicom32 implementation derived from (with many thanks): |
| 24 | * arch/m68knommu |
| 25 | * arch/blackfin |
| 26 | * arch/parisc |
| 27 | */ |
| 28 | #ifndef _ASM_UBICOM32_UBICOM32_HID_H |
| 29 | #define _ASM_UBICOM32_UBICOM32_HID_H |
| 30 | |
| 31 | enum ubicom32hid_bl_types { |
| 32 | /* |
| 33 | * On or off, using command SET_BL_EN, PB4 |
| 34 | */ |
| 35 | UBICOM32HID_BL_TYPE_BINARY, |
| 36 | |
| 37 | /* |
| 38 | * Dimmable, using command SET_PWM, PB3 |
| 39 | */ |
| 40 | UBICOM32HID_BL_TYPE_PWM, |
| 41 | }; |
| 42 | |
| 43 | /* |
| 44 | * IR code mapping to event code. |
| 45 | * If there are no button mappings and no ir mappings |
| 46 | * then no input driver will be registered. |
| 47 | */ |
| 48 | struct ubicom32hid_ir { |
| 49 | /* |
| 50 | * Input event code (KEY_*, SW_*, etc) |
| 51 | */ |
| 52 | int code; |
| 53 | |
| 54 | /* |
| 55 | * Input event type (EV_KEY, EV_SW, etc) |
| 56 | */ |
| 57 | int type; |
| 58 | |
| 59 | /* |
| 60 | * The IR code of this button. |
| 61 | */ |
| 62 | uint32_t ir_code; |
| 63 | }; |
| 64 | |
| 65 | /* |
| 66 | * Button mapping to event code. |
| 67 | * If there are no button mappings and no ir mappings |
| 68 | * then no input driver will be registered. |
| 69 | */ |
| 70 | struct ubicom32hid_button { |
| 71 | /* |
| 72 | * Input event code (KEY_*, SW_*, etc) |
| 73 | */ |
| 74 | int code; |
| 75 | |
| 76 | /* |
| 77 | * Input event type (EV_KEY, EV_SW, etc) |
| 78 | */ |
| 79 | int type; |
| 80 | |
| 81 | /* |
| 82 | * Bit number of this button. |
| 83 | */ |
| 84 | uint8_t bit; |
| 85 | }; |
| 86 | |
| 87 | struct ubicom32hid_platform_data { |
| 88 | /* |
| 89 | * Default intensity of the backlight 0-255 |
| 90 | */ |
| 91 | u8_t default_intensity; |
| 92 | |
| 93 | /* |
| 94 | * GPIO number of the reset line and its polarity. |
| 95 | */ |
| 96 | unsigned gpio_reset; |
| 97 | int gpio_reset_polarity; |
| 98 | |
| 99 | /* |
| 100 | * TRUE if the backlight sense is active low. (inverted) |
| 101 | * FALSE if the backlight sense is active high. |
| 102 | */ |
| 103 | bool invert; |
| 104 | |
| 105 | /* |
| 106 | * Type of the backlight we are controlling |
| 107 | */ |
| 108 | enum ubicom32hid_bl_types type; |
| 109 | |
| 110 | /* |
| 111 | * Optional polling rate for input, in ms, defaults to 100ms |
| 112 | */ |
| 113 | int poll_interval; |
| 114 | |
| 115 | /* |
| 116 | * Optional name to register as input device |
| 117 | */ |
| 118 | const char *input_name; |
| 119 | |
| 120 | /* |
| 121 | * Button mapping array |
| 122 | */ |
| 123 | const struct ubicom32hid_button *buttons; |
| 124 | int nbuttons; |
| 125 | |
| 126 | /* |
| 127 | * IR mapping array |
| 128 | */ |
| 129 | const struct ubicom32hid_ir *ircodes; |
| 130 | int nircodes; |
| 131 | }; |
| 132 | |
| 133 | #endif /* _ASM_UBICOM32_UBICOM32_HID_H */ |
| 134 | |