Lines Matching full:ir

50 MODULE_PARM_DESC(ir_samplerate, "IR samplerate in kHz, 1 - 20, default 4");
53 module_param(ir_debug, int, 0644); /* debug level [IR] */
54 MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]");
58 printk(KERN_DEBUG "%s IR: " fmt, ir->core->name, ##arg);\
63 printk(KERN_DEBUG "cx88 IR: " fmt, ##arg); \
68 static void cx88_ir_handle_key(struct cx88_IR *ir)
70 struct cx88_core *core = ir->core;
74 gpio = cx_read(ir->gpio_addr);
107 if (ir->polling) {
108 if (ir->last_gpio == auxgpio)
110 ir->last_gpio = auxgpio;
114 data = ir_extract_bits(gpio, ir->mask_keycode);
117 ir->polling ? "poll" : "irq",
118 (gpio & ir->mask_keydown) ? " down" : "",
119 (gpio & ir->mask_keyup) ? " up" : "");
121 if (ir->core->boardnr == CX88_BOARD_NORWOOD_MICRO) {
126 rc_keydown(ir->dev, RC_PROTO_UNKNOWN, data, 0);
128 } else if (ir->core->boardnr == CX88_BOARD_PROLINK_PLAYTVPVR ||
129 ir->core->boardnr == CX88_BOARD_PIXELVIEW_PLAYTV_ULTRA_PRO) {
139 if (0 == (gpio & ir->mask_keyup))
140 rc_keydown_notimeout(ir->dev, RC_PROTO_NECX, scancode,
143 rc_keyup(ir->dev);
145 } else if (ir->mask_keydown) {
147 if (gpio & ir->mask_keydown)
148 rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data,
151 rc_keyup(ir->dev);
153 } else if (ir->mask_keyup) {
155 if (0 == (gpio & ir->mask_keyup))
156 rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data,
159 rc_keyup(ir->dev);
163 rc_keydown_notimeout(ir->dev, RC_PROTO_UNKNOWN, data, 0);
164 rc_keyup(ir->dev);
171 struct cx88_IR *ir = container_of(timer, struct cx88_IR, timer);
173 cx88_ir_handle_key(ir);
174 missed = hrtimer_forward_now(&ir->timer,
175 ktime_set(0, ir->polling * 1000000));
185 struct cx88_IR *ir;
187 if (!core || !core->ir)
190 ir = core->ir;
192 if (ir->polling) {
193 hrtimer_setup(&ir->timer, cx88_ir_work, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
194 hrtimer_start(&ir->timer,
195 ktime_set(0, ir->polling * 1000000),
198 if (ir->sampling) {
209 struct cx88_IR *ir;
211 if (!core || !core->ir)
214 ir = core->ir;
215 if (ir->sampling) {
220 if (ir->polling)
221 hrtimer_cancel(&ir->timer);
226 if (core->ir->users)
235 if (core->ir->users)
244 core->ir->users++;
252 core->ir->users--;
253 if (!core->ir->users)
261 struct cx88_IR *ir;
267 * used with a full-code IR table
270 ir = kzalloc(sizeof(*ir), GFP_KERNEL);
272 if (!ir || !dev)
275 ir->dev = dev;
283 ir->gpio_addr = MO_GP1_IO;
284 ir->mask_keycode = 0x1f;
285 ir->mask_keyup = 0x60;
286 ir->polling = 50; /* ms */
290 ir->sampling = 0xeb04; /* address */
304 ir->sampling = 1;
312 ir->gpio_addr = MO_GP0_IO;
313 ir->mask_keycode = 0x8f8;
314 ir->mask_keyup = 0x100;
315 ir->polling = 50; /* ms */
323 ir->gpio_addr = MO_GP0_IO;
324 ir->mask_keycode = 0x8f8;
325 ir->mask_keyup = 0x100;
326 ir->polling = 1; /* ms */
330 ir->gpio_addr = MO_GP0_IO;
331 ir->mask_keycode = 0xfd;
332 ir->mask_keydown = 0x02;
333 ir->polling = 5; /* ms */
340 * IR's with different address won't work. Still, there are
341 * other IR's from the same manufacturer that works, like the
346 ir->gpio_addr = MO_GP1_IO;
347 ir->mask_keyup = 0x80;
348 ir->polling = 10; /* ms */
354 ir->gpio_addr = MO_GP1_IO;
355 ir->mask_keycode = 0x3f;
356 ir->mask_keyup = 0x80;
357 ir->polling = 1; /* ms */
361 ir->gpio_addr = MO_GP1_IO;
362 ir->mask_keycode = 0x1f;
363 ir->mask_keyup = 0x60;
364 ir->polling = 1; /* ms */
368 ir->gpio_addr = MO_GP1_IO;
369 ir->mask_keycode = 0xbf;
370 ir->mask_keyup = 0x40;
371 ir->polling = 50; /* ms */
375 ir->gpio_addr = MO_GP1_IO;
376 ir->mask_keycode = 0x1f;
377 ir->mask_keyup = 0x40;
378 ir->polling = 1; /* ms */
383 ir->gpio_addr = MO_GP2_IO;
384 ir->mask_keycode = 0xfb;
385 ir->mask_keydown = 0x02;
386 ir->polling = 50; /* ms */
396 ir->sampling = 0xff00; /* address */
402 ir->sampling = 0xff00; /* address */
406 ir->sampling = 0xff00; /* address */
410 ir->gpio_addr = MO_GP1_IO;
411 ir->mask_keycode = 0x0e;
412 ir->mask_keyup = 0x80;
413 ir->polling = 50; /* ms */
417 ir->gpio_addr = MO_GP0_IO;
418 ir->mask_keycode = 0xfa;
419 ir->polling = 50; /* ms */
423 ir->sampling = 1;
427 ir->gpio_addr = MO_GP2_IO;
428 ir->mask_keycode = 0x7e;
429 ir->polling = 100; /* ms */
433 ir->sampling = 0xff00; /* address */
447 * the full scancodes, since it allows replacing the IR remote by
454 if (hardware_mask && !ir->mask_keycode)
455 ir->mask_keycode = hardware_mask;
458 snprintf(ir->name, sizeof(ir->name), "cx88 IR (%s)", core->board.name);
459 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci));
461 dev->device_name = ir->name;
462 dev->input_phys = ir->phys;
480 if (ir->sampling) {
487 ir->core = core;
488 core->ir = ir;
499 core->ir = NULL;
500 kfree(ir);
506 struct cx88_IR *ir = core->ir;
509 if (!ir)
513 rc_unregister_device(ir->dev);
514 kfree(ir);
517 core->ir = NULL;
525 struct cx88_IR *ir = core->ir;
530 if (!ir || !ir->sampling)
540 if (samples == 0xff && ir->dev->idle)
547 ir_raw_event_store_with_filter(ir->dev, &ev);
550 ir_raw_event_handle(ir->dev);
553 static int get_key_pvr2000(struct IR_i2c *ir, enum rc_proto *protocol,
558 /* poll IR chip */
559 flags = i2c_smbus_read_byte_data(ir->c, 0x10);
569 code = i2c_smbus_read_byte_data(ir->c, 0x00);
575 dprintk("IR Key/Flags: (0x%02x/0x%02x)\n",
597 /* Instantiate the IR receiver device, if present */
649 MODULE_DESCRIPTION("input driver for cx88 GPIO-based IR remote controls");