diff options
author | Ricardo Cerqueira <v4l@cerqueira.org> | 2006-01-23 06:42:06 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-01-23 06:42:06 -0500 |
commit | 4c0f631e14b849782259519c749414b1f1ddbfa8 (patch) | |
tree | 7976453534a7785899a71bc6cd574e5c7ebc3a95 /drivers/media/common | |
parent | bf47e4e43e4dcf88fef61b1b4139ce2da20e1f73 (diff) |
V4L/DVB (3393): Move all IR keymaps to ir-common module
- All the keymaps have the same structure, and can be shared between different
chips, so it makes no sense having them scattered between the input files.
This aggregates them all at ir-common module.
- Added new Hauppauge remote (Hauppauge grey), contributed by J.O. Aho
<trizt@iname.com> (with some small changes)
Changed KEY_KPx (keypad numerals) references to KEY_x, to avoid problems
when NumLock is off (suggested by Peter Missel <peter.missel@onlinehome.de>)
- Some cleanups at IR code
Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/common')
-rw-r--r-- | drivers/media/common/Makefile | 1 | ||||
-rw-r--r-- | drivers/media/common/ir-common.c | 519 | ||||
-rw-r--r-- | drivers/media/common/ir-keymaps.c | 1537 |
3 files changed, 1538 insertions, 519 deletions
diff --git a/drivers/media/common/Makefile b/drivers/media/common/Makefile index bd458cb9b4ea..61b89617a967 100644 --- a/drivers/media/common/Makefile +++ b/drivers/media/common/Makefile | |||
@@ -1,5 +1,6 @@ | |||
1 | saa7146-objs := saa7146_i2c.o saa7146_core.o | 1 | saa7146-objs := saa7146_i2c.o saa7146_core.o |
2 | saa7146_vv-objs := saa7146_vv_ksyms.o saa7146_fops.o saa7146_video.o saa7146_hlp.o saa7146_vbi.o | 2 | saa7146_vv-objs := saa7146_vv_ksyms.o saa7146_fops.o saa7146_video.o saa7146_hlp.o saa7146_vbi.o |
3 | ir-common-objs := ir-functions.o ir-keymaps.o | ||
3 | 4 | ||
4 | obj-$(CONFIG_VIDEO_SAA7146) += saa7146.o | 5 | obj-$(CONFIG_VIDEO_SAA7146) += saa7146.o |
5 | obj-$(CONFIG_VIDEO_SAA7146_VV) += saa7146_vv.o | 6 | obj-$(CONFIG_VIDEO_SAA7146_VV) += saa7146_vv.o |
diff --git a/drivers/media/common/ir-common.c b/drivers/media/common/ir-common.c deleted file mode 100644 index 97fa3fc571c4..000000000000 --- a/drivers/media/common/ir-common.c +++ /dev/null | |||
@@ -1,519 +0,0 @@ | |||
1 | /* | ||
2 | * | ||
3 | * some common structs and functions to handle infrared remotes via | ||
4 | * input layer ... | ||
5 | * | ||
6 | * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #include <linux/module.h> | ||
24 | #include <linux/moduleparam.h> | ||
25 | #include <linux/string.h> | ||
26 | #include <media/ir-common.h> | ||
27 | |||
28 | /* -------------------------------------------------------------------------- */ | ||
29 | |||
30 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); | ||
31 | MODULE_LICENSE("GPL"); | ||
32 | |||
33 | static int repeat = 1; | ||
34 | module_param(repeat, int, 0444); | ||
35 | MODULE_PARM_DESC(repeat,"auto-repeat for IR keys (default: on)"); | ||
36 | |||
37 | static int debug = 0; /* debug level (0,1,2) */ | ||
38 | module_param(debug, int, 0644); | ||
39 | |||
40 | #define dprintk(level, fmt, arg...) if (debug >= level) \ | ||
41 | printk(KERN_DEBUG fmt , ## arg) | ||
42 | |||
43 | /* -------------------------------------------------------------------------- */ | ||
44 | |||
45 | /* generic RC5 keytable */ | ||
46 | /* see http://users.pandora.be/nenya/electronics/rc5/codes00.htm */ | ||
47 | /* used by old (black) Hauppauge remotes */ | ||
48 | IR_KEYTAB_TYPE ir_codes_rc5_tv[IR_KEYTAB_SIZE] = { | ||
49 | /* Keys 0 to 9 */ | ||
50 | [ 0x00 ] = KEY_KP0, | ||
51 | [ 0x01 ] = KEY_KP1, | ||
52 | [ 0x02 ] = KEY_KP2, | ||
53 | [ 0x03 ] = KEY_KP3, | ||
54 | [ 0x04 ] = KEY_KP4, | ||
55 | [ 0x05 ] = KEY_KP5, | ||
56 | [ 0x06 ] = KEY_KP6, | ||
57 | [ 0x07 ] = KEY_KP7, | ||
58 | [ 0x08 ] = KEY_KP8, | ||
59 | [ 0x09 ] = KEY_KP9, | ||
60 | |||
61 | [ 0x0b ] = KEY_CHANNEL, /* channel / program (japan: 11) */ | ||
62 | [ 0x0c ] = KEY_POWER, /* standby */ | ||
63 | [ 0x0d ] = KEY_MUTE, /* mute / demute */ | ||
64 | [ 0x0f ] = KEY_TV, /* display */ | ||
65 | [ 0x10 ] = KEY_VOLUMEUP, | ||
66 | [ 0x11 ] = KEY_VOLUMEDOWN, | ||
67 | [ 0x12 ] = KEY_BRIGHTNESSUP, | ||
68 | [ 0x13 ] = KEY_BRIGHTNESSDOWN, | ||
69 | [ 0x1e ] = KEY_SEARCH, /* search + */ | ||
70 | [ 0x20 ] = KEY_CHANNELUP, /* channel / program + */ | ||
71 | [ 0x21 ] = KEY_CHANNELDOWN, /* channel / program - */ | ||
72 | [ 0x22 ] = KEY_CHANNEL, /* alt / channel */ | ||
73 | [ 0x23 ] = KEY_LANGUAGE, /* 1st / 2nd language */ | ||
74 | [ 0x26 ] = KEY_SLEEP, /* sleeptimer */ | ||
75 | [ 0x2e ] = KEY_MENU, /* 2nd controls (USA: menu) */ | ||
76 | [ 0x30 ] = KEY_PAUSE, | ||
77 | [ 0x32 ] = KEY_REWIND, | ||
78 | [ 0x33 ] = KEY_GOTO, | ||
79 | [ 0x35 ] = KEY_PLAY, | ||
80 | [ 0x36 ] = KEY_STOP, | ||
81 | [ 0x37 ] = KEY_RECORD, /* recording */ | ||
82 | [ 0x3c ] = KEY_TEXT, /* teletext submode (Japan: 12) */ | ||
83 | [ 0x3d ] = KEY_SUSPEND, /* system standby */ | ||
84 | |||
85 | }; | ||
86 | EXPORT_SYMBOL_GPL(ir_codes_rc5_tv); | ||
87 | |||
88 | /* Table for Leadtek Winfast Remote Controls - used by both bttv and cx88 */ | ||
89 | IR_KEYTAB_TYPE ir_codes_winfast[IR_KEYTAB_SIZE] = { | ||
90 | /* Keys 0 to 9 */ | ||
91 | [ 18 ] = KEY_KP0, | ||
92 | [ 5 ] = KEY_KP1, | ||
93 | [ 6 ] = KEY_KP2, | ||
94 | [ 7 ] = KEY_KP3, | ||
95 | [ 9 ] = KEY_KP4, | ||
96 | [ 10 ] = KEY_KP5, | ||
97 | [ 11 ] = KEY_KP6, | ||
98 | [ 13 ] = KEY_KP7, | ||
99 | [ 14 ] = KEY_KP8, | ||
100 | [ 15 ] = KEY_KP9, | ||
101 | |||
102 | [ 0 ] = KEY_POWER, | ||
103 | [ 2 ] = KEY_TUNER, /* TV/FM */ | ||
104 | [ 30 ] = KEY_VIDEO, | ||
105 | [ 4 ] = KEY_VOLUMEUP, | ||
106 | [ 8 ] = KEY_VOLUMEDOWN, | ||
107 | [ 12 ] = KEY_CHANNELUP, | ||
108 | [ 16 ] = KEY_CHANNELDOWN, | ||
109 | [ 3 ] = KEY_ZOOM, /* fullscreen */ | ||
110 | [ 31 ] = KEY_SUBTITLE, /* closed caption/teletext */ | ||
111 | [ 32 ] = KEY_SLEEP, | ||
112 | [ 20 ] = KEY_MUTE, | ||
113 | [ 43 ] = KEY_RED, | ||
114 | [ 44 ] = KEY_GREEN, | ||
115 | [ 45 ] = KEY_YELLOW, | ||
116 | [ 46 ] = KEY_BLUE, | ||
117 | [ 24 ] = KEY_KPPLUS, /* fine tune + */ | ||
118 | [ 25 ] = KEY_KPMINUS, /* fine tune - */ | ||
119 | [ 33 ] = KEY_KPDOT, | ||
120 | [ 19 ] = KEY_KPENTER, | ||
121 | [ 34 ] = KEY_BACK, | ||
122 | [ 35 ] = KEY_PLAYPAUSE, | ||
123 | [ 36 ] = KEY_NEXT, | ||
124 | [ 38 ] = KEY_STOP, | ||
125 | [ 39 ] = KEY_RECORD | ||
126 | }; | ||
127 | EXPORT_SYMBOL_GPL(ir_codes_winfast); | ||
128 | |||
129 | IR_KEYTAB_TYPE ir_codes_pinnacle[IR_KEYTAB_SIZE] = { | ||
130 | [ 0x59 ] = KEY_MUTE, | ||
131 | [ 0x4a ] = KEY_POWER, | ||
132 | |||
133 | [ 0x18 ] = KEY_TEXT, | ||
134 | [ 0x26 ] = KEY_TV, | ||
135 | [ 0x3d ] = KEY_PRINT, | ||
136 | |||
137 | [ 0x48 ] = KEY_RED, | ||
138 | [ 0x04 ] = KEY_GREEN, | ||
139 | [ 0x11 ] = KEY_YELLOW, | ||
140 | [ 0x00 ] = KEY_BLUE, | ||
141 | |||
142 | [ 0x2d ] = KEY_VOLUMEUP, | ||
143 | [ 0x1e ] = KEY_VOLUMEDOWN, | ||
144 | |||
145 | [ 0x49 ] = KEY_MENU, | ||
146 | |||
147 | [ 0x16 ] = KEY_CHANNELUP, | ||
148 | [ 0x17 ] = KEY_CHANNELDOWN, | ||
149 | |||
150 | [ 0x20 ] = KEY_UP, | ||
151 | [ 0x21 ] = KEY_DOWN, | ||
152 | [ 0x22 ] = KEY_LEFT, | ||
153 | [ 0x23 ] = KEY_RIGHT, | ||
154 | [ 0x0d ] = KEY_SELECT, | ||
155 | |||
156 | |||
157 | |||
158 | [ 0x08 ] = KEY_BACK, | ||
159 | [ 0x07 ] = KEY_REFRESH, | ||
160 | |||
161 | [ 0x2f ] = KEY_ZOOM, | ||
162 | [ 0x29 ] = KEY_RECORD, | ||
163 | |||
164 | [ 0x4b ] = KEY_PAUSE, | ||
165 | [ 0x4d ] = KEY_REWIND, | ||
166 | [ 0x2e ] = KEY_PLAY, | ||
167 | [ 0x4e ] = KEY_FORWARD, | ||
168 | [ 0x53 ] = KEY_PREVIOUS, | ||
169 | [ 0x4c ] = KEY_STOP, | ||
170 | [ 0x54 ] = KEY_NEXT, | ||
171 | |||
172 | [ 0x69 ] = KEY_KP0, | ||
173 | [ 0x6a ] = KEY_KP1, | ||
174 | [ 0x6b ] = KEY_KP2, | ||
175 | [ 0x6c ] = KEY_KP3, | ||
176 | [ 0x6d ] = KEY_KP4, | ||
177 | [ 0x6e ] = KEY_KP5, | ||
178 | [ 0x6f ] = KEY_KP6, | ||
179 | [ 0x70 ] = KEY_KP7, | ||
180 | [ 0x71 ] = KEY_KP8, | ||
181 | [ 0x72 ] = KEY_KP9, | ||
182 | |||
183 | [ 0x74 ] = KEY_CHANNEL, | ||
184 | [ 0x0a ] = KEY_BACKSPACE, | ||
185 | }; | ||
186 | |||
187 | EXPORT_SYMBOL_GPL(ir_codes_pinnacle); | ||
188 | |||
189 | /* empty keytable, can be used as placeholder for not-yet created keytables */ | ||
190 | IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE] = { | ||
191 | [ 42 ] = KEY_COFFEE, | ||
192 | }; | ||
193 | EXPORT_SYMBOL_GPL(ir_codes_empty); | ||
194 | |||
195 | /* Hauppauge: the newer, gray remotes (seems there are multiple | ||
196 | * slightly different versions), shipped with cx88+ivtv cards. | ||
197 | * almost rc5 coding, but some non-standard keys */ | ||
198 | IR_KEYTAB_TYPE ir_codes_hauppauge_new[IR_KEYTAB_SIZE] = { | ||
199 | /* Keys 0 to 9 */ | ||
200 | [ 0x00 ] = KEY_KP0, | ||
201 | [ 0x01 ] = KEY_KP1, | ||
202 | [ 0x02 ] = KEY_KP2, | ||
203 | [ 0x03 ] = KEY_KP3, | ||
204 | [ 0x04 ] = KEY_KP4, | ||
205 | [ 0x05 ] = KEY_KP5, | ||
206 | [ 0x06 ] = KEY_KP6, | ||
207 | [ 0x07 ] = KEY_KP7, | ||
208 | [ 0x08 ] = KEY_KP8, | ||
209 | [ 0x09 ] = KEY_KP9, | ||
210 | |||
211 | [ 0x0a ] = KEY_TEXT, /* keypad asterisk as well */ | ||
212 | [ 0x0b ] = KEY_RED, /* red button */ | ||
213 | [ 0x0c ] = KEY_RADIO, | ||
214 | [ 0x0d ] = KEY_MENU, | ||
215 | [ 0x0e ] = KEY_SUBTITLE, /* also the # key */ | ||
216 | [ 0x0f ] = KEY_MUTE, | ||
217 | [ 0x10 ] = KEY_VOLUMEUP, | ||
218 | [ 0x11 ] = KEY_VOLUMEDOWN, | ||
219 | [ 0x12 ] = KEY_PREVIOUS, /* previous channel */ | ||
220 | [ 0x14 ] = KEY_UP, | ||
221 | [ 0x15 ] = KEY_DOWN, | ||
222 | [ 0x16 ] = KEY_LEFT, | ||
223 | [ 0x17 ] = KEY_RIGHT, | ||
224 | [ 0x18 ] = KEY_VIDEO, /* Videos */ | ||
225 | [ 0x19 ] = KEY_AUDIO, /* Music */ | ||
226 | /* 0x1a: Pictures - presume this means | ||
227 | "Multimedia Home Platform" - | ||
228 | no "PICTURES" key in input.h | ||
229 | */ | ||
230 | [ 0x1a ] = KEY_MHP, | ||
231 | |||
232 | [ 0x1b ] = KEY_EPG, /* Guide */ | ||
233 | [ 0x1c ] = KEY_TV, | ||
234 | [ 0x1e ] = KEY_NEXTSONG, /* skip >| */ | ||
235 | [ 0x1f ] = KEY_EXIT, /* back/exit */ | ||
236 | [ 0x20 ] = KEY_CHANNELUP, /* channel / program + */ | ||
237 | [ 0x21 ] = KEY_CHANNELDOWN, /* channel / program - */ | ||
238 | [ 0x22 ] = KEY_CHANNEL, /* source (old black remote) */ | ||
239 | [ 0x24 ] = KEY_PREVIOUSSONG, /* replay |< */ | ||
240 | [ 0x25 ] = KEY_ENTER, /* OK */ | ||
241 | [ 0x26 ] = KEY_SLEEP, /* minimize (old black remote) */ | ||
242 | [ 0x29 ] = KEY_BLUE, /* blue key */ | ||
243 | [ 0x2e ] = KEY_GREEN, /* green button */ | ||
244 | [ 0x30 ] = KEY_PAUSE, /* pause */ | ||
245 | [ 0x32 ] = KEY_REWIND, /* backward << */ | ||
246 | [ 0x34 ] = KEY_FASTFORWARD, /* forward >> */ | ||
247 | [ 0x35 ] = KEY_PLAY, | ||
248 | [ 0x36 ] = KEY_STOP, | ||
249 | [ 0x37 ] = KEY_RECORD, /* recording */ | ||
250 | [ 0x38 ] = KEY_YELLOW, /* yellow key */ | ||
251 | [ 0x3b ] = KEY_SELECT, /* top right button */ | ||
252 | [ 0x3c ] = KEY_ZOOM, /* full */ | ||
253 | [ 0x3d ] = KEY_POWER, /* system power (green button) */ | ||
254 | }; | ||
255 | EXPORT_SYMBOL(ir_codes_hauppauge_new); | ||
256 | |||
257 | IR_KEYTAB_TYPE ir_codes_pixelview[IR_KEYTAB_SIZE] = { | ||
258 | [ 2 ] = KEY_KP0, | ||
259 | [ 1 ] = KEY_KP1, | ||
260 | [ 11 ] = KEY_KP2, | ||
261 | [ 27 ] = KEY_KP3, | ||
262 | [ 5 ] = KEY_KP4, | ||
263 | [ 9 ] = KEY_KP5, | ||
264 | [ 21 ] = KEY_KP6, | ||
265 | [ 6 ] = KEY_KP7, | ||
266 | [ 10 ] = KEY_KP8, | ||
267 | [ 18 ] = KEY_KP9, | ||
268 | |||
269 | [ 3 ] = KEY_TUNER, /* TV/FM */ | ||
270 | [ 7 ] = KEY_SEARCH, /* scan */ | ||
271 | [ 28 ] = KEY_ZOOM, /* full screen */ | ||
272 | [ 30 ] = KEY_POWER, | ||
273 | [ 23 ] = KEY_VOLUMEDOWN, | ||
274 | [ 31 ] = KEY_VOLUMEUP, | ||
275 | [ 20 ] = KEY_CHANNELDOWN, | ||
276 | [ 22 ] = KEY_CHANNELUP, | ||
277 | [ 24 ] = KEY_MUTE, | ||
278 | |||
279 | [ 0 ] = KEY_LIST, /* source */ | ||
280 | [ 19 ] = KEY_INFO, /* loop */ | ||
281 | [ 16 ] = KEY_LAST, /* +100 */ | ||
282 | [ 13 ] = KEY_CLEAR, /* reset */ | ||
283 | [ 12 ] = BTN_RIGHT, /* fun++ */ | ||
284 | [ 4 ] = BTN_LEFT, /* fun-- */ | ||
285 | [ 14 ] = KEY_GOTO, /* function */ | ||
286 | [ 15 ] = KEY_STOP, /* freeze */ | ||
287 | }; | ||
288 | EXPORT_SYMBOL(ir_codes_pixelview); | ||
289 | |||
290 | /* -------------------------------------------------------------------------- */ | ||
291 | |||
292 | static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir) | ||
293 | { | ||
294 | if (KEY_RESERVED == ir->keycode) { | ||
295 | printk(KERN_INFO "%s: unknown key: key=0x%02x raw=0x%02x down=%d\n", | ||
296 | dev->name,ir->ir_key,ir->ir_raw,ir->keypressed); | ||
297 | return; | ||
298 | } | ||
299 | dprintk(1,"%s: key event code=%d down=%d\n", | ||
300 | dev->name,ir->keycode,ir->keypressed); | ||
301 | input_report_key(dev,ir->keycode,ir->keypressed); | ||
302 | input_sync(dev); | ||
303 | } | ||
304 | |||
305 | /* -------------------------------------------------------------------------- */ | ||
306 | |||
307 | void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | ||
308 | int ir_type, IR_KEYTAB_TYPE *ir_codes) | ||
309 | { | ||
310 | int i; | ||
311 | |||
312 | ir->ir_type = ir_type; | ||
313 | if (ir_codes) | ||
314 | memcpy(ir->ir_codes, ir_codes, sizeof(ir->ir_codes)); | ||
315 | |||
316 | |||
317 | dev->keycode = ir->ir_codes; | ||
318 | dev->keycodesize = sizeof(IR_KEYTAB_TYPE); | ||
319 | dev->keycodemax = IR_KEYTAB_SIZE; | ||
320 | for (i = 0; i < IR_KEYTAB_SIZE; i++) | ||
321 | set_bit(ir->ir_codes[i], dev->keybit); | ||
322 | clear_bit(0, dev->keybit); | ||
323 | |||
324 | set_bit(EV_KEY, dev->evbit); | ||
325 | if (repeat) | ||
326 | set_bit(EV_REP, dev->evbit); | ||
327 | } | ||
328 | |||
329 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir) | ||
330 | { | ||
331 | if (ir->keypressed) { | ||
332 | ir->keypressed = 0; | ||
333 | ir_input_key_event(dev,ir); | ||
334 | } | ||
335 | } | ||
336 | |||
337 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, | ||
338 | u32 ir_key, u32 ir_raw) | ||
339 | { | ||
340 | u32 keycode = IR_KEYCODE(ir->ir_codes, ir_key); | ||
341 | |||
342 | if (ir->keypressed && ir->keycode != keycode) { | ||
343 | ir->keypressed = 0; | ||
344 | ir_input_key_event(dev,ir); | ||
345 | } | ||
346 | if (!ir->keypressed) { | ||
347 | ir->ir_key = ir_key; | ||
348 | ir->ir_raw = ir_raw; | ||
349 | ir->keycode = keycode; | ||
350 | ir->keypressed = 1; | ||
351 | ir_input_key_event(dev,ir); | ||
352 | } | ||
353 | } | ||
354 | |||
355 | /* -------------------------------------------------------------------------- */ | ||
356 | |||
357 | u32 ir_extract_bits(u32 data, u32 mask) | ||
358 | { | ||
359 | int mbit, vbit; | ||
360 | u32 value; | ||
361 | |||
362 | value = 0; | ||
363 | vbit = 0; | ||
364 | for (mbit = 0; mbit < 32; mbit++) { | ||
365 | if (!(mask & ((u32)1 << mbit))) | ||
366 | continue; | ||
367 | if (data & ((u32)1 << mbit)) | ||
368 | value |= (1 << vbit); | ||
369 | vbit++; | ||
370 | } | ||
371 | return value; | ||
372 | } | ||
373 | |||
374 | static int inline getbit(u32 *samples, int bit) | ||
375 | { | ||
376 | return (samples[bit/32] & (1 << (31-(bit%32)))) ? 1 : 0; | ||
377 | } | ||
378 | |||
379 | /* sump raw samples for visual debugging ;) */ | ||
380 | int ir_dump_samples(u32 *samples, int count) | ||
381 | { | ||
382 | int i, bit, start; | ||
383 | |||
384 | printk(KERN_DEBUG "ir samples: "); | ||
385 | start = 0; | ||
386 | for (i = 0; i < count * 32; i++) { | ||
387 | bit = getbit(samples,i); | ||
388 | if (bit) | ||
389 | start = 1; | ||
390 | if (0 == start) | ||
391 | continue; | ||
392 | printk("%s", bit ? "#" : "_"); | ||
393 | } | ||
394 | printk("\n"); | ||
395 | return 0; | ||
396 | } | ||
397 | |||
398 | /* decode raw samples, pulse distance coding used by NEC remotes */ | ||
399 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high) | ||
400 | { | ||
401 | int i,last,bit,len; | ||
402 | u32 curBit; | ||
403 | u32 value; | ||
404 | |||
405 | /* find start burst */ | ||
406 | for (i = len = 0; i < count * 32; i++) { | ||
407 | bit = getbit(samples,i); | ||
408 | if (bit) { | ||
409 | len++; | ||
410 | } else { | ||
411 | if (len >= 29) | ||
412 | break; | ||
413 | len = 0; | ||
414 | } | ||
415 | } | ||
416 | |||
417 | /* start burst to short */ | ||
418 | if (len < 29) | ||
419 | return 0xffffffff; | ||
420 | |||
421 | /* find start silence */ | ||
422 | for (len = 0; i < count * 32; i++) { | ||
423 | bit = getbit(samples,i); | ||
424 | if (bit) { | ||
425 | break; | ||
426 | } else { | ||
427 | len++; | ||
428 | } | ||
429 | } | ||
430 | |||
431 | /* silence to short */ | ||
432 | if (len < 7) | ||
433 | return 0xffffffff; | ||
434 | |||
435 | /* go decoding */ | ||
436 | len = 0; | ||
437 | last = 1; | ||
438 | value = 0; curBit = 1; | ||
439 | for (; i < count * 32; i++) { | ||
440 | bit = getbit(samples,i); | ||
441 | if (last) { | ||
442 | if(bit) { | ||
443 | continue; | ||
444 | } else { | ||
445 | len = 1; | ||
446 | } | ||
447 | } else { | ||
448 | if (bit) { | ||
449 | if (len > (low + high) /2) | ||
450 | value |= curBit; | ||
451 | curBit <<= 1; | ||
452 | if (curBit == 1) | ||
453 | break; | ||
454 | } else { | ||
455 | len++; | ||
456 | } | ||
457 | } | ||
458 | last = bit; | ||
459 | } | ||
460 | |||
461 | return value; | ||
462 | } | ||
463 | |||
464 | /* decode raw samples, biphase coding, used by rc5 for example */ | ||
465 | int ir_decode_biphase(u32 *samples, int count, int low, int high) | ||
466 | { | ||
467 | int i,last,bit,len,flips; | ||
468 | u32 value; | ||
469 | |||
470 | /* find start bit (1) */ | ||
471 | for (i = 0; i < 32; i++) { | ||
472 | bit = getbit(samples,i); | ||
473 | if (bit) | ||
474 | break; | ||
475 | } | ||
476 | |||
477 | /* go decoding */ | ||
478 | len = 0; | ||
479 | flips = 0; | ||
480 | value = 1; | ||
481 | for (; i < count * 32; i++) { | ||
482 | if (len > high) | ||
483 | break; | ||
484 | if (flips > 1) | ||
485 | break; | ||
486 | last = bit; | ||
487 | bit = getbit(samples,i); | ||
488 | if (last == bit) { | ||
489 | len++; | ||
490 | continue; | ||
491 | } | ||
492 | if (len < low) { | ||
493 | len++; | ||
494 | flips++; | ||
495 | continue; | ||
496 | } | ||
497 | value <<= 1; | ||
498 | value |= bit; | ||
499 | flips = 0; | ||
500 | len = 1; | ||
501 | } | ||
502 | return value; | ||
503 | } | ||
504 | |||
505 | EXPORT_SYMBOL_GPL(ir_input_init); | ||
506 | EXPORT_SYMBOL_GPL(ir_input_nokey); | ||
507 | EXPORT_SYMBOL_GPL(ir_input_keydown); | ||
508 | |||
509 | EXPORT_SYMBOL_GPL(ir_extract_bits); | ||
510 | EXPORT_SYMBOL_GPL(ir_dump_samples); | ||
511 | EXPORT_SYMBOL_GPL(ir_decode_biphase); | ||
512 | EXPORT_SYMBOL_GPL(ir_decode_pulsedistance); | ||
513 | |||
514 | /* | ||
515 | * Local variables: | ||
516 | * c-basic-offset: 8 | ||
517 | * End: | ||
518 | */ | ||
519 | |||
diff --git a/drivers/media/common/ir-keymaps.c b/drivers/media/common/ir-keymaps.c new file mode 100644 index 000000000000..468f66013393 --- /dev/null +++ b/drivers/media/common/ir-keymaps.c | |||
@@ -0,0 +1,1537 @@ | |||
1 | /* | ||
2 | |||
3 | |||
4 | Keytables for supported remote controls. This file is part of | ||
5 | video4linux. | ||
6 | |||
7 | This program is free software; you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation; either version 2 of the License, or | ||
10 | (at your option) any later version. | ||
11 | |||
12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | ||
16 | |||
17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program; if not, write to the Free Software | ||
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | |||
21 | */ | ||
22 | #include <linux/module.h> | ||
23 | #include <linux/moduleparam.h> | ||
24 | |||
25 | #include <linux/input.h> | ||
26 | #include <media/ir-common.h> | ||
27 | |||
28 | /* empty keytable, can be used as placeholder for not-yet created keytables */ | ||
29 | IR_KEYTAB_TYPE ir_codes_empty[IR_KEYTAB_SIZE] = { | ||
30 | [ 0x2a ] = KEY_COFFEE, | ||
31 | }; | ||
32 | |||
33 | EXPORT_SYMBOL_GPL(ir_codes_empty); | ||
34 | |||
35 | IR_KEYTAB_TYPE ir_codes_avermedia[IR_KEYTAB_SIZE] = { | ||
36 | [ 0x22 ] = KEY_0, | ||
37 | [ 0x28 ] = KEY_1, | ||
38 | [ 0x18 ] = KEY_2, | ||
39 | [ 0x38 ] = KEY_3, | ||
40 | [ 0x24 ] = KEY_4, | ||
41 | [ 0x14 ] = KEY_5, | ||
42 | [ 0x34 ] = KEY_6, | ||
43 | [ 0x2c ] = KEY_7, | ||
44 | [ 0x1c ] = KEY_8, | ||
45 | [ 0x3c ] = KEY_9, | ||
46 | |||
47 | [ 0x30 ] = KEY_EJECTCD, // Unmarked on my controller | ||
48 | [ 0x00 ] = KEY_POWER, | ||
49 | [ 0x12 ] = BTN_LEFT, // DISPLAY/L | ||
50 | [ 0x32 ] = BTN_RIGHT, // LOOP/R | ||
51 | [ 0x0a ] = KEY_MUTE, | ||
52 | [ 0x26 ] = KEY_RECORD, | ||
53 | [ 0x16 ] = KEY_PAUSE, | ||
54 | [ 0x36 ] = KEY_STOP, | ||
55 | [ 0x1e ] = KEY_VOLUMEDOWN, | ||
56 | [ 0x3e ] = KEY_VOLUMEUP, | ||
57 | |||
58 | [ 0x20 ] = KEY_TUNER, // TV/FM | ||
59 | [ 0x10 ] = KEY_CD, | ||
60 | [ 0x08 ] = KEY_VIDEO, | ||
61 | [ 0x04 ] = KEY_AUDIO, | ||
62 | [ 0x0c ] = KEY_ZOOM, // full screen | ||
63 | [ 0x02 ] = KEY_INFO, // preview | ||
64 | [ 0x2a ] = KEY_SEARCH, // autoscan | ||
65 | [ 0x1a ] = KEY_STOP, // freeze | ||
66 | [ 0x3a ] = KEY_RECORD, // capture | ||
67 | [ 0x06 ] = KEY_PLAY, // unmarked | ||
68 | [ 0x2e ] = KEY_RED, // unmarked | ||
69 | [ 0x0e ] = KEY_GREEN, // unmarked | ||
70 | |||
71 | [ 0x21 ] = KEY_YELLOW, // unmarked | ||
72 | [ 0x11 ] = KEY_CHANNELDOWN, | ||
73 | [ 0x31 ] = KEY_CHANNELUP, | ||
74 | [ 0x01 ] = KEY_BLUE, // unmarked | ||
75 | }; | ||
76 | |||
77 | EXPORT_SYMBOL_GPL(ir_codes_avermedia); | ||
78 | |||
79 | /* Matt Jesson <dvb@jesson.eclipse.co.uk */ | ||
80 | IR_KEYTAB_TYPE ir_codes_avermedia_dvbt[IR_KEYTAB_SIZE] = { | ||
81 | [ 0x28 ] = KEY_0, //'0' / 'enter' | ||
82 | [ 0x22 ] = KEY_1, //'1' | ||
83 | [ 0x12 ] = KEY_2, //'2' / 'up arrow' | ||
84 | [ 0x32 ] = KEY_3, //'3' | ||
85 | [ 0x24 ] = KEY_4, //'4' / 'left arrow' | ||
86 | [ 0x14 ] = KEY_5, //'5' | ||
87 | [ 0x34 ] = KEY_6, //'6' / 'right arrow' | ||
88 | [ 0x26 ] = KEY_7, //'7' | ||
89 | [ 0x16 ] = KEY_8, //'8' / 'down arrow' | ||
90 | [ 0x36 ] = KEY_9, //'9' | ||
91 | |||
92 | [ 0x20 ] = KEY_LIST, // 'source' | ||
93 | [ 0x10 ] = KEY_TEXT, // 'teletext' | ||
94 | [ 0x00 ] = KEY_POWER, // 'power' | ||
95 | [ 0x04 ] = KEY_AUDIO, // 'audio' | ||
96 | [ 0x06 ] = KEY_ZOOM, // 'full screen' | ||
97 | [ 0x18 ] = KEY_VIDEO, // 'display' | ||
98 | [ 0x38 ] = KEY_SEARCH, // 'loop' | ||
99 | [ 0x08 ] = KEY_INFO, // 'preview' | ||
100 | [ 0x2a ] = KEY_REWIND, // 'backward <<' | ||
101 | [ 0x1a ] = KEY_FASTFORWARD, // 'forward >>' | ||
102 | [ 0x3a ] = KEY_RECORD, // 'capture' | ||
103 | [ 0x0a ] = KEY_MUTE, // 'mute' | ||
104 | [ 0x2c ] = KEY_RECORD, // 'record' | ||
105 | [ 0x1c ] = KEY_PAUSE, // 'pause' | ||
106 | [ 0x3c ] = KEY_STOP, // 'stop' | ||
107 | [ 0x0c ] = KEY_PLAY, // 'play' | ||
108 | [ 0x2e ] = KEY_RED, // 'red' | ||
109 | [ 0x01 ] = KEY_BLUE, // 'blue' / 'cancel' | ||
110 | [ 0x0e ] = KEY_YELLOW, // 'yellow' / 'ok' | ||
111 | [ 0x21 ] = KEY_GREEN, // 'green' | ||
112 | [ 0x11 ] = KEY_CHANNELDOWN, // 'channel -' | ||
113 | [ 0x31 ] = KEY_CHANNELUP, // 'channel +' | ||
114 | [ 0x1e ] = KEY_VOLUMEDOWN, // 'volume -' | ||
115 | [ 0x3e ] = KEY_VOLUMEUP, // 'volume +' | ||
116 | }; | ||
117 | |||
118 | EXPORT_SYMBOL_GPL(ir_codes_avermedia_dvbt); | ||
119 | |||
120 | /* Attila Kondoros <attila.kondoros@chello.hu> */ | ||
121 | IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE] = { | ||
122 | |||
123 | [ 0x01 ] = KEY_1, | ||
124 | [ 0x02 ] = KEY_2, | ||
125 | [ 0x03 ] = KEY_3, | ||
126 | [ 0x04 ] = KEY_4, | ||
127 | [ 0x05 ] = KEY_5, | ||
128 | [ 0x06 ] = KEY_6, | ||
129 | [ 0x07 ] = KEY_7, | ||
130 | [ 0x08 ] = KEY_8, | ||
131 | [ 0x09 ] = KEY_9, | ||
132 | [ 0x00 ] = KEY_0, | ||
133 | [ 0x17 ] = KEY_LAST, // +100 | ||
134 | [ 0x0a ] = KEY_LIST, // recall | ||
135 | |||
136 | |||
137 | [ 0x1c ] = KEY_TUNER, // TV/FM | ||
138 | [ 0x15 ] = KEY_SEARCH, // scan | ||
139 | [ 0x12 ] = KEY_POWER, // power | ||
140 | [ 0x1f ] = KEY_VOLUMEDOWN, // vol up | ||
141 | [ 0x1b ] = KEY_VOLUMEUP, // vol down | ||
142 | [ 0x1e ] = KEY_CHANNELDOWN, // chn up | ||
143 | [ 0x1a ] = KEY_CHANNELUP, // chn down | ||
144 | |||
145 | [ 0x11 ] = KEY_VIDEO, // video | ||
146 | [ 0x0f ] = KEY_ZOOM, // full screen | ||
147 | [ 0x13 ] = KEY_MUTE, // mute/unmute | ||
148 | [ 0x10 ] = KEY_TEXT, // min | ||
149 | |||
150 | [ 0x0d ] = KEY_STOP, // freeze | ||
151 | [ 0x0e ] = KEY_RECORD, // record | ||
152 | [ 0x1d ] = KEY_PLAYPAUSE, // stop | ||
153 | [ 0x19 ] = KEY_PLAY, // play | ||
154 | |||
155 | [ 0x16 ] = KEY_GOTO, // osd | ||
156 | [ 0x14 ] = KEY_REFRESH, // default | ||
157 | [ 0x0c ] = KEY_KPPLUS, // fine tune >>>> | ||
158 | [ 0x18 ] = KEY_KPMINUS // fine tune <<<< | ||
159 | }; | ||
160 | |||
161 | EXPORT_SYMBOL_GPL(ir_codes_apac_viewcomp); | ||
162 | |||
163 | /* ---------------------------------------------------------------------- */ | ||
164 | |||
165 | IR_KEYTAB_TYPE ir_codes_conceptronic[IR_KEYTAB_SIZE] = { | ||
166 | |||
167 | [ 0x1e ] = KEY_POWER, // power | ||
168 | [ 0x07 ] = KEY_MEDIA, // source | ||
169 | [ 0x1c ] = KEY_SEARCH, // scan | ||
170 | |||
171 | /* FIXME: duplicate keycodes? | ||
172 | * | ||
173 | * These four keys seem to share the same GPIO as CH+, CH-, <<< and >>> | ||
174 | * The GPIO values are | ||
175 | * 6397fb for both "Scan <" and "CH -", | ||
176 | * 639ffb for "Scan >" and "CH+", | ||
177 | * 6384fb for "Tune <" and "<<<", | ||
178 | * 638cfb for "Tune >" and ">>>", regardless of the mask. | ||
179 | * | ||
180 | * [ 0x17 ] = KEY_BACK, // fm scan << | ||
181 | * [ 0x1f ] = KEY_FORWARD, // fm scan >> | ||
182 | * | ||
183 | * [ 0x04 ] = KEY_LEFT, // fm tuning < | ||
184 | * [ 0x0c ] = KEY_RIGHT, // fm tuning > | ||
185 | * | ||
186 | * For now, these four keys are disabled. Pressing them will generate | ||
187 | * the CH+/CH-/<<</>>> events | ||
188 | */ | ||
189 | |||
190 | [ 0x03 ] = KEY_TUNER, // TV/FM | ||
191 | |||
192 | [ 0x00 ] = KEY_RECORD, | ||
193 | [ 0x08 ] = KEY_STOP, | ||
194 | [ 0x11 ] = KEY_PLAY, | ||
195 | |||
196 | [ 0x1a ] = KEY_PLAYPAUSE, // freeze | ||
197 | [ 0x19 ] = KEY_ZOOM, // zoom | ||
198 | [ 0x0f ] = KEY_TEXT, // min | ||
199 | |||
200 | [ 0x01 ] = KEY_1, | ||
201 | [ 0x0b ] = KEY_2, | ||
202 | [ 0x1b ] = KEY_3, | ||
203 | [ 0x05 ] = KEY_4, | ||
204 | [ 0x09 ] = KEY_5, | ||
205 | [ 0x15 ] = KEY_6, | ||
206 | [ 0x06 ] = KEY_7, | ||
207 | [ 0x0a ] = KEY_8, | ||
208 | [ 0x12 ] = KEY_9, | ||
209 | [ 0x02 ] = KEY_0, | ||
210 | [ 0x10 ] = KEY_LAST, // +100 | ||
211 | [ 0x13 ] = KEY_LIST, // recall | ||
212 | |||
213 | [ 0x1f ] = KEY_CHANNELUP, // chn down | ||
214 | [ 0x17 ] = KEY_CHANNELDOWN, // chn up | ||
215 | [ 0x16 ] = KEY_VOLUMEUP, // vol down | ||
216 | [ 0x14 ] = KEY_VOLUMEDOWN, // vol up | ||
217 | |||
218 | [ 0x04 ] = KEY_KPMINUS, // <<< | ||
219 | [ 0x0e ] = KEY_SETUP, // function | ||
220 | [ 0x0c ] = KEY_KPPLUS, // >>> | ||
221 | |||
222 | [ 0x0d ] = KEY_GOTO, // mts | ||
223 | [ 0x1d ] = KEY_REFRESH, // reset | ||
224 | [ 0x18 ] = KEY_MUTE // mute/unmute | ||
225 | }; | ||
226 | |||
227 | EXPORT_SYMBOL_GPL(ir_codes_conceptronic); | ||
228 | |||
229 | IR_KEYTAB_TYPE ir_codes_nebula[IR_KEYTAB_SIZE] = { | ||
230 | [ 0x00 ] = KEY_0, | ||
231 | [ 0x01 ] = KEY_1, | ||
232 | [ 0x02 ] = KEY_2, | ||
233 | [ 0x03 ] = KEY_3, | ||
234 | [ 0x04 ] = KEY_4, | ||
235 | [ 0x05 ] = KEY_5, | ||
236 | [ 0x06 ] = KEY_6, | ||
237 | [ 0x07 ] = KEY_7, | ||
238 | [ 0x08 ] = KEY_8, | ||
239 | [ 0x09 ] = KEY_9, | ||
240 | [ 0x0a ] = KEY_TV, | ||
241 | [ 0x0b ] = KEY_AUX, | ||
242 | [ 0x0c ] = KEY_DVD, | ||
243 | [ 0x0d ] = KEY_POWER, | ||
244 | [ 0x0e ] = KEY_MHP, /* labelled 'Picture' */ | ||
245 | [ 0x0f ] = KEY_AUDIO, | ||
246 | [ 0x10 ] = KEY_INFO, | ||
247 | [ 0x11 ] = KEY_F13, /* 16:9 */ | ||
248 | [ 0x12 ] = KEY_F14, /* 14:9 */ | ||
249 | [ 0x13 ] = KEY_EPG, | ||
250 | [ 0x14 ] = KEY_EXIT, | ||
251 | [ 0x15 ] = KEY_MENU, | ||
252 | [ 0x16 ] = KEY_UP, | ||
253 | [ 0x17 ] = KEY_DOWN, | ||
254 | [ 0x18 ] = KEY_LEFT, | ||
255 | [ 0x19 ] = KEY_RIGHT, | ||
256 | [ 0x1a ] = KEY_ENTER, | ||
257 | [ 0x1b ] = KEY_CHANNELUP, | ||
258 | [ 0x1c ] = KEY_CHANNELDOWN, | ||
259 | [ 0x1d ] = KEY_VOLUMEUP, | ||
260 | [ 0x1e ] = KEY_VOLUMEDOWN, | ||
261 | [ 0x1f ] = KEY_RED, | ||
262 | [ 0x20 ] = KEY_GREEN, | ||
263 | [ 0x21 ] = KEY_YELLOW, | ||
264 | [ 0x22 ] = KEY_BLUE, | ||
265 | [ 0x23 ] = KEY_SUBTITLE, | ||
266 | [ 0x24 ] = KEY_F15, /* AD */ | ||
267 | [ 0x25 ] = KEY_TEXT, | ||
268 | [ 0x26 ] = KEY_MUTE, | ||
269 | [ 0x27 ] = KEY_REWIND, | ||
270 | [ 0x28 ] = KEY_STOP, | ||
271 | [ 0x29 ] = KEY_PLAY, | ||
272 | [ 0x2a ] = KEY_FASTFORWARD, | ||
273 | [ 0x2b ] = KEY_F16, /* chapter */ | ||
274 | [ 0x2c ] = KEY_PAUSE, | ||
275 | [ 0x2d ] = KEY_PLAY, | ||
276 | [ 0x2e ] = KEY_RECORD, | ||
277 | [ 0x2f ] = KEY_F17, /* picture in picture */ | ||
278 | [ 0x30 ] = KEY_KPPLUS, /* zoom in */ | ||
279 | [ 0x31 ] = KEY_KPMINUS, /* zoom out */ | ||
280 | [ 0x32 ] = KEY_F18, /* capture */ | ||
281 | [ 0x33 ] = KEY_F19, /* web */ | ||
282 | [ 0x34 ] = KEY_EMAIL, | ||
283 | [ 0x35 ] = KEY_PHONE, | ||
284 | [ 0x36 ] = KEY_PC | ||
285 | }; | ||
286 | |||
287 | EXPORT_SYMBOL_GPL(ir_codes_nebula); | ||
288 | |||
289 | /* DigitalNow DNTV Live DVB-T Remote */ | ||
290 | IR_KEYTAB_TYPE ir_codes_dntv_live_dvb_t[IR_KEYTAB_SIZE] = { | ||
291 | [ 0x00 ] = KEY_ESC, /* 'go up a level?' */ | ||
292 | /* Keys 0 to 9 */ | ||
293 | [ 0x0a ] = KEY_0, | ||
294 | [ 0x01 ] = KEY_1, | ||
295 | [ 0x02 ] = KEY_2, | ||
296 | [ 0x03 ] = KEY_3, | ||
297 | [ 0x04 ] = KEY_4, | ||
298 | [ 0x05 ] = KEY_5, | ||
299 | [ 0x06 ] = KEY_6, | ||
300 | [ 0x07 ] = KEY_7, | ||
301 | [ 0x08 ] = KEY_8, | ||
302 | [ 0x09 ] = KEY_9, | ||
303 | |||
304 | [ 0x0b ] = KEY_TUNER, /* tv/fm */ | ||
305 | [ 0x0c ] = KEY_SEARCH, /* scan */ | ||
306 | [ 0x0d ] = KEY_STOP, | ||
307 | [ 0x0e ] = KEY_PAUSE, | ||
308 | [ 0x0f ] = KEY_LIST, /* source */ | ||
309 | |||
310 | [ 0x10 ] = KEY_MUTE, | ||
311 | [ 0x11 ] = KEY_REWIND, /* backward << */ | ||
312 | [ 0x12 ] = KEY_POWER, | ||
313 | [ 0x13 ] = KEY_S, /* snap */ | ||
314 | [ 0x14 ] = KEY_AUDIO, /* stereo */ | ||
315 | [ 0x15 ] = KEY_CLEAR, /* reset */ | ||
316 | [ 0x16 ] = KEY_PLAY, | ||
317 | [ 0x17 ] = KEY_ENTER, | ||
318 | [ 0x18 ] = KEY_ZOOM, /* full screen */ | ||
319 | [ 0x19 ] = KEY_FASTFORWARD, /* forward >> */ | ||
320 | [ 0x1a ] = KEY_CHANNELUP, | ||
321 | [ 0x1b ] = KEY_VOLUMEUP, | ||
322 | [ 0x1c ] = KEY_INFO, /* preview */ | ||
323 | [ 0x1d ] = KEY_RECORD, /* record */ | ||
324 | [ 0x1e ] = KEY_CHANNELDOWN, | ||
325 | [ 0x1f ] = KEY_VOLUMEDOWN, | ||
generated by cgit v1.2.2 (git 2.25.0) at 2024-12-25 03:33:38 -0500 |