diff options
author | Oliver Endriss <o.endriss@gmx.de> | 2005-09-09 16:03:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 16:57:46 -0400 |
commit | 03388ae30260475650bab24223151397afb72ec9 (patch) | |
tree | f393f529f904cc1d53c87221ef3ec383b5e5f2bc /drivers/media/dvb/ttpci/av7110.c | |
parent | 9a7b102e7f5ccb2826a81315abc89f95adaf4421 (diff) |
[PATCH] dvb: ttpci: av7110: RC5+ remote control support
Improved remote control support for av7110-based cards:
o extended rc5 protocol, firmware >= 0x2620 required
o key-up timer slightly adjusted
o completely moved remote control code to av7110_ir.c
o support for multiple ir receivers
o for now, all av7110 cards share the same ir configuration and event device
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/dvb/ttpci/av7110.c')
-rw-r--r-- | drivers/media/dvb/ttpci/av7110.c | 70 |
1 files changed, 7 insertions, 63 deletions
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c index 48e8097d8430..b5d40d424365 100644 --- a/drivers/media/dvb/ttpci/av7110.c +++ b/drivers/media/dvb/ttpci/av7110.c | |||
@@ -177,9 +177,6 @@ static void init_av7110_av(struct av7110 *av7110) | |||
177 | ret = av7110_set_volume(av7110, av7110->mixer.volume_left, av7110->mixer.volume_right); | 177 | ret = av7110_set_volume(av7110, av7110->mixer.volume_left, av7110->mixer.volume_right); |
178 | if (ret < 0) | 178 | if (ret < 0) |
179 | printk("dvb-ttpci:cannot set volume :%d\n",ret); | 179 | printk("dvb-ttpci:cannot set volume :%d\n",ret); |
180 | ret = av7110_setup_irc_config(av7110, 0); | ||
181 | if (ret < 0) | ||
182 | printk("dvb-ttpci:cannot setup irc config :%d\n",ret); | ||
183 | } | 180 | } |
184 | 181 | ||
185 | static void recover_arm(struct av7110 *av7110) | 182 | static void recover_arm(struct av7110 *av7110) |
@@ -265,60 +262,6 @@ static int arm_thread(void *data) | |||
265 | } | 262 | } |
266 | 263 | ||
267 | 264 | ||
268 | /** | ||
269 | * Hack! we save the last av7110 ptr. This should be ok, since | ||
270 | * you rarely will use more then one IR control. | ||
271 | * | ||
272 | * If we want to support multiple controls we would have to do much more... | ||
273 | */ | ||
274 | int av7110_setup_irc_config(struct av7110 *av7110, u32 ir_config) | ||
275 | { | ||
276 | int ret = 0; | ||
277 | static struct av7110 *last; | ||
278 | |||
279 | dprintk(4, "%p\n", av7110); | ||
280 | |||
281 | if (!av7110) | ||
282 | av7110 = last; | ||
283 | else | ||
284 | last = av7110; | ||
285 | |||
286 | if (av7110) { | ||
287 | ret = av7110_fw_cmd(av7110, COMTYPE_PIDFILTER, SetIR, 1, ir_config); | ||
288 | av7110->ir_config = ir_config; | ||
289 | } | ||
290 | return ret; | ||
291 | } | ||
292 | |||
293 | static void (*irc_handler)(u32); | ||
294 | |||
295 | void av7110_register_irc_handler(void (*func)(u32)) | ||
296 | { | ||
297 | dprintk(4, "registering %p\n", func); | ||
298 | irc_handler = func; | ||
299 | } | ||
300 | |||
301 | void av7110_unregister_irc_handler(void (*func)(u32)) | ||
302 | { | ||
303 | dprintk(4, "unregistering %p\n", func); | ||
304 | irc_handler = NULL; | ||
305 | } | ||
306 | |||
307 | static void run_handlers(unsigned long ircom) | ||
308 | { | ||
309 | if (irc_handler != NULL) | ||
310 | (*irc_handler)((u32) ircom); | ||
311 | } | ||
312 | |||
313 | static DECLARE_TASKLET(irtask, run_handlers, 0); | ||
314 | |||
315 | static void IR_handle(struct av7110 *av7110, u32 ircom) | ||
316 | { | ||
317 | dprintk(4, "ircommand = %08x\n", ircom); | ||
318 | irtask.data = (unsigned long) ircom; | ||
319 | tasklet_schedule(&irtask); | ||
320 | } | ||
321 | |||
322 | /**************************************************************************** | 265 | /**************************************************************************** |
323 | * IRQ handling | 266 | * IRQ handling |
324 | ****************************************************************************/ | 267 | ****************************************************************************/ |
@@ -711,8 +654,9 @@ static void gpioirq(unsigned long data) | |||
711 | return; | 654 | return; |
712 | 655 | ||
713 | case DATA_IRCOMMAND: | 656 | case DATA_IRCOMMAND: |
714 | IR_handle(av7110, | 657 | if (av7110->ir_handler) |
715 | swahw32(irdebi(av7110, DEBINOSWAP, Reserved, 0, 4))); | 658 | av7110->ir_handler(av7110, |
659 | swahw32(irdebi(av7110, DEBINOSWAP, Reserved, 0, 4))); | ||
716 | iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2); | 660 | iwdebi(av7110, DEBINOSWAP, RX_BUFF, 0, 2); |
717 | break; | 661 | break; |
718 | 662 | ||
@@ -2783,7 +2727,7 @@ static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_d | |||
2783 | goto err_av7110_exit_v4l_12; | 2727 | goto err_av7110_exit_v4l_12; |
2784 | 2728 | ||
2785 | #if defined(CONFIG_INPUT_EVDEV) || defined(CONFIG_INPUT_EVDEV_MODULE) | 2729 | #if defined(CONFIG_INPUT_EVDEV) || defined(CONFIG_INPUT_EVDEV_MODULE) |
2786 | av7110_ir_init(); | 2730 | av7110_ir_init(av7110); |
2787 | #endif | 2731 | #endif |
2788 | printk(KERN_INFO "dvb-ttpci: found av7110-%d.\n", av7110_num); | 2732 | printk(KERN_INFO "dvb-ttpci: found av7110-%d.\n", av7110_num); |
2789 | av7110_num++; | 2733 | av7110_num++; |
@@ -2825,6 +2769,9 @@ static int av7110_detach(struct saa7146_dev* saa) | |||
2825 | struct av7110 *av7110 = saa->ext_priv; | 2769 | struct av7110 *av7110 = saa->ext_priv; |
2826 | dprintk(4, "%p\n", av7110); | 2770 | dprintk(4, "%p\n", av7110); |
2827 | 2771 | ||
2772 | #if defined(CONFIG_INPUT_EVDEV) || defined(CONFIG_INPUT_EVDEV_MODULE) | ||
2773 | av7110_ir_exit(av7110); | ||
2774 | #endif | ||
2828 | if (budgetpatch) { | 2775 | if (budgetpatch) { |
2829 | /* Disable RPS1 */ | 2776 | /* Disable RPS1 */ |
2830 | saa7146_write(saa, MC1, MASK_29); | 2777 | saa7146_write(saa, MC1, MASK_29); |
@@ -2980,9 +2927,6 @@ static int __init av7110_init(void) | |||
2980 | 2927 | ||
2981 | static void __exit av7110_exit(void) | 2928 | static void __exit av7110_exit(void) |
2982 | { | 2929 | { |
2983 | #if defined(CONFIG_INPUT_EVDEV) || defined(CONFIG_INPUT_EVDEV_MODULE) | ||
2984 | av7110_ir_exit(); | ||
2985 | #endif | ||
2986 | saa7146_unregister_extension(&av7110_extension); | 2930 | saa7146_unregister_extension(&av7110_extension); |
2987 | } | 2931 | } |
2988 | 2932 | ||