rpms/kernel/F-11 hdpvr-ir-enable.patch, NONE, 1.1.2.1 hid-ignore-all-recent-imon-devices.patch, NONE, 1.1.2.1
Jarod Wilson
jwilson at fedoraproject.org
Mon Aug 10 18:33:00 UTC 2009
Author: jwilson
Update of /cvs/pkgs/rpms/kernel/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv15611
Added Files:
Tag: private-fedora-11-2_6_29_6
hdpvr-ir-enable.patch hid-ignore-all-recent-imon-devices.patch
Log Message:
add the patches, duh.
hdpvr-ir-enable.patch:
hdpvr-core.c | 3 +--
hdpvr-i2c.c | 36 +++++++++++++++++++++++++++++-------
2 files changed, 30 insertions(+), 9 deletions(-)
--- NEW FILE hdpvr-ir-enable.patch ---
>From http://hg.jannau.net/hdpvr/, pending v4l-dvb pull request
---
drivers/media/video/hdpvr/hdpvr-core.c | 3 +-
drivers/media/video/hdpvr/hdpvr-i2c.c | 36 +++++++++++++++++++++++++------
2 files changed, 30 insertions(+), 9 deletions(-)
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c
index 188bd5a..878d1e5 100644
--- a/drivers/media/video/hdpvr/hdpvr-core.c
+++ b/drivers/media/video/hdpvr/hdpvr-core.c
@@ -363,8 +363,7 @@ static int hdpvr_probe(struct usb_interface *interface,
}
#ifdef CONFIG_I2C
- /* until i2c is working properly */
- retval = 0; /* hdpvr_register_i2c_adapter(dev); */
+ retval = hdpvr_register_i2c_adapter(dev);
if (retval < 0) {
v4l2_err(&dev->v4l2_dev, "registering i2c adapter failed\n");
goto error;
diff --git a/drivers/media/video/hdpvr/hdpvr-i2c.c b/drivers/media/video/hdpvr/hdpvr-i2c.c
index c4b5d15..1c01b6c 100644
--- a/drivers/media/video/hdpvr/hdpvr-i2c.c
+++ b/drivers/media/video/hdpvr/hdpvr-i2c.c
@@ -22,7 +22,7 @@
#define REQTYPE_I2C_WRITE_STATT 0xd0
static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr,
- char *data, int len)
+ char *data, int len, int bus)
{
int ret;
char *buf = kmalloc(len, GFP_KERNEL);
@@ -32,7 +32,7 @@ static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr,
ret = usb_control_msg(dev->udev,
usb_rcvctrlpipe(dev->udev, 0),
REQTYPE_I2C_READ, CTRL_READ_REQUEST,
- 0x100|addr, 0, buf, len, 1000);
+ bus<<8 | addr, 0, buf, len, 1000);
if (ret == len) {
memcpy(data, buf, len);
@@ -46,7 +46,7 @@ static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr,
}
static int hdpvr_i2c_write(struct hdpvr_device *dev, unsigned char addr,
- char *data, int len)
+ char *data, int len, int bus)
{
int ret;
char *buf = kmalloc(len, GFP_KERNEL);
@@ -57,14 +57,14 @@ static int hdpvr_i2c_write(struct hdpvr_device *dev, unsigned char addr,
ret = usb_control_msg(dev->udev,
usb_sndctrlpipe(dev->udev, 0),
REQTYPE_I2C_WRITE, CTRL_WRITE_REQUEST,
- 0x100|addr, 0, buf, len, 1000);
+ bus<<8 | addr, 0, buf, len, 1000);
if (ret < 0)
goto error;
ret = usb_control_msg(dev->udev,
usb_rcvctrlpipe(dev->udev, 0),
- REQTYPE_I2C_WRITE_STATT, CTRL_READ_REQUEST,
+ REQTYPE_I2C_WRITE_STATT, CTRL_READ_REQUEST,
0, 0, buf, 2, 1000);
if (ret == 2)
@@ -93,10 +93,10 @@ static int hdpvr_transfer(struct i2c_adapter *i2c_adapter, struct i2c_msg *msgs,
if (msgs[i].flags & I2C_M_RD)
retval = hdpvr_i2c_read(dev, addr, msgs[i].buf,
- msgs[i].len);
+ msgs[i].len, 1);
else
retval = hdpvr_i2c_write(dev, addr, msgs[i].buf,
- msgs[i].len);
+ msgs[i].len, 1);
}
mutex_unlock(&dev->i2c_mutex);
@@ -114,6 +114,26 @@ static struct i2c_algorithm hdpvr_algo = {
.functionality = hdpvr_functionality,
};
+static int hdpvr_activate_ir(struct hdpvr_device *dev)
+{
+ char buffer[8];
+
+ mutex_lock(&dev->i2c_mutex);
+
+ hdpvr_i2c_read(dev, 0x54, buffer, 1, 0);
+
+ buffer[0] = 0;
+ buffer[1] = 0x8;
+ hdpvr_i2c_write(dev, 0x54, buffer, 2, 1);
+
+ buffer[1] = 0x18;
+ hdpvr_i2c_write(dev, 0x54, buffer, 2, 1);
+
+ mutex_unlock(&dev->i2c_mutex);
+ return 0;
+}
+
+
int hdpvr_register_i2c_adapter(struct hdpvr_device *dev)
{
struct i2c_adapter *i2c_adap;
@@ -123,6 +143,8 @@ int hdpvr_register_i2c_adapter(struct hdpvr_device *dev)
if (i2c_adap == NULL)
goto error;
+ hdpvr_activate_ir(dev);
+
strlcpy(i2c_adap->name, "Hauppauge HD PVR I2C",
sizeof(i2c_adap->name));
i2c_adap->algo = &hdpvr_algo;
hid-ignore-all-recent-imon-devices.patch:
hid-core.c | 10 +++++-----
hid-ids.h | 7 ++-----
2 files changed, 7 insertions(+), 10 deletions(-)
--- NEW FILE hid-ignore-all-recent-imon-devices.patch ---
[PATCH] hid: ignore all recent SoundGraph iMON devices
After some inspection of the Windows iMON driver, several additional
device IDs were added to the lirc_imon driver. At least a few of these
have been seen in the wild, and require manual quirking to keep the
usbhid driver from binding to them. Rather than list out every single
device, ignore the entire device ID range, 0x0034 - 0x0046. Some of
these may not advertise themselves as HID devices, but no harm done to
such devices anyway.
Signed-off-by: Jarod Wilson <jarod at redhat.com>
---
drivers/hid/hid-core.c | 10 +++++-----
drivers/hid/hid-ids.h | 7 ++-----
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 5eb10c2..18bf803 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1623,11 +1623,6 @@ static const struct hid_device_id hid_ignore_list[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0003) },
{ HID_USB_DEVICE(USB_VENDOR_ID_PANJIT, 0x0004) },
{ HID_USB_DEVICE(USB_VENDOR_ID_POWERCOM, USB_DEVICE_ID_POWERCOM_UPS) },
- { HID_USB_DEVICE(USB_VENDOR_ID_SOUNDGRAPH, USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD) },
- { HID_USB_DEVICE(USB_VENDOR_ID_SOUNDGRAPH, USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD2) },
- { HID_USB_DEVICE(USB_VENDOR_ID_SOUNDGRAPH, USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD3) },
- { HID_USB_DEVICE(USB_VENDOR_ID_SOUNDGRAPH, USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD4) },
- { HID_USB_DEVICE(USB_VENDOR_ID_SOUNDGRAPH, USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD5) },
{ HID_USB_DEVICE(USB_VENDOR_ID_TENX, USB_DEVICE_ID_TENX_IBUDDY1) },
{ HID_USB_DEVICE(USB_VENDOR_ID_TENX, USB_DEVICE_ID_TENX_IBUDDY2) },
{ HID_USB_DEVICE(USB_VENDOR_ID_VERNIER, USB_DEVICE_ID_VERNIER_LABPRO) },
@@ -1694,6 +1689,11 @@ static bool hid_ignore(struct hid_device *hdev)
hdev->product <= USB_DEVICE_ID_LOGITECH_HARMONY_LAST)
return true;
break;
+ case USB_VENDOR_ID_SOUNDGRAPH:
+ if (hdev->product >= USB_DEVICE_ID_SOUNDGRAPH_IMON_FIRST &&
+ hdev->product <= USB_DEVICE_ID_SOUNDGRAPH_IMON_LAST)
+ return true;
+ break;
}
if (hdev->type == HID_TYPE_USBMOUSE &&
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 6301010..989a3ba 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -376,11 +376,8 @@
#define USB_DEVICE_ID_SONY_PS3_CONTROLLER 0x0268
#define USB_VENDOR_ID_SOUNDGRAPH 0x15c2
-#define USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD 0x0038
-#define USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD2 0x0036
-#define USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD3 0x0034
-#define USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD4 0x0044
-#define USB_DEVICE_ID_SOUNDGRAPH_IMON_LCD5 0x0045
+#define USB_DEVICE_ID_SOUNDGRAPH_IMON_FIRST 0x0034
+#define USB_DEVICE_ID_SOUNDGRAPH_IMON_LAST 0x0046
#define USB_VENDOR_ID_SUN 0x0430
#define USB_DEVICE_ID_RARITAN_KVM_DONGLE 0xcdab
More information about the fedora-extras-commits
mailing list