[PATCH 2/4] budget-ci: add 'phys' string

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fill in the input struct's 'phys' string for any programs which use
EVIOCGPHYS to identify the device.

Signed-off-by: Darren Salt <linux@xxxxxxxxxxxxxxxxxxxxxxxxxxx>

diff --git a/linux/drivers/media/dvb/ttpci/budget-ci.c b/linux/drivers/media/dvb/ttpci/budget-ci.c
--- a/linux/drivers/media/dvb/ttpci/budget-ci.c	Tue Mar 21 19:47:46 2006
+++ b/linux/drivers/media/dvb/ttpci/budget-ci.c	Wed Mar 22 13:45:34 2006
@@ -69,6 +69,7 @@
 	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 {
@@ -197,8 +198,27 @@
 
 	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++)

_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux