• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/drivers/media/video/cx88/

Lines Matching defs:ir

33 #include <media/ir-core.h>
34 #include <media/ir-common.h>
71 printk(KERN_DEBUG "%s IR: " fmt , ir->core->name , ##arg)
75 static void cx88_ir_handle_key(struct cx88_IR *ir)
77 struct cx88_core *core = ir->core;
81 gpio = cx_read(ir->gpio_addr);
109 if (ir->polling) {
110 if (ir->last_gpio == auxgpio)
112 ir->last_gpio = auxgpio;
116 data = ir_extract_bits(gpio, ir->mask_keycode);
119 ir->polling ? "poll" : "irq",
120 (gpio & ir->mask_keydown) ? " down" : "",
121 (gpio & ir->mask_keyup) ? " up" : "");
123 if (ir->core->boardnr == CX88_BOARD_NORWOOD_MICRO) {
128 ir_keydown(ir->input, data, 0);
130 } else if (ir->mask_keydown) {
132 if (gpio & ir->mask_keydown)
133 ir_keydown(ir->input, data, 0);
135 } else if (ir->mask_keyup) {
137 if (0 == (gpio & ir->mask_keyup))
138 ir_keydown(ir->input, data, 0);
142 ir_keydown(ir->input, data, 0);
149 struct cx88_IR *ir = container_of(timer, struct cx88_IR, timer);
151 cx88_ir_handle_key(ir);
152 missed = hrtimer_forward_now(&ir->timer,
153 ktime_set(0, ir->polling * 1000000));
163 struct cx88_IR *ir;
165 if (!core || !core->ir)
168 ir = core->ir;
170 if (ir->polling) {
171 hrtimer_init(&ir->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
172 ir->timer.function = cx88_ir_work;
173 hrtimer_start(&ir->timer,
174 ktime_set(0, ir->polling * 1000000),
177 if (ir->sampling) {
188 struct cx88_IR *ir;
190 if (!core || !core->ir)
193 ir = core->ir;
194 if (ir->sampling) {
199 if (ir->polling)
200 hrtimer_cancel(&ir->timer);
205 if (core->ir->users)
213 if (core->ir->users)
221 core->ir->users++;
229 core->ir->users--;
230 if (!core->ir->users)
238 struct cx88_IR *ir;
247 ir = kzalloc(sizeof(*ir), GFP_KERNEL);
249 if (!ir || !input_dev)
252 ir->input = input_dev;
260 ir->gpio_addr = MO_GP1_IO;
261 ir->mask_keycode = 0x1f;
262 ir->mask_keyup = 0x60;
263 ir->polling = 50; /* ms */
268 ir->sampling = 0xeb04; /* address */
283 ir->sampling = 1;
289 ir->gpio_addr = MO_GP0_IO;
290 ir->mask_keycode = 0x8f8;
291 ir->mask_keyup = 0x100;
292 ir->polling = 50; /* ms */
298 ir->gpio_addr = MO_GP0_IO;
299 ir->mask_keycode = 0x8f8;
300 ir->mask_keyup = 0x100;
301 ir->polling = 1; /* ms */
305 ir->gpio_addr = MO_GP0_IO;
306 ir->mask_keycode = 0xfd;
307 ir->mask_keydown = 0x02;
308 ir->polling = 5; /* ms */
320 ir->gpio_addr = MO_GP1_IO;
321 ir->mask_keyup = 0x80;
322 ir->polling = 10; /* ms */
328 ir->gpio_addr = MO_GP1_IO;
329 ir->mask_keycode = 0x3f;
330 ir->mask_keyup = 0x80;
331 ir->polling = 1; /* ms */
335 ir->gpio_addr = MO_GP1_IO;
336 ir->mask_keycode = 0x1f;
337 ir->mask_keyup = 0x60;
338 ir->polling = 1; /* ms */
342 ir->gpio_addr = MO_GP1_IO;
343 ir->mask_keycode = 0xbf;
344 ir->mask_keyup = 0x40;
345 ir->polling = 50; /* ms */
349 ir->gpio_addr = MO_GP1_IO;
350 ir->mask_keycode = 0x1f;
351 ir->mask_keyup = 0x40;
352 ir->polling = 1; /* ms */
357 ir->gpio_addr = MO_GP2_IO;
358 ir->mask_keycode = 0xfb;
359 ir->mask_keydown = 0x02;
360 ir->polling = 50; /* ms */
371 ir->sampling = 0xff00; /* address */
377 ir->sampling = 0xff00; /* address */
382 ir->sampling = 0xff00; /* address */
386 ir->gpio_addr = MO_GP1_IO;
387 ir->mask_keycode = 0x0e;
388 ir->mask_keyup = 0x80;
389 ir->polling = 50; /* ms */
393 ir->gpio_addr = MO_GP0_IO;
394 ir->mask_keycode = 0xfa;
395 ir->polling = 50; /* ms */
400 ir->sampling = 1;
404 ir->gpio_addr = MO_GP2_IO;
405 ir->mask_keycode = 0x7e;
406 ir->polling = 100; /* ms */
427 if (hardware_mask && !ir->mask_keycode)
428 ir->mask_keycode = hardware_mask;
431 snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)", core->board.name);
432 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci));
434 ir->ir_type = ir_type;
436 input_dev->name = ir->name;
437 input_dev->phys = ir->phys;
449 ir->core = core;
450 core->ir = ir;
452 ir->props.priv = core;
453 ir->props.open = cx88_ir_open;
454 ir->props.close = cx88_ir_close;
455 ir->props.scanmask = hardware_mask;
458 err = ir_input_register(ir->input, ir_codes, &ir->props, MODULE_NAME);
465 core->ir = NULL;
466 kfree(ir);
472 struct cx88_IR *ir = core->ir;
475 if (NULL == ir)
479 ir_input_unregister(ir->input);
480 kfree(ir);
483 core->ir = NULL;
491 struct cx88_IR *ir = core->ir;
495 if (NULL == ir)
497 if (!ir->sampling)
503 if (ir->scount < ARRAY_SIZE(ir->samples))
504 ir->samples[ir->scount++] = samples;
507 if (!ir->scount) {
513 if (ir->scount < ARRAY_SIZE(ir->samples))
514 ir->samples[ir->scount++] = samples;
515 for (i = 0; i < ir->scount; i++)
516 ir->samples[i] = ~ir->samples[i];
518 ir_dump_samples(ir->samples, ir->scount);
533 ircode = ir_decode_pulsedistance(ir->samples, ir->scount, 1, 4);
544 ir_repeat(ir->input);
548 if ((ircode & 0xffff) != (ir->sampling & 0xffff)) { /* wrong address */
559 ir_keydown(ir->input, (ircode >> 16) & 0xff, 0);
572 ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
595 ir_keydown(ir->input, code, toggle);
598 ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
604 ir_keydown(ir->input, ircode & 0x3f, ircode & 0x0800 ? 1 : 0);
608 ir->scount = 0;