diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-10-15 23:29:12 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-10-15 23:29:12 -0400 |
commit | 4c0e799a9a6dc64426ddb6c03aea1a154357658f (patch) | |
tree | 2d9aa9493d80fceb178a63bf15bb3d9edfc5fbae /include | |
parent | 3fa8749e584b55f1180411ab1b51117190bac1e5 (diff) | |
parent | b8d055a878ee0f997ded40649701089d2486f850 (diff) |
Merge branch 'next' into for-linus
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/Kbuild | 1 | ||||
-rw-r--r-- | include/linux/gameport.h | 7 | ||||
-rw-r--r-- | include/linux/input.h | 15 | ||||
-rw-r--r-- | include/linux/map_to_7segment.h | 187 | ||||
-rw-r--r-- | include/linux/mod_devicetable.h | 2 | ||||
-rw-r--r-- | include/linux/spi/ads7846.h | 3 |
6 files changed, 210 insertions, 5 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index b68ec09399be..6e1755f2ae03 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -107,6 +107,7 @@ header-y += keyctl.h | |||
107 | header-y += limits.h | 107 | header-y += limits.h |
108 | header-y += magic.h | 108 | header-y += magic.h |
109 | header-y += major.h | 109 | header-y += major.h |
110 | header-y += map_to_7segment.h | ||
110 | header-y += matroxfb.h | 111 | header-y += matroxfb.h |
111 | header-y += meye.h | 112 | header-y += meye.h |
112 | header-y += minix_fs.h | 113 | header-y += minix_fs.h |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index f64e29c0ef3f..0cd825f7363a 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
@@ -146,10 +146,11 @@ static inline void gameport_unpin_driver(struct gameport *gameport) | |||
146 | mutex_unlock(&gameport->drv_mutex); | 146 | mutex_unlock(&gameport->drv_mutex); |
147 | } | 147 | } |
148 | 148 | ||
149 | void __gameport_register_driver(struct gameport_driver *drv, struct module *owner); | 149 | int __gameport_register_driver(struct gameport_driver *drv, |
150 | static inline void gameport_register_driver(struct gameport_driver *drv) | 150 | struct module *owner, const char *mod_name); |
151 | static inline int __must_check gameport_register_driver(struct gameport_driver *drv) | ||
151 | { | 152 | { |
152 | __gameport_register_driver(drv, THIS_MODULE); | 153 | return __gameport_register_driver(drv, THIS_MODULE, KBUILD_MODNAME); |
153 | } | 154 | } |
154 | 155 | ||
155 | void gameport_unregister_driver(struct gameport_driver *drv); | 156 | void gameport_unregister_driver(struct gameport_driver *drv); |
diff --git a/include/linux/input.h b/include/linux/input.h index a5802c9c81a4..b86fb5581ce6 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -577,9 +577,22 @@ struct input_absinfo { | |||
577 | #define KEY_BRL_DOT9 0x1f9 | 577 | #define KEY_BRL_DOT9 0x1f9 |
578 | #define KEY_BRL_DOT10 0x1fa | 578 | #define KEY_BRL_DOT10 0x1fa |
579 | 579 | ||
580 | #define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */ | ||
581 | #define KEY_NUMERIC_1 0x201 /* and other keypads */ | ||
582 | #define KEY_NUMERIC_2 0x202 | ||
583 | #define KEY_NUMERIC_3 0x203 | ||
584 | #define KEY_NUMERIC_4 0x204 | ||
585 | #define KEY_NUMERIC_5 0x205 | ||
586 | #define KEY_NUMERIC_6 0x206 | ||
587 | #define KEY_NUMERIC_7 0x207 | ||
588 | #define KEY_NUMERIC_8 0x208 | ||
589 | #define KEY_NUMERIC_9 0x209 | ||
590 | #define KEY_NUMERIC_STAR 0x20a | ||
591 | #define KEY_NUMERIC_POUND 0x20b | ||
592 | |||
580 | /* We avoid low common keys in module aliases so they don't get huge. */ | 593 | /* We avoid low common keys in module aliases so they don't get huge. */ |
581 | #define KEY_MIN_INTERESTING KEY_MUTE | 594 | #define KEY_MIN_INTERESTING KEY_MUTE |
582 | #define KEY_MAX 0x1ff | 595 | #define KEY_MAX 0x2ff |
583 | #define KEY_CNT (KEY_MAX+1) | 596 | #define KEY_CNT (KEY_MAX+1) |
584 | 597 | ||
585 | /* | 598 | /* |
diff --git a/include/linux/map_to_7segment.h b/include/linux/map_to_7segment.h new file mode 100644 index 000000000000..7df8432c4402 --- /dev/null +++ b/include/linux/map_to_7segment.h | |||
@@ -0,0 +1,187 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2005 Henk Vergonet <Henk.Vergonet@gmail.com> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License as | ||
6 | * published by the Free Software Foundation; either version 2 of | ||
7 | * the License, or (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef MAP_TO_7SEGMENT_H | ||
20 | #define MAP_TO_7SEGMENT_H | ||
21 | |||
22 | /* This file provides translation primitives and tables for the conversion | ||
23 | * of (ASCII) characters to a 7-segments notation. | ||
24 | * | ||
25 | * The 7 segment's wikipedia notation below is used as standard. | ||
26 | * See: http://en.wikipedia.org/wiki/Seven_segment_display | ||
27 | * | ||
28 | * Notation: +-a-+ | ||
29 | * f b | ||
30 | * +-g-+ | ||
31 | * e c | ||
32 | * +-d-+ | ||
33 | * | ||
34 | * Usage: | ||
35 | * | ||
36 | * Register a map variable, and fill it with a character set: | ||
37 | * static SEG7_DEFAULT_MAP(map_seg7); | ||
38 | * | ||
39 | * | ||
40 | * Then use for conversion: | ||
41 | * seg7 = map_to_seg7(&map_seg7, some_char); | ||
42 | * ... | ||
43 | * | ||
44 | * In device drivers it is recommended, if required, to make the char map | ||
45 | * accessible via the sysfs interface using the following scheme: | ||
46 | * | ||
47 | * static ssize_t show_map(struct device *dev, char *buf) { | ||
48 | * memcpy(buf, &map_seg7, sizeof(map_seg7)); | ||
49 | * return sizeof(map_seg7); | ||
50 | * } | ||
51 | * static ssize_t store_map(struct device *dev, const char *buf, size_t cnt) { | ||
52 | * if(cnt != sizeof(map_seg7)) | ||
53 | * return -EINVAL; | ||
54 | * memcpy(&map_seg7, buf, cnt); | ||
55 | * return cnt; | ||
56 | * } | ||
57 | * static DEVICE_ATTR(map_seg7, PERMS_RW, show_map, store_map); | ||
58 | * | ||
59 | * History: | ||
60 | * 2005-05-31 RFC linux-kernel@vger.kernel.org | ||
61 | */ | ||
62 | #include <linux/errno.h> | ||
63 | |||
64 | |||
65 | #define BIT_SEG7_A 0 | ||
66 | #define BIT_SEG7_B 1 | ||
67 | #define BIT_SEG7_C 2 | ||
68 | #define BIT_SEG7_D 3 | ||
69 | #define BIT_SEG7_E 4 | ||
70 | #define BIT_SEG7_F 5 | ||
71 | #define BIT_SEG7_G 6 | ||
72 | #define BIT_SEG7_RESERVED 7 | ||
73 | |||
74 | struct seg7_conversion_map { | ||
75 | unsigned char table[128]; | ||
76 | }; | ||
77 | |||
78 | static inline int map_to_seg7(struct seg7_conversion_map *map, int c) | ||
79 | { | ||
80 | return c >= 0 && c < sizeof(map->table) ? map->table[c] : -EINVAL; | ||
81 | } | ||
82 | |||
83 | #define SEG7_CONVERSION_MAP(_name, _map) \ | ||
84 | struct seg7_conversion_map _name = { .table = { _map } } | ||
85 | |||
86 | /* | ||
87 | * It is recommended to use a facility that allows user space to redefine | ||
88 | * custom character sets for LCD devices. Please use a sysfs interface | ||
89 | * as described above. | ||
90 | */ | ||
91 | #define MAP_TO_SEG7_SYSFS_FILE "map_seg7" | ||
92 | |||
93 | /******************************************************************************* | ||
94 | * ASCII conversion table | ||
95 | ******************************************************************************/ | ||
96 | |||
97 | #define _SEG7(l,a,b,c,d,e,f,g) \ | ||
98 | ( a<<BIT_SEG7_A | b<<BIT_SEG7_B | c<<BIT_SEG7_C | d<<BIT_SEG7_D | \ | ||
99 | e<<BIT_SEG7_E | f<<BIT_SEG7_F | g<<BIT_SEG7_G ) | ||
100 | |||
101 | #define _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \ | ||
102 | 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | ||
103 | |||
104 | #define _MAP_33_47_ASCII_SEG7_SYMBOL \ | ||
105 | _SEG7('!',0,0,0,0,1,1,0), _SEG7('"',0,1,0,0,0,1,0), _SEG7('#',0,1,1,0,1,1,0),\ | ||
106 | _SEG7('$',1,0,1,1,0,1,1), _SEG7('%',0,0,1,0,0,1,0), _SEG7('&',1,0,1,1,1,1,1),\ | ||
107 | _SEG7('\'',0,0,0,0,0,1,0),_SEG7('(',1,0,0,1,1,1,0), _SEG7(')',1,1,1,1,0,0,0),\ | ||
108 | _SEG7('*',0,1,1,0,1,1,1), _SEG7('+',0,1,1,0,0,0,1), _SEG7(',',0,0,0,0,1,0,0),\ | ||
109 | _SEG7('-',0,0,0,0,0,0,1), _SEG7('.',0,0,0,0,1,0,0), _SEG7('/',0,1,0,0,1,0,1), | ||
110 | |||
111 | #define _MAP_48_57_ASCII_SEG7_NUMERIC \ | ||
112 | _SEG7('0',1,1,1,1,1,1,0), _SEG7('1',0,1,1,0,0,0,0), _SEG7('2',1,1,0,1,1,0,1),\ | ||
113 | _SEG7('3',1,1,1,1,0,0,1), _SEG7('4',0,1,1,0,0,1,1), _SEG7('5',1,0,1,1,0,1,1),\ | ||
114 | _SEG7('6',1,0,1,1,1,1,1), _SEG7('7',1,1,1,0,0,0,0), _SEG7('8',1,1,1,1,1,1,1),\ | ||
115 | _SEG7('9',1,1,1,1,0,1,1), | ||
116 | |||
117 | #define _MAP_58_64_ASCII_SEG7_SYMBOL \ | ||
118 | _SEG7(':',0,0,0,1,0,0,1), _SEG7(';',0,0,0,1,0,0,1), _SEG7('<',1,0,0,0,0,1,1),\ | ||
119 | _SEG7('=',0,0,0,1,0,0,1), _SEG7('>',1,1,0,0,0,0,1), _SEG7('?',1,1,1,0,0,1,0),\ | ||
120 | _SEG7('@',1,1,0,1,1,1,1), | ||
121 | |||
122 | #define _MAP_65_90_ASCII_SEG7_ALPHA_UPPR \ | ||
123 | _SEG7('A',1,1,1,0,1,1,1), _SEG7('B',1,1,1,1,1,1,1), _SEG7('C',1,0,0,1,1,1,0),\ | ||
124 | _SEG7('D',1,1,1,1,1,1,0), _SEG7('E',1,0,0,1,1,1,1), _SEG7('F',1,0,0,0,1,1,1),\ | ||
125 | _SEG7('G',1,1,1,1,0,1,1), _SEG7('H',0,1,1,0,1,1,1), _SEG7('I',0,1,1,0,0,0,0),\ | ||
126 | _SEG7('J',0,1,1,1,0,0,0), _SEG7('K',0,1,1,0,1,1,1), _SEG7('L',0,0,0,1,1,1,0),\ | ||
127 | _SEG7('M',1,1,1,0,1,1,0), _SEG7('N',1,1,1,0,1,1,0), _SEG7('O',1,1,1,1,1,1,0),\ | ||
128 | _SEG7('P',1,1,0,0,1,1,1), _SEG7('Q',1,1,1,1,1,1,0), _SEG7('R',1,1,1,0,1,1,1),\ | ||
129 | _SEG7('S',1,0,1,1,0,1,1), _SEG7('T',0,0,0,1,1,1,1), _SEG7('U',0,1,1,1,1,1,0),\ | ||
130 | _SEG7('V',0,1,1,1,1,1,0), _SEG7('W',0,1,1,1,1,1,1), _SEG7('X',0,1,1,0,1,1,1),\ | ||
131 | _SEG7('Y',0,1,1,0,0,1,1), _SEG7('Z',1,1,0,1,1,0,1), | ||
132 | |||
133 | #define _MAP_91_96_ASCII_SEG7_SYMBOL \ | ||
134 | _SEG7('[',1,0,0,1,1,1,0), _SEG7('\\',0,0,1,0,0,1,1),_SEG7(']',1,1,1,1,0,0,0),\ | ||
135 | _SEG7('^',1,1,0,0,0,1,0), _SEG7('_',0,0,0,1,0,0,0), _SEG7('`',0,1,0,0,0,0,0), | ||
136 | |||
137 | #define _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \ | ||
138 | _SEG7('A',1,1,1,0,1,1,1), _SEG7('b',0,0,1,1,1,1,1), _SEG7('c',0,0,0,1,1,0,1),\ | ||
139 | _SEG7('d',0,1,1,1,1,0,1), _SEG7('E',1,0,0,1,1,1,1), _SEG7('F',1,0,0,0,1,1,1),\ | ||
140 | _SEG7('G',1,1,1,1,0,1,1), _SEG7('h',0,0,1,0,1,1,1), _SEG7('i',0,0,1,0,0,0,0),\ | ||
141 | _SEG7('j',0,0,1,1,0,0,0), _SEG7('k',0,0,1,0,1,1,1), _SEG7('L',0,0,0,1,1,1,0),\ | ||
142 | _SEG7('M',1,1,1,0,1,1,0), _SEG7('n',0,0,1,0,1,0,1), _SEG7('o',0,0,1,1,1,0,1),\ | ||
143 | _SEG7('P',1,1,0,0,1,1,1), _SEG7('q',1,1,1,0,0,1,1), _SEG7('r',0,0,0,0,1,0,1),\ | ||
144 | _SEG7('S',1,0,1,1,0,1,1), _SEG7('T',0,0,0,1,1,1,1), _SEG7('u',0,0,1,1,1,0,0),\ | ||
145 | _SEG7('v',0,0,1,1,1,0,0), _SEG7('W',0,1,1,1,1,1,1), _SEG7('X',0,1,1,0,1,1,1),\ | ||
146 | _SEG7('y',0,1,1,1,0,1,1), _SEG7('Z',1,1,0,1,1,0,1), | ||
147 | |||
148 | #define _MAP_123_126_ASCII_SEG7_SYMBOL \ | ||
149 | _SEG7('{',1,0,0,1,1,1,0), _SEG7('|',0,0,0,0,1,1,0), _SEG7('}',1,1,1,1,0,0,0),\ | ||
150 | _SEG7('~',1,0,0,0,0,0,0), | ||
151 | |||
152 | /* Maps */ | ||
153 | |||
154 | /* This set tries to map as close as possible to the visible characteristics | ||
155 | * of the ASCII symbol, lowercase and uppercase letters may differ in | ||
156 | * presentation on the display. | ||
157 | */ | ||
158 | #define MAP_ASCII7SEG_ALPHANUM \ | ||
159 | _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \ | ||
160 | _MAP_33_47_ASCII_SEG7_SYMBOL \ | ||
161 | _MAP_48_57_ASCII_SEG7_NUMERIC \ | ||
162 | _MAP_58_64_ASCII_SEG7_SYMBOL \ | ||
163 | _MAP_65_90_ASCII_SEG7_ALPHA_UPPR \ | ||
164 | _MAP_91_96_ASCII_SEG7_SYMBOL \ | ||
165 | _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \ | ||
166 | _MAP_123_126_ASCII_SEG7_SYMBOL | ||
167 | |||
168 | /* This set tries to map as close as possible to the symbolic characteristics | ||
169 | * of the ASCII character for maximum discrimination. | ||
170 | * For now this means all alpha chars are in lower case representations. | ||
171 | * (This for example facilitates the use of hex numbers with uppercase input.) | ||
172 | */ | ||
173 | #define MAP_ASCII7SEG_ALPHANUM_LC \ | ||
174 | _MAP_0_32_ASCII_SEG7_NON_PRINTABLE \ | ||
175 | _MAP_33_47_ASCII_SEG7_SYMBOL \ | ||
176 | _MAP_48_57_ASCII_SEG7_NUMERIC \ | ||
177 | _MAP_58_64_ASCII_SEG7_SYMBOL \ | ||
178 | _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \ | ||
179 | _MAP_91_96_ASCII_SEG7_SYMBOL \ | ||
180 | _MAP_97_122_ASCII_SEG7_ALPHA_LOWER \ | ||
181 | _MAP_123_126_ASCII_SEG7_SYMBOL | ||
182 | |||
183 | #define SEG7_DEFAULT_MAP(_name) \ | ||
184 | SEG7_CONVERSION_MAP(_name,MAP_ASCII7SEG_ALPHANUM) | ||
185 | |||
186 | #endif /* MAP_TO_7SEGMENT_H */ | ||
187 | |||
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index c4db5827963d..0dddfa44ec19 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -274,7 +274,7 @@ struct pcmcia_device_id { | |||
274 | /* Input */ | 274 | /* Input */ |
275 | #define INPUT_DEVICE_ID_EV_MAX 0x1f | 275 | #define INPUT_DEVICE_ID_EV_MAX 0x1f |
276 | #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 | 276 | #define INPUT_DEVICE_ID_KEY_MIN_INTERESTING 0x71 |
277 | #define INPUT_DEVICE_ID_KEY_MAX 0x1ff | 277 | #define INPUT_DEVICE_ID_KEY_MAX 0x2ff |
278 | #define INPUT_DEVICE_ID_REL_MAX 0x0f | 278 | #define INPUT_DEVICE_ID_REL_MAX 0x0f |
279 | #define INPUT_DEVICE_ID_ABS_MAX 0x3f | 279 | #define INPUT_DEVICE_ID_ABS_MAX 0x3f |
280 | #define INPUT_DEVICE_ID_MSC_MAX 0x07 | 280 | #define INPUT_DEVICE_ID_MSC_MAX 0x07 |
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index daf744017a31..05eab2f11e63 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
@@ -43,6 +43,9 @@ struct ads7846_platform_data { | |||
43 | u16 debounce_tol; /* tolerance used for filtering */ | 43 | u16 debounce_tol; /* tolerance used for filtering */ |
44 | u16 debounce_rep; /* additional consecutive good readings | 44 | u16 debounce_rep; /* additional consecutive good readings |
45 | * required after the first two */ | 45 | * required after the first two */ |
46 | int gpio_pendown; /* the GPIO used to decide the pendown | ||
47 | * state if get_pendown_state == NULL | ||
48 | */ | ||
46 | int (*get_pendown_state)(void); | 49 | int (*get_pendown_state)(void); |
47 | int (*filter_init) (struct ads7846_platform_data *pdata, | 50 | int (*filter_init) (struct ads7846_platform_data *pdata, |
48 | void **filter_data); | 51 | void **filter_data); |