summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttpci/budget-ci.c
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-11-22 21:01:34 +0000
committerAndrew de Quincey <adq_dvb@lidskialf.net>2006-11-22 21:01:34 +0000
commitf88750c2f34c88b87198cac5895b0be11a2609d2 (patch)
tree986f80e455f028f6e4a50623b7ca13407beaad72 /linux/drivers/media/dvb/ttpci/budget-ci.c
parent7d62f8cfb898a81f0196aee85700519aaecd27b5 (diff)
downloadmediapointer-dvb-s2-f88750c2f34c88b87198cac5895b0be11a2609d2.tar.gz
mediapointer-dvb-s2-f88750c2f34c88b87198cac5895b0be11a2609d2.tar.bz2
[PATCH 2/8] budget-ci IR: support EVIOCGPHYS
This patch adds a 'phys' string, of the same form as used by various other DVB cards' IR drivers, for access by any program which uses the EVIOCPHYS ioctl or may read /sys/class/input/*/phys (e.g. udev) to identify input device nodes. Taken from Darren Salt's dvb-ir patchset. Signed-off-by: Darren Salt <linux@youmustbejoking.demon.co.uk> Signed-off-by: David Härdeman <david@hardeman.nu> Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net>
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/budget-ci.c')
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-ci.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/ttpci/budget-ci.c b/linux/drivers/media/dvb/ttpci/budget-ci.c
index 2893e7527..253b5ff8a 100644
--- a/linux/drivers/media/dvb/ttpci/budget-ci.c
+++ b/linux/drivers/media/dvb/ttpci/budget-ci.c
@@ -76,6 +76,7 @@ struct budget_ci_ir {
struct input_dev *dev;
struct tasklet_struct msp430_irq_tasklet;
char name[72]; /* 40 + 32 for (struct saa7146_dev).name */
+ char phys[32];
};
struct budget_ci {
@@ -205,8 +206,29 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
snprintf(budget_ci->ir.name, sizeof(budget_ci->ir.name),
"Budget-CI dvb ir receiver %s", saa->name);
+ snprintf(budget_ci->ir.phys, sizeof(budget_ci->ir.phys),
+ "pci-%s/ir0", pci_name(saa->pci));
+
input_dev->name = budget_ci->ir.name;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+ input_dev->phys = budget_ci->ir.phys;
+ input_dev->id.bustype = BUS_PCI;
+ input_dev->id.version = 1;
+ if (saa->pci->subsystem_vendor) {
+ input_dev->id.vendor = saa->pci->subsystem_vendor;
+ input_dev->id.product = saa->pci->subsystem_device;
+ } else {
+ input_dev->id.vendor = saa->pci->vendor;
+ input_dev->id.product = saa->pci->device;
+ }
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
+ input_dev->cdev.dev = &saa->pci->dev;
+# else
+ input_dev->dev = &saa->pci->dev;
+# endif
+#endif
+
set_bit(EV_KEY, input_dev->evbit);
for (i = 0; i < ARRAY_SIZE(key_map); i++)
if (key_map[i])