[PATCH] Adapt DVB USB remotes to the latest changes in the USB input subsystem

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

 



Hello list,

I've written a patch adapting the dvb-usb remotes to the changes in the
USB input subsystem in 2.6.13, 2.6.15 and (thanks to Trent Piepho)
2.6.18rcX.

The patch has been redone to be backwards compatible with previous
versions of linux.

Also, it includes fix for a trivial errata building the physical
identifier of the device: it was overwritting the usb physical id with
"/ir0" instead of appending, generating a broken, not unique identifier.

Any comments?

PD: A la tercera va la vencida
# HG changeset patch
# User Unai Uribarri <unaiur@xxxxxxxxx>
# Node ID e83b66e3c1ef6feee217a84f1a40218db548acb3
# Parent  6ddc79dc9d54ce064146b0b6da933b36aa81e513
[PATCH] Sync'ing dvb-usb-remote with changes in USB input subsystem


From: Unai Uribarri <unaiur@xxxxxxxxx>

This patch fixes the physical address and takes into account recent
changes in the USB input subsystem.

Signed-off-by: Unai Uribarri <unaiur@xxxxxxxxx>

diff -r 6ddc79dc9d54 -r e83b66e3c1ef linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c	Sun Jul 23 06:36:05 2006 -0300
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c	Fri Jul 28 00:53:24 2006 +0200
@@ -6,6 +6,11 @@
  * This file contains functions for initializing the the input-device and for handling remote-control-queries.
  */
 #include "dvb-usb-common.h"
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+#include <linux/usb/input.h>
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+#include <linux/usb_input.h>
+#endif
 
 /* Remote-control poll function - called every dib->rc_query_interval ms to see
  * whether the remote control has received anything.
@@ -96,7 +101,7 @@ int dvb_usb_remote_init(struct dvb_usb_d
 		return 0;
 
 	usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys));
-	strlcpy(d->rc_phys, "/ir0", sizeof(d->rc_phys));
+	strlcat(d->rc_phys, "/ir0", sizeof(d->rc_phys));
 
 	d->rc_input_dev = input_allocate_device();
 	if (!d->rc_input_dev)
@@ -107,6 +112,12 @@ int dvb_usb_remote_init(struct dvb_usb_d
 	d->rc_input_dev->keycodemax = KEY_MAX;
 	d->rc_input_dev->name = "IR-receiver inside an USB DVB receiver";
 	d->rc_input_dev->phys = d->rc_phys;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+	usb_to_input_id(d->udev, &d->rc_input_dev->id);
+#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15)
+	d->rc_input_dev->cdev.dev = &d->udev->dev;
+#endif
 
 	/* set the bits for the keys */
 	deb_rc("key map size: %d\n", d->props.rc_key_map_size);

_______________________________________________
linux-dvb mailing list
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