diff options
author | Oliver Endriss <o.endriss@gmx.de> | 2007-01-25 00:49:58 +0100 |
---|---|---|
committer | Oliver Endriss <o.endriss@gmx.de> | 2007-01-25 00:49:58 +0100 |
commit | 28765436e28b9c83d4b3f34dbaaa88c96aa2b324 (patch) | |
tree | 503642ae84b72c8c6fd4ba059bbd59910e1b6e81 /linux/drivers | |
parent | 0f5b64e7c37c66e5cd7693eb7f9fc011e62eee33 (diff) | |
download | mediapointer-dvb-s2-28765436e28b9c83d4b3f34dbaaa88c96aa2b324.tar.gz mediapointer-dvb-s2-28765436e28b9c83d4b3f34dbaaa88c96aa2b324.tar.bz2 |
dvb-ttpci: Set phys, bustype, version, vendor and product for input device
From: Matthias Schwarzott <zzam@gentoo.org>
Add phys-string, bustype, version, vendor and product to help udev and
others using EVIOCPHYS ioctl to identify the input device node.
Code taken (with little changes) from budget-ci.c
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Oliver Endriss <o.endriss@gmx.de>
Diffstat (limited to 'linux/drivers')
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110_ir.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110_ir.c b/linux/drivers/media/dvb/ttpci/av7110_ir.c index e4544ea2b..344ec1243 100644 --- a/linux/drivers/media/dvb/ttpci/av7110_ir.c +++ b/linux/drivers/media/dvb/ttpci/av7110_ir.c @@ -16,6 +16,7 @@ static int av_cnt; static struct av7110 *av_list[4]; static struct input_dev *input_dev; +static char input_phys[32]; static u8 delay_timer_finished; @@ -231,8 +232,28 @@ int __devinit av7110_ir_init(struct av7110 *av7110) if (!input_dev) return -ENOMEM; + snprintf(input_phys, sizeof(input_phys), + "pci-%s/ir0", pci_name(av7110->dev->pci)); + input_dev->name = "DVB on-card IR receiver"; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) + input_dev->phys = input_phys; + input_dev->id.bustype = BUS_PCI; + input_dev->id.version = 1; + if (av7110->dev->pci->subsystem_vendor) { + input_dev->id.vendor = av7110->dev->pci->subsystem_vendor; + input_dev->id.product = av7110->dev->pci->subsystem_device; + } else { + input_dev->id.vendor = av7110->dev->pci->vendor; + input_dev->id.product = av7110->dev->pci->device; + } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) + input_dev->cdev.dev = &av7110->dev->pci->dev; +#else + input_dev->dev = &av7110->dev->pci->dev; +#endif +#endif set_bit(EV_KEY, input_dev->evbit); set_bit(EV_REP, input_dev->evbit); input_register_keys(); |