[PATCH] Fixing the sysfs entry for the usb remote control

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

 



I have discovered why HAL doesn't recognize my remote control: its sysfs
entry is incomplete. This patchset fills the gaps.

# HG changeset patch
# User "Unai Uribarri <unaiur@xxxxxxxxx>"
# Node ID a4af6939dac9e4ae6d540d15ae15578651310c7b
# Parent  c4c379abf4e1d9c51fe7a11d679c88a7d6e77215
Fixed physical address of the remote control

From: "Unai Uribarri <unaiur@xxxxxxxxx>"

Current code generates /ir0 as the physical address of the remote control,
which isn't valid. It should be the physical address of the usb device 
plus /ir0.

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

diff -r c4c379abf4e1 -r a4af6939dac9 linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c	Fri Jun 30 18:41:26 2006 +0200
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c	Sat Jul 08 18:28:12 2006 +0200
@@ -96,7 +96,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)
# HG changeset patch
# User "Unai Uribarri <unaiur@xxxxxxxxx>"
# Node ID dcae2f8fce4ccc83f26525154fd7583b4810880e
# Parent  a4af6939dac9e4ae6d540d15ae15578651310c7b
Added device & id to the sysfs entry of the remote control

From: "Unai Uribarri <unaiur@xxxxxxxxx>"

Fill the cdev and id fields of the input device to get the device and id files in the sysfs entry for the remote control.

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

diff -r a4af6939dac9 -r dcae2f8fce4c linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
--- a/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c	Sat Jul 08 18:28:12 2006 +0200
+++ b/linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c	Sat Jul 08 18:37:33 2006 +0200
@@ -6,6 +6,7 @@
  * This file contains functions for initializing the the input-device and for handling remote-control-queries.
  */
 #include "dvb-usb-common.h"
+#include <linux/usb_input.h>
 
 /* Remote-control poll function - called every dib->rc_query_interval ms to see
  * whether the remote control has received anything.
@@ -107,6 +108,8 @@ 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;
+	usb_to_input_id(d->udev, &d->rc_input_dev->id);
+	d->rc_input_dev->cdev.dev = &d->udev->dev;
 
 	/* set the bits for the keys */
 	deb_rc("key map size: %d\n", d->props.rc_key_map_size);
_______________________________________________

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