rpms/kernel/F-11 lirc_zilog-revert-2.6.31-i2c-changes.patch, NONE, 1.1.2.1 hdpvr-ir-enable.patch, 1.1.2.1, 1.1.2.2 kernel.spec, 1.1679.2.16, 1.1679.2.17
Jarod Wilson
jwilson at fedoraproject.org
Wed Aug 26 21:19:43 UTC 2009
Author: jwilson
Update of /cvs/pkgs/rpms/kernel/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv9517
Modified Files:
Tag: private-fedora-11-2_6_29_6
hdpvr-ir-enable.patch kernel.spec
Added Files:
Tag: private-fedora-11-2_6_29_6
lirc_zilog-revert-2.6.31-i2c-changes.patch
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)
- Revert lirc_zilog 2.6.31 i2c changes so it works on pre-2.6.31
lirc_zilog-revert-2.6.31-i2c-changes.patch:
lirc_zilog.c | 58 ++++++++++++++++++++++++++++++++++------------------------
1 file changed, 34 insertions(+), 24 deletions(-)
--- NEW FILE lirc_zilog-revert-2.6.31-i2c-changes.patch ---
drivers/input/lirc/lirc_zilog.c | 58 +++++++++++++++++++++++----------------
1 files changed, 34 insertions(+), 24 deletions(-)
diff --git b/drivers/input/lirc/lirc_zilog.c a/drivers/input/lirc/lirc_zilog.c
index c532399..049c3da 100644
--- b/drivers/input/lirc/lirc_zilog.c
+++ a/drivers/input/lirc/lirc_zilog.c
@@ -1088,26 +1088,18 @@ static struct lirc_driver lirc_template = {
};
static int ir_attach(struct i2c_adapter *adap, int have_rx, int have_tx);
-static int ir_remove(struct i2c_client *client);
-static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id);
+static int ir_detach(struct i2c_client *client);
+static int ir_probe(struct i2c_adapter *adap);
static int ir_command(struct i2c_client *client, unsigned int cmd, void *arg);
-static const struct i2c_device_id ir_transceiver_id[] = {
- /* Generic entry for any IR transceiver */
- { "ir_video", 0 },
- /* IR device specific entries could be added here */
- { }
-};
-
static struct i2c_driver driver = {
.driver = {
.owner = THIS_MODULE,
.name = "i2c ir driver",
},
- .probe = ir_probe,
- .remove = ir_remove,
+ .attach_adapter = ir_probe,
+ .detach_client = ir_detach,
.command = ir_command,
- .id_table = ir_transceiver_id,
};
static struct i2c_client client_template = {
@@ -1128,8 +1120,20 @@ static struct file_operations lirc_fops = {
static int i2c_attach(struct i2c_client *client, struct IR *ir)
{
+ int ret;
+
i2c_set_clientdata(client, ir);
+ ret = i2c_attach_client(client);
+ if (ret != 0) {
+ client->addr = 0;
+ return ret;
+ }
+ if (!i2c_use_client(client)) {
+ i2c_detach_client(client);
+ client->addr = 0;
+ return -EFAULT;
+ }
++ir->devs;
return 0;
}
@@ -1230,13 +1234,13 @@ static int ir_attach(struct i2c_adapter *adap, int have_rx, int have_tx)
err:
/* undo everything, hopefully... */
if (ir->c_rx.addr)
- ir_remove(&ir->c_rx);
+ ir_detach(&ir->c_rx);
if (ir->c_tx.addr)
- ir_remove(&ir->c_tx);
+ ir_detach(&ir->c_tx);
return ret;
}
-static int ir_remove(struct i2c_client *client)
+static int ir_detach(struct i2c_client *client)
{
struct IR *ir = i2c_get_clientdata(client);
mutex_lock(&ir->lock);
@@ -1257,17 +1261,21 @@ static int ir_remove(struct i2c_client *client)
ir->t_notify2 = NULL;
}
+ /* unregister device */
+ i2c_detach_client(&ir->c_rx);
+ } else if (client == &ir->c_tx) {
+ i2c_detach_client(&ir->c_tx);
} else {
mutex_unlock(&ir->lock);
- zilog_error("%s: detached from something we didn't "
- "attach to\n", __func__);
+ zilog_error("ir_detach: detached from something we didn't "
+ "attach to\n");
return -ENODEV;
}
--ir->devs;
if (ir->devs < 0) {
mutex_unlock(&ir->lock);
- zilog_error("%s: invalid device count\n", __func__);
+ zilog_error("ir_detach: invalid device count\n");
return -ENODEV;
} else if (ir->devs == 0) {
/* unregister lirc driver */
@@ -1286,10 +1294,11 @@ static int ir_remove(struct i2c_client *client)
return 0;
}
-static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
+static int ir_probe(struct i2c_adapter *adap)
{
- struct i2c_adapter *adap = client->adapter;
+ struct i2c_client c;
char buf;
+ memset(&c, 0, sizeof(c));
if (adap->id == I2C_HW_B_BT848 ||
#ifdef I2C_HW_B_HDPVR
@@ -1302,10 +1311,11 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
* The external IR receiver is at i2c address 0x71.
* The IR transmitter is at 0x70.
*/
- client->addr = 0x70;
+ c.adapter = adap;
+ c.addr = 0x70;
if (!disable_rx) {
- if (i2c_master_recv(client, &buf, 1) == 1)
+ if (i2c_master_recv(&c, &buf, 1) == 1)
have_rx = 1;
dprintk("probe 0x70 @ %s: %s\n",
adap->name,
@@ -1313,8 +1323,8 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
}
if (!disable_tx) {
- client->addr = 0x71;
- if (i2c_master_recv(client, &buf, 1) == 1)
+ c.addr = 0x71;
+ if (i2c_master_recv(&c, &buf, 1) == 1)
have_tx = 1;
dprintk("probe 0x71 @ %s: %s\n",
adap->name,
hdpvr-ir-enable.patch:
Makefile | 4 +---
hdpvr-core.c | 7 +++----
hdpvr-i2c.c | 38 ++++++++++++++++++++++++++++++++------
3 files changed, 36 insertions(+), 13 deletions(-)
Index: hdpvr-ir-enable.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/hdpvr-ir-enable.patch,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.1 -r1.1.2.2
--- hdpvr-ir-enable.patch 10 Aug 2009 18:33:00 -0000 1.1.2.1
+++ hdpvr-ir-enable.patch 26 Aug 2009 21:19:43 -0000 1.1.2.2
@@ -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 | 38 ++++++++++++++++++++++++++-----
+ 3 files changed, 36 insertions(+), 13 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..994305c 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,6 +116,26 @@ static struct i2c_algorithm hdpvr_algo = {
.functionality = hdpvr_functionality,
};
@@ -107,7 +132,7 @@ 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)
+@@ -123,6 +145,8 @@ int hdpvr_register_i2c_adapter(struct hdpvr_device *dev)
if (i2c_adap == NULL)
goto error;
@@ -116,3 +141,9 @@ index c4b5d15..1c01b6c 100644
strlcpy(i2c_adap->name, "Hauppauge HD PVR I2C",
sizeof(i2c_adap->name));
i2c_adap->algo = &hdpvr_algo;
+@@ -143,3 +167,5 @@ int hdpvr_register_i2c_adapter(struct hdpvr_device *dev)
+ error:
+ return retval;
+ }
++
++#endif /* CONFIG_I2C */
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/kernel.spec,v
retrieving revision 1.1679.2.16
retrieving revision 1.1679.2.17
diff -u -p -r1.1679.2.16 -r1.1679.2.17
--- kernel.spec 24 Aug 2009 20:39:12 -0000 1.1679.2.16
+++ kernel.spec 26 Aug 2009 21:19:43 -0000 1.1679.2.17
@@ -702,6 +702,7 @@ Patch1000: linux-2.6-neigh_-fix-state-tr
Patch1515: linux-2.6.29-lirc.patch
Patch1517: hdpvr-ir-enable.patch
Patch1518: hid-ignore-all-recent-imon-devices.patch
+Patch1519: lirc_zilog-revert-2.6.31-i2c-changes.patch
# Fix the return code CD accesses when the CDROM drive door is closed
# but the drive isn't yet ready.
@@ -1451,6 +1452,7 @@ ApplyPatch linux-2.6-neigh_-fix-state-tr
# http://www.lirc.org/
ApplyPatch linux-2.6.29-lirc.patch
ApplyPatch hid-ignore-all-recent-imon-devices.patch
+ApplyPatch lirc_zilog-revert-2.6.31-i2c-changes.patch
# Fix the return code CD accesses when the CDROM drive door is closed
# but the drive isn't yet ready.
@@ -2178,7 +2180,11 @@ fi
# and build.
%changelog
-* Mon Sep 24 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29.6-217.2.16
+* Wed Aug 26 2009 Jarod Wilson <jarod at redhat.com>
+- Fix up hdpvr ir enable patch for use w/modular i2c (David Engel)
+- Revert lirc_zilog 2.6.31 i2c changes so it works on pre-2.6.31
+
+* Mon Aug 24 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29.6-217.2.16
- Fix CVE-2009-2691: local information disclosure in /proc
* Fri Aug 21 2009 David Woodhouse <David.Woodhouse at intel.com>
More information about the fedora-extras-commits
mailing list