rpms/kernel/devel hdpvr-ir-enable.patch, 1.2, 1.3 kernel.spec, 1.1743, 1.1744
Jarod Wilson
jwilson at fedoraproject.org
Wed Aug 26 21:23:36 UTC 2009
Author: jwilson
Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9983
Modified Files:
hdpvr-ir-enable.patch kernel.spec
Log Message:
* Wed Aug 26 2009 Jarod Wilson <jarod at redhat.com>
- Fix up hdpvr ir enable patch for use w/modular i2c (David Engel)
hdpvr-ir-enable.patch:
Makefile | 4 +---
hdpvr-core.c | 7 +++----
hdpvr-i2c.c | 49 +++++++++++++++++++++++++++++++++++++++++--------
3 files changed, 45 insertions(+), 15 deletions(-)
Index: hdpvr-ir-enable.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/hdpvr-ir-enable.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- hdpvr-ir-enable.patch 10 Jul 2009 02:07:18 -0000 1.2
+++ hdpvr-ir-enable.patch 26 Aug 2009 21:23:36 -0000 1.3
@@ -1,29 +1,62 @@
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(-)
+ drivers/media/video/hdpvr/Makefile | 4 +--
+ drivers/media/video/hdpvr/hdpvr-core.c | 7 ++--
+ drivers/media/video/hdpvr/hdpvr-i2c.c | 49 ++++++++++++++++++++++++++-----
+ 3 files changed, 45 insertions(+), 15 deletions(-)
+diff --git a/drivers/media/video/hdpvr/Makefile b/drivers/media/video/hdpvr/Makefile
+index e0230fc..79ad2e1 100644
+--- a/drivers/media/video/hdpvr/Makefile
++++ b/drivers/media/video/hdpvr/Makefile
+@@ -1,6 +1,4 @@
+-hdpvr-objs := hdpvr-control.o hdpvr-core.o hdpvr-video.o
+-
+-hdpvr-$(CONFIG_I2C) += hdpvr-i2c.o
++hdpvr-objs := hdpvr-control.o hdpvr-core.o hdpvr-i2c.o hdpvr-video.o
+
+ obj-$(CONFIG_VIDEO_HDPVR) += hdpvr.o
+
diff --git a/drivers/media/video/hdpvr/hdpvr-core.c b/drivers/media/video/hdpvr/hdpvr-core.c
-index 188bd5a..878d1e5 100644
+index 188bd5a..9fa3d8d 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,
+@@ -362,9 +362,8 @@ static int hdpvr_probe(struct usb_interface *interface,
+ goto error;
}
- #ifdef CONFIG_I2C
+-#ifdef CONFIG_I2C
- /* until i2c is working properly */
- retval = 0; /* hdpvr_register_i2c_adapter(dev); */
++#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ retval = hdpvr_register_i2c_adapter(dev);
if (retval < 0) {
v4l2_err(&dev->v4l2_dev, "registering i2c adapter failed\n");
goto error;
+@@ -414,7 +413,7 @@ static void hdpvr_disconnect(struct usb_interface *interface)
+ mutex_unlock(&dev->io_mutex);
+
+ /* deregister I2C adapter */
+-#ifdef CONFIG_I2C
++#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
+ mutex_lock(&dev->i2c_mutex);
+ if (dev->i2c_adapter)
+ i2c_del_adapter(dev->i2c_adapter);
diff --git a/drivers/media/video/hdpvr/hdpvr-i2c.c b/drivers/media/video/hdpvr/hdpvr-i2c.c
-index c4b5d15..1c01b6c 100644
+index c4b5d15..bc33607 100644
--- a/drivers/media/video/hdpvr/hdpvr-i2c.c
+++ b/drivers/media/video/hdpvr/hdpvr-i2c.c
-@@ -22,7 +22,7 @@
+@@ -10,6 +10,8 @@
+ *
+ */
+
++#if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)
++
+ #include <linux/i2c.h>
+
+ #include "hdpvr.h"
+@@ -22,7 +24,7 @@
#define REQTYPE_I2C_WRITE_STATT 0xd0
static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr,
@@ -32,7 +65,7 @@ index c4b5d15..1c01b6c 100644
{
int ret;
char *buf = kmalloc(len, GFP_KERNEL);
-@@ -32,7 +32,7 @@ static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr,
+@@ -32,7 +34,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,
@@ -41,7 +74,7 @@ index c4b5d15..1c01b6c 100644
if (ret == len) {
memcpy(data, buf, len);
-@@ -46,7 +46,7 @@ static int hdpvr_i2c_read(struct hdpvr_device *dev, unsigned char addr,
+@@ -46,7 +48,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,
@@ -50,7 +83,7 @@ index c4b5d15..1c01b6c 100644
{
int ret;
char *buf = kmalloc(len, GFP_KERNEL);
-@@ -57,14 +57,14 @@ static int hdpvr_i2c_write(struct hdpvr_device *dev, unsigned char addr,
+@@ -57,7 +59,7 @@ 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,
@@ -59,15 +92,7 @@ index c4b5d15..1c01b6c 100644
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,
+@@ -93,10 +95,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,
@@ -80,7 +105,7 @@ index c4b5d15..1c01b6c 100644
}
mutex_unlock(&dev->i2c_mutex);
-@@ -114,6 +114,26 @@ static struct i2c_algorithm hdpvr_algo = {
+@@ -114,15 +116,39 @@ static struct i2c_algorithm hdpvr_algo = {
.functionality = hdpvr_functionality,
};
@@ -107,7 +132,11 @@ index c4b5d15..1c01b6c 100644
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)
++ struct i2c_board_info info;
+ int retval = -ENOMEM;
++ const unsigned short addr_list[] = { 0x54, I2C_CLIENT_END };
+
+ i2c_adap = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL);
if (i2c_adap == NULL)
goto error;
@@ -116,3 +145,24 @@ index c4b5d15..1c01b6c 100644
strlcpy(i2c_adap->name, "Hauppauge HD PVR I2C",
sizeof(i2c_adap->name));
i2c_adap->algo = &hdpvr_algo;
+@@ -135,11 +161,18 @@ int hdpvr_register_i2c_adapter(struct hdpvr_device *dev)
+
+ retval = i2c_add_adapter(i2c_adap);
+
+- if (!retval)
++ if (!retval) {
+ dev->i2c_adapter = i2c_adap;
+- else
++ memset(&info, 0, sizeof(struct i2c_board_info));
++ strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
++ i2c_new_probed_device(&dev->i2c_adapter, &info, addr_list);
++
++ } else {
+ kfree(i2c_adap);
++ }
+
+ error:
+ return retval;
+ }
++
++#endif /* CONFIG_I2C */
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1743
retrieving revision 1.1744
diff -u -p -r1.1743 -r1.1744
--- kernel.spec 26 Aug 2009 19:33:53 -0000 1.1743
+++ kernel.spec 26 Aug 2009 21:23:36 -0000 1.1744
@@ -2014,6 +2014,9 @@ fi
# and build.
%changelog
+* Wed Aug 26 2009 Jarod Wilson <jarod at redhat.com>
+- Fix up hdpvr ir enable patch for use w/modular i2c (David Engel)
+
* Wed Aug 26 2009 Eric Paris <eparis at redhat.com>
- fix iint_cache leak in IMA code
drop the ima=0 patch
More information about the scm-commits
mailing list