summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux/drivers/media/video/ir-kbd-gpio.c3
-rw-r--r--v4l/ChangeLog13
-rw-r--r--v4l_experimental/bttv-input/bttv-input.c74
-rw-r--r--v4l_experimental/bttv-input/bttv-input.diff82
4 files changed, 99 insertions, 73 deletions
diff --git a/linux/drivers/media/video/ir-kbd-gpio.c b/linux/drivers/media/video/ir-kbd-gpio.c
index 01bdb0def..2b8aaf72d 100644
--- a/linux/drivers/media/video/ir-kbd-gpio.c
+++ b/linux/drivers/media/video/ir-kbd-gpio.c
@@ -1,5 +1,5 @@
/*
- * $Id: ir-kbd-gpio.c,v 1.23 2005/12/04 01:12:43 rmcc Exp $
+ * $Id: ir-kbd-gpio.c,v 1.24 2005/12/08 02:55:39 rmcc Exp $
*
* Copyright (c) 2003 Gerd Knorr
* Copyright (c) 2003 Pavel Machek
@@ -672,6 +672,7 @@ static int ir_probe(struct device *dev)
snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0",
pci_name(sub->core->pci));
+ ir->input = input_dev;
ir->sub = sub;
ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
input_dev->name = ir->name;
diff --git a/v4l/ChangeLog b/v4l/ChangeLog
index c72da8f34..62a183330 100644
--- a/v4l/ChangeLog
+++ b/v4l/ChangeLog
@@ -1,3 +1,16 @@
+2005-12-08 02:51 rmcc
+
+ * linux/drivers/media/video/ir-kbd-gpio.c: (ir_probe):
+ * v4l_experimental/bttv-input/bttv-input.c: (ir_handle_key),
+ (bttv_rc5_timer_end), (bttv_rc5_timer_keyup), (bttv_input_init),
+ (bttv_input_fini):
+ * v4l_experimental/bttv-input/bttv-input.diff:
+
+ - Bugfix at bttv GPIO remote handler
+ - Updated experimental bttv-input to new kernel input syntax
+
+ Signed-off-by: Ricardo Cerqueira <v4l@cerqueira.org>
+
2005-12-08 02:43 rmcc
* linux/drivers/media/video/saa7134/saa7134-cards.c:
diff --git a/v4l_experimental/bttv-input/bttv-input.c b/v4l_experimental/bttv-input/bttv-input.c
index e1d15b2da..7b8d186ef 100644
--- a/v4l_experimental/bttv-input/bttv-input.c
+++ b/v4l_experimental/bttv-input/bttv-input.c
@@ -1,5 +1,5 @@
/*
- * $Id: bttv-input.c,v 1.1 2005/11/10 02:06:34 rmcc Exp $
+ * $Id: bttv-input.c,v 1.2 2005/12/08 02:55:39 rmcc Exp $
*
* Copyright (c) 2003 Gerd Knorr
* Copyright (c) 2003 Pavel Machek
@@ -308,12 +308,12 @@ static void ir_handle_key(struct bttv *btv)
(gpio & ir->mask_keydown) ? " down" : "",
(gpio & ir->mask_keyup) ? " up" : "");
- if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) ||
- (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) {
- ir_input_keydown(&ir->dev,&ir->ir,data,data);
- } else {
- ir_input_nokey(&ir->dev,&ir->ir);
- }
+ if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) ||
+ (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) {
+ ir_input_keydown(ir->dev,&ir->ir,data,data);
+ } else {
+ ir_input_nokey(ir->dev,&ir->ir);
+ }
}
@@ -480,8 +480,8 @@ static void bttv_rc5_timer_end(unsigned long data)
instr != RC5_INSTR(ir->last_rc5)) {
dprintk("instruction %x, toggle %x\n", instr,
toggle);
- ir_input_nokey(&ir->dev, &ir->ir);
- ir_input_keydown(&ir->dev, &ir->ir, instr,
+ ir_input_nokey(ir->dev, &ir->ir);
+ ir_input_keydown(ir->dev, &ir->ir, instr,
instr);
}
@@ -501,7 +501,7 @@ static void bttv_rc5_timer_keyup(unsigned long data)
struct bttv_ir *ir = (struct bttv_ir *)data;
dprintk("key released\n");
- ir_input_nokey(&ir->dev, &ir->ir);
+ ir_input_nokey(ir->dev, &ir->ir);
}
/* ---------------------------------------------------------------------- */
@@ -510,14 +510,19 @@ int bttv_input_init(struct bttv *btv)
{
struct bttv_ir *ir;
IR_KEYTAB_TYPE *ir_codes = NULL;
+ struct input_dev *input_dev;
int ir_type = IR_TYPE_OTHER;
if (!btv->has_remote)
return -ENODEV;
- ir = kmalloc(sizeof(*ir),GFP_KERNEL);
- if (NULL == ir)
+ ir = kzalloc(sizeof(*ir),GFP_KERNEL);
+ input_dev = input_allocate_device();
+ if (!ir || !input_dev) {
+ kfree(ir);
+ input_free_device(input_dev);
return -ENOMEM;
+ }
memset(ir,0,sizeof(*ir));
/* detect & configure */
@@ -584,6 +589,7 @@ int bttv_input_init(struct bttv *btv)
if (NULL == ir_codes) {
dprintk("Ooops: IR config error [card=%d]\n",btv->c.type);
kfree(ir);
+ input_free_device(input_dev);
return -ENODEV;
}
@@ -600,25 +606,31 @@ int bttv_input_init(struct bttv *btv)
}
/* init input device */
+ ir->dev = input_dev;
+
snprintf(ir->name, sizeof(ir->name), "bttv IR (card=%d)",
btv->c.type);
snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0",
pci_name(btv->c.pci));
- ir_input_init(&ir->dev, &ir->ir, ir_type, ir_codes);
- ir->dev.name = ir->name;
+ ir_input_init(input_dev, &ir->ir, ir_type, ir_codes);
+ input_dev->name = ir->name;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)
- ir->dev.phys = ir->phys;
- ir->dev.id.bustype = BUS_PCI;
- ir->dev.id.version = 1;
+ input_dev->phys = ir->phys;
+ input_dev->id.bustype = BUS_PCI;
+ input_dev->id.version = 1;
if (btv->c.pci->subsystem_vendor) {
- ir->dev.id.vendor = btv->c.pci->subsystem_vendor;
- ir->dev.id.product = btv->c.pci->subsystem_device;
+ input_dev->id.vendor = btv->c.pci->subsystem_vendor;
+ input_dev->id.product = btv->c.pci->subsystem_device;
} else {
- ir->dev.id.vendor = btv->c.pci->vendor;
- ir->dev.id.product = btv->c.pci->device;
+ input_dev->id.vendor = btv->c.pci->vendor;
+ input_dev->id.product = btv->c.pci->device;
}
- ir->dev.dev = &btv->c.pci->dev;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
+ input_dev->cdev.dev = &btv->c.pci->dev;
+#else
+ input_dev->dev = &btv->c.pci->dev;
+#endif
#endif
btv->remote = ir;
@@ -640,12 +652,12 @@ int bttv_input_init(struct bttv *btv)
}
/* all done */
- input_register_device(&btv->remote->dev);
- printk(DEVNAME ": %s detected at %s\n",ir->dev.name,ir->dev.phys);
+ input_register_device(btv->remote->dev);
+ printk(DEVNAME ": %s detected at %s\n",ir->dev->name,ir->dev->phys);
/* the remote isn't as bouncy as a keyboard */
- ir->dev.rep[REP_DELAY] = repeat_delay;
- ir->dev.rep[REP_PERIOD] = repeat_period;
+ ir->dev->rep[REP_DELAY] = repeat_delay;
+ ir->dev->rep[REP_PERIOD] = repeat_period;
return 0;
}
@@ -655,11 +667,11 @@ void bttv_input_fini(struct bttv *btv)
if (btv->remote == NULL)
return;
- input_unregister_device(&btv->remote->dev);
- if (btv->remote->polling)
- del_timer_sync(&btv->remote->timer);
- kfree(btv->remote);
- btv->remote = NULL;
+ input_unregister_device(btv->remote->dev);
+ if (btv->remote->polling)
+ del_timer_sync(&btv->remote->timer);
+ kfree(btv->remote);
+ btv->remote = NULL;
if (btv->remote->rc5_gpio) {
u32 gpio;
diff --git a/v4l_experimental/bttv-input/bttv-input.diff b/v4l_experimental/bttv-input/bttv-input.diff
index 50dee8b45..d4a05a2b2 100644
--- a/v4l_experimental/bttv-input/bttv-input.diff
+++ b/v4l_experimental/bttv-input/bttv-input.diff
@@ -1,11 +1,11 @@
Index: linux/drivers/media/video/bttv-cards.c
===================================================================
-RCS file: /cvs/video4linux/v4l-kernel/linux/drivers/media/video/bttv-cards.c,v
-retrieving revision 1.101
-diff -u -r1.101 bttv-cards.c
---- linux/drivers/media/video/bttv-cards.c 8 Nov 2005 18:02:29 -0000 1.101
-+++ linux/drivers/media/video/bttv-cards.c 10 Nov 2005 01:59:57 -0000
-@@ -2160,7 +2160,6 @@
+RCS file: /cvs/video4linux/v4l-dvb/linux/drivers/media/video/bttv-cards.c,v
+retrieving revision 1.104
+diff -u -r1.104 bttv-cards.c
+--- linux/drivers/media/video/bttv-cards.c 4 Dec 2005 12:21:15 -0000 1.104
++++ linux/drivers/media/video/bttv-cards.c 8 Dec 2005 02:31:39 -0000
+@@ -2163,7 +2163,6 @@
.has_remote = 1,
.gpiomask = 0x1b,
.no_gpioirq = 1,
@@ -13,7 +13,7 @@ diff -u -r1.101 bttv-cards.c
},
[BTTV_BOARD_PV143] = {
/* Jorge Boncompte - DTI2 <jorge@dti2.net> */
-@@ -3420,8 +3419,6 @@
+@@ -3445,8 +3444,6 @@
btv->has_remote=1;
if (!bttv_tvcards[btv->c.type].no_gpioirq)
btv->gpioirq=1;
@@ -24,12 +24,12 @@ diff -u -r1.101 bttv-cards.c
Index: linux/drivers/media/video/bttv-driver.c
===================================================================
-RCS file: /cvs/video4linux/v4l-kernel/linux/drivers/media/video/bttv-driver.c,v
-retrieving revision 1.67
-diff -u -r1.67 bttv-driver.c
---- linux/drivers/media/video/bttv-driver.c 9 Nov 2005 18:30:51 -0000 1.67
-+++ linux/drivers/media/video/bttv-driver.c 10 Nov 2005 02:00:07 -0000
-@@ -3698,8 +3698,8 @@
+RCS file: /cvs/video4linux/v4l-dvb/linux/drivers/media/video/bttv-driver.c,v
+retrieving revision 1.79
+diff -u -r1.79 bttv-driver.c
+--- linux/drivers/media/video/bttv-driver.c 7 Dec 2005 15:29:32 -0000 1.79
++++ linux/drivers/media/video/bttv-driver.c 8 Dec 2005 02:31:47 -0000
+@@ -3731,8 +3731,8 @@
btv=(struct bttv *)dev_id;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
@@ -40,7 +40,7 @@ diff -u -r1.67 bttv-driver.c
#endif
count=0;
-@@ -3736,10 +3736,10 @@
+@@ -3769,10 +3769,10 @@
if (astat&BT848_INT_VSYNC)
btv->field_count++;
@@ -53,7 +53,7 @@ diff -u -r1.67 bttv-driver.c
#endif
}
-@@ -4080,6 +4080,8 @@
+@@ -4112,6 +4112,8 @@
bttv_sub_add_device(&btv->c, "dvb");
#endif
@@ -62,7 +62,7 @@ diff -u -r1.67 bttv-driver.c
/* everything is fine */
bttv_num++;
return 0;
-@@ -4114,8 +4116,9 @@
+@@ -4146,8 +4148,9 @@
/* tell gpio modules we are leaving ... */
btv->shutdown=1;
wake_up(&btv->gpioq);
@@ -75,11 +75,11 @@ diff -u -r1.67 bttv-driver.c
/* unregister i2c_bus + input */
Index: linux/drivers/media/video/bttv-gpio.c
===================================================================
-RCS file: /cvs/video4linux/v4l-kernel/linux/drivers/media/video/bttv-gpio.c,v
+RCS file: /cvs/video4linux/v4l-dvb/linux/drivers/media/video/bttv-gpio.c,v
retrieving revision 1.9
diff -u -r1.9 bttv-gpio.c
--- linux/drivers/media/video/bttv-gpio.c 8 Nov 2005 18:02:29 -0000 1.9
-+++ linux/drivers/media/video/bttv-gpio.c 10 Nov 2005 02:00:08 -0000
++++ linux/drivers/media/video/bttv-gpio.c 8 Dec 2005 02:31:47 -0000
@@ -114,24 +114,6 @@
}
}
@@ -107,11 +107,11 @@ diff -u -r1.9 bttv-gpio.c
Index: linux/drivers/media/video/bttv.h
===================================================================
-RCS file: /cvs/video4linux/v4l-kernel/linux/drivers/media/video/bttv.h,v
-retrieving revision 1.34
-diff -u -r1.34 bttv.h
---- linux/drivers/media/video/bttv.h 8 Nov 2005 18:02:29 -0000 1.34
-+++ linux/drivers/media/video/bttv.h 10 Nov 2005 02:00:09 -0000
+RCS file: /cvs/video4linux/v4l-dvb/linux/drivers/media/video/bttv.h,v
+retrieving revision 1.35
+diff -u -r1.35 bttv.h
+--- linux/drivers/media/video/bttv.h 25 Nov 2005 21:37:36 -0000 1.35
++++ linux/drivers/media/video/bttv.h 8 Dec 2005 02:31:49 -0000
@@ -18,6 +18,8 @@
#include "compat.h"
#include <linux/videodev.h>
@@ -121,13 +121,13 @@ diff -u -r1.34 bttv.h
/* ---------------------------------------------------------- */
/* exported by bttv-cards.c */
-@@ -212,6 +214,34 @@
+@@ -213,6 +215,34 @@
struct bttv;
+
+struct bttv_ir {
-+ struct input_dev dev;
++ struct input_dev *dev;
+ struct ir_input_state ir;
+ char name[32];
+ char phys[32];
@@ -156,7 +156,7 @@ diff -u -r1.34 bttv.h
struct tvcard
{
char *name;
-@@ -237,7 +267,6 @@
+@@ -238,7 +268,6 @@
unsigned int has_dvb:1;
unsigned int has_remote:1;
unsigned int no_gpioirq:1;
@@ -164,7 +164,7 @@ diff -u -r1.34 bttv.h
/* other settings */
unsigned int pll;
-@@ -344,7 +373,6 @@
+@@ -345,7 +374,6 @@
struct device_driver drv;
char wanted[BUS_ID_SIZE];
void (*gpio_irq)(struct bttv_sub_device *sub);
@@ -172,7 +172,7 @@ diff -u -r1.34 bttv.h
};
#define to_bttv_sub_drv(x) container_of((x), struct bttv_sub_driver, drv)
-@@ -380,6 +408,10 @@
+@@ -381,6 +409,10 @@
unsigned char b2, int both);
extern void bttv_readee(struct bttv *btv, unsigned char *eedata, int addr);
@@ -185,11 +185,11 @@ diff -u -r1.34 bttv.h
* Local variables:
Index: linux/drivers/media/video/bttvp.h
===================================================================
-RCS file: /cvs/video4linux/v4l-kernel/linux/drivers/media/video/bttvp.h,v
-retrieving revision 1.25
-diff -u -r1.25 bttvp.h
---- linux/drivers/media/video/bttvp.h 8 Nov 2005 18:02:29 -0000 1.25
-+++ linux/drivers/media/video/bttvp.h 10 Nov 2005 02:00:10 -0000
+RCS file: /cvs/video4linux/v4l-dvb/linux/drivers/media/video/bttvp.h,v
+retrieving revision 1.28
+diff -u -r1.28 bttvp.h
+--- linux/drivers/media/video/bttvp.h 7 Dec 2005 11:18:39 -0000 1.28
++++ linux/drivers/media/video/bttvp.h 8 Dec 2005 02:31:55 -0000
@@ -218,7 +218,6 @@
int bttv_sub_add_device(struct bttv_core *core, char *name);
int bttv_sub_del_devices(struct bttv_core *core);
@@ -219,21 +219,21 @@ diff -u -r1.25 bttvp.h
spinlock_t s_lock;
Index: v4l/Makefile
===================================================================
-RCS file: /cvs/video4linux/v4l-kernel/v4l/Makefile,v
-retrieving revision 1.97
-diff -u -r1.97 Makefile
---- v4l/Makefile 9 Nov 2005 19:11:03 -0000 1.97
-+++ v4l/Makefile 10 Nov 2005 02:00:11 -0000
+RCS file: /cvs/video4linux/v4l-dvb/v4l/Makefile,v
+retrieving revision 1.117
+diff -u -r1.117 Makefile
+--- v4l/Makefile 7 Dec 2005 23:31:52 -0000 1.117
++++ v4l/Makefile 8 Dec 2005 02:32:00 -0000
@@ -16,7 +16,7 @@
# drivers objects
bttv-objs := bttv-driver.o bttv-cards.o bttv-risc.o bttv-if.o \
- bttv-vbi.o bttv-i2c.o
+ bttv-vbi.o bttv-i2c.o bttv-input.o
- saa7134-objs := saa7134-core.o saa7134-i2c.o saa7134-video.o \
+ saa7134-objs := saa7134-core.o saa7134-i2c.o saa7134-video.o \
saa7134-vbi.o saa7134-tvaudio.o \
saa7134-cards.o saa7134-ts.o saa7134-input.o
-@@ -68,7 +68,7 @@
+@@ -127,7 +127,7 @@
ifeq ($(VERSION).$(PATCHLEVEL),2.6)
ifeq ($(CONFIG_VIDEO_BTTV),m)
bttv-objs += bttv-gpio.o
@@ -242,7 +242,7 @@ diff -u -r1.97 Makefile
endif
ifeq ($(CONFIG_VIDEO_SAA7134),m)
obj-$(CONFIG_VIDEO_IR) += ir-kbd-i2c.o
-@@ -165,7 +165,7 @@
+@@ -241,7 +241,7 @@
inst_video := btcx-risc.ko bttv.ko tda9887.ko tuner.ko tvaudio.ko tveeprom.ko saa6588.ko
inst_video += tvmixer.ko v4l1-compat.ko v4l2-common.ko wm8775.ko cs53l32a.ko
inst_video += video-buf.ko video-buf-dvb.ko