aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx/bttv-input.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-input.c')
-rw-r--r--drivers/media/video/bt8xx/bttv-input.c32
1 files changed, 9 insertions, 23 deletions
diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c
index 6bf05a7dc5f9..eb71c3ae36de 100644
--- a/drivers/media/video/bt8xx/bttv-input.c
+++ b/drivers/media/video/bt8xx/bttv-input.c
@@ -38,8 +38,6 @@ module_param(repeat_period, int, 0644);
38 38
39static int ir_rc5_remote_gap = 885; 39static int ir_rc5_remote_gap = 885;
40module_param(ir_rc5_remote_gap, int, 0644); 40module_param(ir_rc5_remote_gap, int, 0644);
41static int ir_rc5_key_timeout = 200;
42module_param(ir_rc5_key_timeout, int, 0644);
43 41
44#undef dprintk 42#undef dprintk
45#define dprintk(arg...) do { \ 43#define dprintk(arg...) do { \
@@ -74,18 +72,17 @@ static void ir_handle_key(struct bttv *btv)
74 (gpio & ir->mask_keydown) ? " down" : "", 72 (gpio & ir->mask_keydown) ? " down" : "",
75 (gpio & ir->mask_keyup) ? " up" : ""); 73 (gpio & ir->mask_keyup) ? " up" : "");
76 74
77 if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) || 75 if ((ir->mask_keydown && (gpio & ir->mask_keydown)) ||
78 (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) { 76 (ir->mask_keyup && !(gpio & ir->mask_keyup))) {
79 ir_input_keydown(ir->dev, &ir->ir, data); 77 ir_keydown_notimeout(ir->dev, data, 0);
80 } else { 78 } else {
81 /* HACK: Probably, ir->mask_keydown is missing 79 /* HACK: Probably, ir->mask_keydown is missing
82 for this board */ 80 for this board */
83 if (btv->c.type == BTTV_BOARD_WINFAST2000) 81 if (btv->c.type == BTTV_BOARD_WINFAST2000)
84 ir_input_keydown(ir->dev, &ir->ir, data); 82 ir_keydown_notimeout(ir->dev, data, 0);
85 83
86 ir_input_nokey(ir->dev,&ir->ir); 84 ir_keyup(ir->dev);
87 } 85 }
88
89} 86}
90 87
91static void ir_enltv_handle_key(struct bttv *btv) 88static void ir_enltv_handle_key(struct bttv *btv)
@@ -107,9 +104,9 @@ static void ir_enltv_handle_key(struct bttv *btv)
107 gpio, data, 104 gpio, data,
108 (gpio & ir->mask_keyup) ? " up" : "up/down"); 105 (gpio & ir->mask_keyup) ? " up" : "up/down");
109 106
110 ir_input_keydown(ir->dev, &ir->ir, data); 107 ir_keydown_notimeout(ir->dev, data, 0);
111 if (keyup) 108 if (keyup)
112 ir_input_nokey(ir->dev, &ir->ir); 109 ir_keyup(ir->dev);
113 } else { 110 } else {
114 if ((ir->last_gpio & 1 << 31) == keyup) 111 if ((ir->last_gpio & 1 << 31) == keyup)
115 return; 112 return;
@@ -119,9 +116,9 @@ static void ir_enltv_handle_key(struct bttv *btv)
119 (gpio & ir->mask_keyup) ? " up" : "down"); 116 (gpio & ir->mask_keyup) ? " up" : "down");
120 117
121 if (keyup) 118 if (keyup)
122 ir_input_nokey(ir->dev, &ir->ir); 119 ir_keyup(ir->dev);
123 else 120 else
124 ir_input_keydown(ir->dev, &ir->ir, data); 121 ir_keydown_notimeout(ir->dev, data, 0);
125 } 122 }
126 123
127 ir->last_gpio = data | keyup; 124 ir->last_gpio = data | keyup;
@@ -215,14 +212,9 @@ static void bttv_ir_start(struct bttv *btv, struct card_ir *ir)
215 init_timer(&ir->timer_end); 212 init_timer(&ir->timer_end);
216 ir->timer_end.function = ir_rc5_timer_end; 213 ir->timer_end.function = ir_rc5_timer_end;
217 ir->timer_end.data = (unsigned long)ir; 214 ir->timer_end.data = (unsigned long)ir;
218
219 init_timer(&ir->timer_keyup);
220 ir->timer_keyup.function = ir_rc5_timer_keyup;
221 ir->timer_keyup.data = (unsigned long)ir;
222 ir->shift_by = 1; 215 ir->shift_by = 1;
223 ir->start = 3; 216 ir->start = 3;
224 ir->addr = 0x0; 217 ir->addr = 0x0;
225 ir->rc5_key_timeout = ir_rc5_key_timeout;
226 ir->rc5_remote_gap = ir_rc5_remote_gap; 218 ir->rc5_remote_gap = ir_rc5_remote_gap;
227 } 219 }
228} 220}
@@ -290,7 +282,6 @@ void __devinit init_bttv_i2c_ir(struct bttv *btv)
290 btv->init_data.name = "PV951"; 282 btv->init_data.name = "PV951";
291 btv->init_data.get_key = get_key_pv951; 283 btv->init_data.get_key = get_key_pv951;
292 btv->init_data.ir_codes = RC_MAP_PV951; 284 btv->init_data.ir_codes = RC_MAP_PV951;
293 btv->init_data.type = IR_TYPE_OTHER;
294 info.addr = 0x4b; 285 info.addr = 0x4b;
295 break; 286 break;
296 default: 287 default:
@@ -327,7 +318,6 @@ int bttv_input_init(struct bttv *btv)
327 struct card_ir *ir; 318 struct card_ir *ir;
328 char *ir_codes = NULL; 319 char *ir_codes = NULL;
329 struct input_dev *input_dev; 320 struct input_dev *input_dev;
330 u64 ir_type = IR_TYPE_OTHER;
331 int err = -ENOMEM; 321 int err = -ENOMEM;
332 322
333 if (!btv->has_remote) 323 if (!btv->has_remote)
@@ -448,10 +438,6 @@ int bttv_input_init(struct bttv *btv)
448 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", 438 snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0",
449 pci_name(btv->c.pci)); 439 pci_name(btv->c.pci));
450 440
451 err = ir_input_init(input_dev, &ir->ir, ir_type);
452 if (err < 0)
453 goto err_out_free;
454
455 input_dev->name = ir->name; 441 input_dev->name = ir->name;
456 input_dev->phys = ir->phys; 442 input_dev->phys = ir->phys;
457 input_dev->id.bustype = BUS_PCI; 443 input_dev->id.bustype = BUS_PCI;