• Home
  • Raw
  • Download

Lines Matching full:ir

59 MODULE_PARM_DESC(ir_samplerate, "IR samplerate in kHz, 1 - 20, default 4");
62 module_param(ir_debug, int, 0644); /* debug level [IR] */
63 MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]");
67 printk(KERN_DEBUG "%s IR: " fmt, ir->core->name, ##arg);\
72 printk(KERN_DEBUG "cx88 IR: " fmt, ##arg); \
77 static void cx88_ir_handle_key(struct cx88_IR *ir) in cx88_ir_handle_key() argument
79 struct cx88_core *core = ir->core; in cx88_ir_handle_key()
83 gpio = cx_read(ir->gpio_addr); in cx88_ir_handle_key()
116 if (ir->polling) { in cx88_ir_handle_key()
117 if (ir->last_gpio == auxgpio) in cx88_ir_handle_key()
119 ir->last_gpio = auxgpio; in cx88_ir_handle_key()
123 data = ir_extract_bits(gpio, ir->mask_keycode); in cx88_ir_handle_key()
126 ir->polling ? "poll" : "irq", in cx88_ir_handle_key()
127 (gpio & ir->mask_keydown) ? " down" : "", in cx88_ir_handle_key()
128 (gpio & ir->mask_keyup) ? " up" : ""); in cx88_ir_handle_key()
130 if (ir->core->boardnr == CX88_BOARD_NORWOOD_MICRO) { in cx88_ir_handle_key()
135 rc_keydown(ir->dev, RC_PROTO_UNKNOWN, data, 0); in cx88_ir_handle_key()
137 } else if (ir->core->boardnr == CX88_BOARD_PROLINK_PLAYTVPVR || in cx88_ir_handle_key()
138 ir->core->boardnr == CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO) { in cx88_ir_handle_key()
148 if (0 == (gpio & ir->mask_keyup)) in cx88_ir_handle_key()
149 rc_keydown_notimeout(ir->dev, RC_PROTO_NECX, scancode, in cx88_ir_handle_key()
152 rc_keyup(ir->dev); in cx88_ir_handle_key()
154 } else if (ir->mask_keydown) { in cx88_ir_handle_key()
156 if (gpio & ir->mask_keydown) in cx88_ir_handle_key()
157 rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data, in cx88_ir_handle_key()
160 rc_keyup(ir->dev); in cx88_ir_handle_key()
162 } else if (ir->mask_keyup) { in cx88_ir_handle_key()
164 if (0 == (gpio & ir->mask_keyup)) in cx88_ir_handle_key()
165 rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data, in cx88_ir_handle_key()
168 rc_keyup(ir->dev); in cx88_ir_handle_key()
172 rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data, 0); in cx88_ir_handle_key()
173 rc_keyup(ir->dev); in cx88_ir_handle_key()
180 struct cx88_IR *ir = container_of(timer, struct cx88_IR, timer); in cx88_ir_work() local
182 cx88_ir_handle_key(ir); in cx88_ir_work()
183 missed = hrtimer_forward_now(&ir->timer, in cx88_ir_work()
184 ktime_set(0, ir->polling * 1000000)); in cx88_ir_work()
194 struct cx88_IR *ir; in __cx88_ir_start() local
196 if (!core || !core->ir) in __cx88_ir_start()
199 ir = core->ir; in __cx88_ir_start()
201 if (ir->polling) { in __cx88_ir_start()
202 hrtimer_init(&ir->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); in __cx88_ir_start()
203 ir->timer.function = cx88_ir_work; in __cx88_ir_start()
204 hrtimer_start(&ir->timer, in __cx88_ir_start()
205 ktime_set(0, ir->polling * 1000000), in __cx88_ir_start()
208 if (ir->sampling) { in __cx88_ir_start()
219 struct cx88_IR *ir; in __cx88_ir_stop() local
221 if (!core || !core->ir) in __cx88_ir_stop()
224 ir = core->ir; in __cx88_ir_stop()
225 if (ir->sampling) { in __cx88_ir_stop()
230 if (ir->polling) in __cx88_ir_stop()
231 hrtimer_cancel(&ir->timer); in __cx88_ir_stop()
236 if (core->ir->users) in cx88_ir_start()
245 if (core->ir->users) in cx88_ir_stop()
254 core->ir->users++; in cx88_ir_open()
262 core->ir->users--; in cx88_ir_close()
263 if (!core->ir->users) in cx88_ir_close()
271 struct cx88_IR *ir; in cx88_ir_init() local
277 * used with a full-code IR table in cx88_ir_init()
280 ir = kzalloc(sizeof(*ir), GFP_KERNEL); in cx88_ir_init()
282 if (!ir || !dev) in cx88_ir_init()
285 ir->dev = dev; in cx88_ir_init()
293 ir->gpio_addr = MO_GP1_IO; in cx88_ir_init()
294 ir->mask_keycode = 0x1f; in cx88_ir_init()
295 ir->mask_keyup = 0x60; in cx88_ir_init()
296 ir->polling = 50; /* ms */ in cx88_ir_init()
300 ir->sampling = 0xeb04; /* address */ in cx88_ir_init()
314 ir->sampling = 1; in cx88_ir_init()
322 ir->gpio_addr = MO_GP0_IO; in cx88_ir_init()
323 ir->mask_keycode = 0x8f8; in cx88_ir_init()
324 ir->mask_keyup = 0x100; in cx88_ir_init()
325 ir->polling = 50; /* ms */ in cx88_ir_init()
333 ir->gpio_addr = MO_GP0_IO; in cx88_ir_init()
334 ir->mask_keycode = 0x8f8; in cx88_ir_init()
335 ir->mask_keyup = 0x100; in cx88_ir_init()
336 ir->polling = 1; /* ms */ in cx88_ir_init()
340 ir->gpio_addr = MO_GP0_IO; in cx88_ir_init()
341 ir->mask_keycode = 0xfd; in cx88_ir_init()
342 ir->mask_keydown = 0x02; in cx88_ir_init()
343 ir->polling = 5; /* ms */ in cx88_ir_init()
350 * IR's with different address won't work. Still, there are in cx88_ir_init()
351 * other IR's from the same manufacturer that works, like the in cx88_ir_init()
356 ir->gpio_addr = MO_GP1_IO; in cx88_ir_init()
357 ir->mask_keyup = 0x80; in cx88_ir_init()
358 ir->polling = 10; /* ms */ in cx88_ir_init()
364 ir->gpio_addr = MO_GP1_IO; in cx88_ir_init()
365 ir->mask_keycode = 0x3f; in cx88_ir_init()
366 ir->mask_keyup = 0x80; in cx88_ir_init()
367 ir->polling = 1; /* ms */ in cx88_ir_init()
371 ir->gpio_addr = MO_GP1_IO; in cx88_ir_init()
372 ir->mask_keycode = 0x1f; in cx88_ir_init()
373 ir->mask_keyup = 0x60; in cx88_ir_init()
374 ir->polling = 1; /* ms */ in cx88_ir_init()
378 ir->gpio_addr = MO_GP1_IO; in cx88_ir_init()
379 ir->mask_keycode = 0xbf; in cx88_ir_init()
380 ir->mask_keyup = 0x40; in cx88_ir_init()
381 ir->polling = 50; /* ms */ in cx88_ir_init()
385 ir->gpio_addr = MO_GP1_IO; in cx88_ir_init()
386 ir->mask_keycode = 0x1f; in cx88_ir_init()
387 ir->mask_keyup = 0x40; in cx88_ir_init()
388 ir->polling = 1; /* ms */ in cx88_ir_init()
393 ir->gpio_addr = MO_GP2_IO; in cx88_ir_init()
394 ir->mask_keycode = 0xfb; in cx88_ir_init()
395 ir->mask_keydown = 0x02; in cx88_ir_init()
396 ir->polling = 50; /* ms */ in cx88_ir_init()
406 ir->sampling = 0xff00; /* address */ in cx88_ir_init()
412 ir->sampling = 0xff00; /* address */ in cx88_ir_init()
416 ir->sampling = 0xff00; /* address */ in cx88_ir_init()
420 ir->gpio_addr = MO_GP1_IO; in cx88_ir_init()
421 ir->mask_keycode = 0x0e; in cx88_ir_init()
422 ir->mask_keyup = 0x80; in cx88_ir_init()
423 ir->polling = 50; /* ms */ in cx88_ir_init()
427 ir->gpio_addr = MO_GP0_IO; in cx88_ir_init()
428 ir->mask_keycode = 0xfa; in cx88_ir_init()
429 ir->polling = 50; /* ms */ in cx88_ir_init()
433 ir->sampling = 1; in cx88_ir_init()
437 ir->gpio_addr = MO_GP2_IO; in cx88_ir_init()
438 ir->mask_keycode = 0x7e; in cx88_ir_init()
439 ir->polling = 100; /* ms */ in cx88_ir_init()
443 ir->sampling = 0xff00; /* address */ in cx88_ir_init()
457 * the full scancodes, since it allows replacing the IR remote by in cx88_ir_init()
464 if (hardware_mask && !ir->mask_keycode) in cx88_ir_init()
465 ir->mask_keycode = hardware_mask; in cx88_ir_init()
468 snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)", core->board.name); in cx88_ir_init()
469 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci)); in cx88_ir_init()
471 dev->device_name = ir->name; in cx88_ir_init()
472 dev->input_phys = ir->phys; in cx88_ir_init()
490 if (ir->sampling) { in cx88_ir_init()
497 ir->core = core; in cx88_ir_init()
498 core->ir = ir; in cx88_ir_init()
509 core->ir = NULL; in cx88_ir_init()
510 kfree(ir); in cx88_ir_init()
516 struct cx88_IR *ir = core->ir; in cx88_ir_fini() local
519 if (!ir) in cx88_ir_fini()
523 rc_unregister_device(ir->dev); in cx88_ir_fini()
524 kfree(ir); in cx88_ir_fini()
527 core->ir = NULL; in cx88_ir_fini()
535 struct cx88_IR *ir = core->ir; in cx88_ir_irq() local
540 if (!ir || !ir->sampling) in cx88_ir_irq()
550 if (samples == 0xff && ir->dev->idle) in cx88_ir_irq()
558 ir_raw_event_store_with_filter(ir->dev, &ev); in cx88_ir_irq()
561 ir_raw_event_handle(ir->dev); in cx88_ir_irq()
564 static int get_key_pvr2000(struct IR_i2c *ir, enum rc_proto *protocol, in get_key_pvr2000() argument
569 /* poll IR chip */ in get_key_pvr2000()
570 flags = i2c_smbus_read_byte_data(ir->c, 0x10); in get_key_pvr2000()
580 code = i2c_smbus_read_byte_data(ir->c, 0x00); in get_key_pvr2000()
586 dprintk("IR Key/Flags: (0x%02x/0x%02x)\n", in get_key_pvr2000()
608 /* Instantiate the IR receiver device, if present */ in cx88_i2c_init_ir()
660 MODULE_DESCRIPTION("input driver for cx88 GPIO-based IR remote controls");