rpms/kernel/F-11 lirc-2.6.31.patch, NONE, 1.1 lirc-revert-2.6.31-i2c-changes.patch, NONE, 1.1 v4l-dvb-fix-cx25840-firmware-load.patch, 1.1, 1.2 config-generic, 1.290, 1.291 hdpvr-ir-enable.patch, 1.3, 1.4 kernel.spec, 1.1723, 1.1724 linux-2.6.29-lirc.patch, 1.13, NONE
Jarod Wilson
jwilson at fedoraproject.org
Tue Sep 1 04:18:46 UTC 2009
Author: jwilson
Update of /cvs/pkgs/rpms/kernel/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv429
Modified Files:
config-generic hdpvr-ir-enable.patch kernel.spec
Added Files:
lirc-2.6.31.patch lirc-revert-2.6.31-i2c-changes.patch
v4l-dvb-fix-cx25840-firmware-load.patch
Removed Files:
linux-2.6.29-lirc.patch
Log Message:
* Tue Sep 01 2009 Jarod Wilson <jarod at redhat.com> 2.5.30.5-45
- Refresh lirc patches, add new lirc_ene0100 driver
- Fix up hdpvr driver for use with modular i2c so that
lirc_zilog can actually bind to it
- Make lirc_zilog IR transmit and receive work on the hdpvr
- Fix audio on PVR-500 when used in same system as HVR-1800 (#480728)
lirc-2.6.31.patch:
Kconfig | 2
Makefile | 2
lirc/Kconfig | 119 ++
lirc/Makefile | 21
lirc/lirc.h | 100 ++
lirc/lirc_bt829.c | 383 +++++++
lirc/lirc_dev.c | 839 +++++++++++++++++
lirc/lirc_dev.h | 184 +++
lirc/lirc_ene0100.c | 644 +++++++++++++
lirc/lirc_ene0100.h | 169 +++
lirc/lirc_i2c.c | 537 +++++++++++
lirc/lirc_igorplugusb.c | 556 +++++++++++
lirc/lirc_imon.c | 2301 ++++++++++++++++++++++++++++++++++++++++++++++++
lirc/lirc_it87.c | 986 ++++++++++++++++++++
lirc/lirc_it87.h | 116 ++
lirc/lirc_ite8709.c | 539 +++++++++++
lirc/lirc_mceusb.c | 1225 +++++++++++++++++++++++++
lirc/lirc_parallel.c | 709 ++++++++++++++
lirc/lirc_parallel.h | 26
lirc/lirc_sasem.c | 931 +++++++++++++++++++
lirc/lirc_serial.c | 1316 +++++++++++++++++++++++++++
lirc/lirc_sir.c | 1283 ++++++++++++++++++++++++++
lirc/lirc_streamzap.c | 794 ++++++++++++++++
lirc/lirc_ttusbir.c | 397 ++++++++
lirc/lirc_zilog.c | 1395 +++++++++++++++++++++++++++++
25 files changed, 15574 insertions(+)
--- NEW FILE lirc-2.6.31.patch ---
Linux Infrared Remote Control drivers -- http://www.lirc.org
>From http://git.wilsonet.com/linux-2.6-lirc.git/
Refreshed 20090901
Signed-off-by: Jarod Wilson <jarod at redhat.com>
---
drivers/input/Kconfig | 2 +
drivers/input/Makefile | 2 +
drivers/input/lirc/Kconfig | 119 ++
drivers/input/lirc/Makefile | 21 +
drivers/input/lirc/lirc.h | 100 ++
drivers/input/lirc/lirc_bt829.c | 383 ++++++
drivers/input/lirc/lirc_dev.c | 839 ++++++++++++
drivers/input/lirc/lirc_dev.h | 184 +++
drivers/input/lirc/lirc_ene0100.c | 644 +++++++++
drivers/input/lirc/lirc_ene0100.h | 169 +++
drivers/input/lirc/lirc_i2c.c | 537 ++++++++
drivers/input/lirc/lirc_igorplugusb.c | 556 ++++++++
drivers/input/lirc/lirc_imon.c | 2301 +++++++++++++++++++++++++++++++++
drivers/input/lirc/lirc_it87.c | 986 ++++++++++++++
drivers/input/lirc/lirc_it87.h | 116 ++
drivers/input/lirc/lirc_ite8709.c | 539 ++++++++
drivers/input/lirc/lirc_mceusb.c | 1225 ++++++++++++++++++
drivers/input/lirc/lirc_parallel.c | 709 ++++++++++
drivers/input/lirc/lirc_parallel.h | 26 +
drivers/input/lirc/lirc_sasem.c | 931 +++++++++++++
drivers/input/lirc/lirc_serial.c | 1316 +++++++++++++++++++
drivers/input/lirc/lirc_sir.c | 1283 ++++++++++++++++++
drivers/input/lirc/lirc_streamzap.c | 794 ++++++++++++
drivers/input/lirc/lirc_ttusbir.c | 397 ++++++
drivers/input/lirc/lirc_zilog.c | 1395 ++++++++++++++++++++
25 files changed, 15574 insertions(+), 0 deletions(-)
diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig
index cd50c00..442f94f 100644
--- a/drivers/input/Kconfig
+++ b/drivers/input/Kconfig
@@ -170,6 +170,8 @@ source "drivers/input/tablet/Kconfig"
source "drivers/input/touchscreen/Kconfig"
+source "drivers/input/lirc/Kconfig"
+
source "drivers/input/misc/Kconfig"
endif
diff --git a/drivers/input/Makefile b/drivers/input/Makefile
index 4c9c745..99e2b5e 100644
--- a/drivers/input/Makefile
+++ b/drivers/input/Makefile
@@ -25,3 +25,5 @@ obj-$(CONFIG_INPUT_MISC) += misc/
obj-$(CONFIG_INPUT_APMPOWER) += apm-power.o
obj-$(CONFIG_XEN_KBDDEV_FRONTEND) += xen-kbdfront.o
+
+obj-$(CONFIG_INPUT_LIRC) += lirc/
diff --git a/drivers/input/lirc/Kconfig b/drivers/input/lirc/Kconfig
new file mode 100644
index 0000000..ab13cfe
--- /dev/null
+++ b/drivers/input/lirc/Kconfig
@@ -0,0 +1,119 @@
+#
+# LIRC driver(s) configuration
+#
+menuconfig INPUT_LIRC
+ bool "Linux Infrared Remote Control IR receiver/transmitter drivers"
+ help
+ Say Y here, and all supported Linux Infrared Remote Control IR and
+ RF receiver and transmitter drivers will be displayed. When paired
+ with a remote control and the lirc daemon, the receiver drivers
+ allow control of your Linux system via remote control.
+
+if INPUT_LIRC
+
+config LIRC_DEV
+ tristate "LIRC device loadable module support"
+ help
+ LIRC device loadable module support, required for most LIRC drivers
+
+config LIRC_BT829
+ tristate "BT829 based hardware"
+ depends on LIRC_DEV
+ help
+ Driver for the IR interface on BT829-based hardware
+
+config LIRC_ENE0100
+ tristate "ENE KB3924/ENE0100 CIR Port Reciever"
+ depends on LIRC_DEV
+ help
+ This is a driver for CIR port handled by ENE KB3924 embedded
+ controller found on some notebooks.
+ It appears on PNP list as ENE0100.
+
+config LIRC_I2C
+ tristate "I2C Based IR Receivers"
+ depends on LIRC_DEV
+ help
+ Driver for I2C-based IR receivers, such as those commonly
+ found onboard Hauppauge PVR-150/250/350 video capture cards
+
+config LIRC_IGORPLUGUSB
+ tristate "Igor Cesko's USB IR Receiver"
+ depends on LIRC_DEV && USB
+ help
+ Driver for Igor Cesko's USB IR Receiver
+
+config LIRC_IMON
+ tristate "Soundgraph IMON Receiver"
+ depends on LIRC_DEV
+ help
+ Driver for the Soundgraph IMON IR Receiver
+
+config LIRC_IT87
+ tristate "ITE IT87XX CIR Port Receiver"
+ depends on LIRC_DEV
+ help
+ Driver for the ITE IT87xx IR Receiver
+
+config LIRC_ITE8709
+ tristate "ITE8709 CIR Port Receiver"
+ depends on LIRC_DEV && PNP
+ help
+ Driver for the ITE8709 IR Receiver
+
+config LIRC_MCEUSB
+ tristate "Windows Media Center Ed. USB IR Transceiver"
+ depends on LIRC_DEV && USB
+ help
+ Driver for Windows Media Center Ed. USB IR Transceivers
+
+config LIRC_PARALLEL
+ tristate "Homebrew Parallel Port Receiver"
+ depends on LIRC_DEV && !SMP
+ help
+ Driver for Homebrew Parallel Port Receivers
+
+config LIRC_SASEM
+ tristate "Sasem USB IR Remote"
+ depends on LIRC_DEV
+ help
+ Driver for the Sasem OnAir Remocon-V or Dign HV5 HTPC IR/VFD Module
+
+config LIRC_SERIAL
+ tristate "Homebrew Serial Port Receiver"
+ depends on LIRC_DEV
+ help
+ Driver for Homebrew Serial Port Receivers
+
+config LIRC_SERIAL_TRANSMITTER
+ bool "Serial Port Transmitter"
+ default y
+ depends on LIRC_SERIAL
+ help
+ Serial Port Transmitter support
+
+config LIRC_SIR
+ tristate "Built-in SIR IrDA port"
+ depends on LIRC_DEV
+ help
+ Driver for the SIR IrDA port
+
+config LIRC_STREAMZAP
+ tristate "Streamzap PC Receiver"
+ depends on LIRC_DEV
+ help
+ Driver for the Streamzap PC Receiver
+
+config LIRC_TTUSBIR
+ tristate "Technotrend USB IR Receiver"
+ depends on LIRC_DEV && USB
+ help
+ Driver for the Technotrend USB IR Receiver
+
+config LIRC_ZILOG
+ tristate "Zilog/Hauppauge IR Transmitter"
+ depends on LIRC_DEV
+ help
+ Driver for the Zilog/Hauppauge IR Transmitter, found on
+ PVR-150/500, HVR-1200/1250/1700/1800, HD-PVR and other cards
+endif
diff --git a/drivers/input/lirc/Makefile b/drivers/input/lirc/Makefile
new file mode 100644
index 0000000..8da7aa9
--- /dev/null
+++ b/drivers/input/lirc/Makefile
@@ -0,0 +1,21 @@
+# Makefile for the lirc drivers.
+#
+
+# Each configuration option enables a list of files.
+
+obj-$(CONFIG_LIRC_DEV) += lirc_dev.o
+obj-$(CONFIG_LIRC_BT829) += lirc_bt829.o
+obj-$(CONFIG_LIRC_ENE0100) += lirc_ene0100.o
+obj-$(CONFIG_LIRC_I2C) += lirc_i2c.o
[...15368 lines suppressed...]
+ ir->task = kthread_run(lirc_thread, ir, "lirc_zilog");
+ if (IS_ERR(ir->task)) {
+ ret = PTR_ERR(ir->task);
+ zilog_error("lirc_register_driver: cannot run "
+ "poll thread %d\n", ret);
+ goto err;
+ }
+ wait_for_completion(&tn);
+ ir->t_notify = NULL;
+ }
+
+ /* initialise TX device */
+ memcpy(&ir->c_tx, &client_template, sizeof(struct i2c_client));
+ if (have_tx) {
+ /* I2C attach to device */
+ ir->c_tx.addr = 0x70;
+ strncpy(ir->c_tx.name, "Zilog/Hauppauge TX", I2C_NAME_SIZE);
+ ret = i2c_attach(&ir->c_tx, ir);
+ if (ret != 0)
+ goto err;
+ }
+
+ /* set lirc_dev stuff */
+ ir->l.code_length = 13;
+ ir->l.rbuf = &ir->buf;
+ ir->l.fops = &lirc_fops;
+ ir->l.data = ir;
+ ir->l.minor = minor;
+ ir->l.sample_rate = 0;
+
+ /* register with lirc */
+ ir->l.minor = lirc_register_driver(&ir->l);
+ if (ir->l.minor < 0 || ir->l.minor >= MAX_IRCTL_DEVICES) {
+ zilog_error("ir_attach: \"minor\" must be between 0 and %d "
+ "(%d)!\n", MAX_IRCTL_DEVICES-1, ir->l.minor);
+ ret = -EBADRQC;
+ goto err;
+ }
+
+ /* store this for getting back in open() later on */
+ ir_devices[ir->l.minor] = ir;
+
+ /*
+ * if we have the tx device, load the 'firmware'. We do this
+ * after registering with lirc as otherwise hotplug seems to take
+ * 10s to create the lirc device.
+ */
+ if (have_tx) {
+ /* Special TX init */
+ ret = tx_init(ir);
+ if (ret != 0)
+ goto err;
+ }
+ return 0;
+
+err:
+ /* undo everything, hopefully... */
+ if (ir->c_rx.addr)
+ ir_remove(&ir->c_rx);
+ if (ir->c_tx.addr)
+ ir_remove(&ir->c_tx);
+ return ret;
+}
+
+static int ir_remove(struct i2c_client *client)
+{
+ struct IR *ir = i2c_get_clientdata(client);
+ mutex_lock(&ir->lock);
+
+ if (client == &ir->c_rx) {
+ DECLARE_COMPLETION(tn);
+ DECLARE_COMPLETION(tn2);
+
+ /* end up polling thread */
+ if (ir->task && !IS_ERR(ir->task)) {
+ ir->t_notify = &tn;
+ ir->t_notify2 = &tn2;
+ ir->shutdown = 1;
+ wake_up_process(ir->task);
+ complete(&tn2);
+ wait_for_completion(&tn);
+ ir->t_notify = NULL;
+ ir->t_notify2 = NULL;
+ }
+
+ } else {
+ mutex_unlock(&ir->lock);
+ zilog_error("%s: detached from something we didn't "
+ "attach to\n", __func__);
+ return -ENODEV;
+ }
+
+ --ir->devs;
+ if (ir->devs < 0) {
+ mutex_unlock(&ir->lock);
+ zilog_error("%s: invalid device count\n", __func__);
+ return -ENODEV;
+ } else if (ir->devs == 0) {
+ /* unregister lirc driver */
+ if (ir->l.minor >= 0 && ir->l.minor < MAX_IRCTL_DEVICES) {
+ lirc_unregister_driver(ir->l.minor);
+ ir_devices[ir->l.minor] = NULL;
+ }
+
+ /* free memory */
+ lirc_buffer_free(&ir->buf);
+ mutex_unlock(&ir->lock);
+ kfree(ir);
+ return 0;
+ }
+ mutex_unlock(&ir->lock);
+ return 0;
+}
+
+static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
+{
+ struct i2c_adapter *adap = client->adapter;
+ char buf;
+
+ if (adap->id == I2C_HW_B_BT848 ||
+#ifdef I2C_HW_B_HDPVR
+ adap->id == I2C_HW_B_HDPVR ||
+#endif
+ adap->id == I2C_HW_B_CX2341X) {
+ int have_rx = 0, have_tx = 0;
+
+ /*
+ * The external IR receiver is at i2c address 0x71.
+ * The IR transmitter is at 0x70.
+ */
+ client->addr = 0x70;
+
+ if (!disable_rx) {
+ if (i2c_master_recv(client, &buf, 1) == 1)
+ have_rx = 1;
+ dprintk("probe 0x70 @ %s: %s\n",
+ adap->name,
+ have_rx ? "yes" : "no");
+ }
+
+ if (!disable_tx) {
+ client->addr = 0x71;
+ if (i2c_master_recv(client, &buf, 1) == 1)
+ have_tx = 1;
+ dprintk("probe 0x71 @ %s: %s\n",
+ adap->name,
+ have_tx ? "yes" : "no");
+ }
+
+ if (have_rx || have_tx)
+ return ir_attach(adap, have_rx, have_tx);
+ else
+ zilog_error("%s: no devices found\n", adap->name);
+ }
+
+ return 0;
+}
+
+static int ir_command(struct i2c_client *client, unsigned int cmd, void *arg)
+{
+ /* nothing */
+ return 0;
+}
+
+static int __init zilog_init(void)
+{
+ mutex_init(&tx_data_lock);
+ request_module("firmware_class");
+ i2c_add_driver(&driver);
+ return 0;
+}
+
+static void __exit zilog_exit(void)
+{
+ i2c_del_driver(&driver);
+ /* if loaded */
+ fw_unload();
+}
+
+module_init(zilog_init);
+module_exit(zilog_exit);
+
+MODULE_DESCRIPTION("Zilog/Hauppauge infrared transmitter driver (i2c stack)");
+MODULE_AUTHOR("Gerd Knorr, Michal Kochanowicz, Christoph Bartelmus, "
+ "Ulrich Mueller, Stefan Jahn, Jerome Brock, Mark Weaver");
+MODULE_LICENSE("GPL");
+/* for compat with old name, which isn't all that accurate anymore */
+MODULE_ALIAS("lirc_pvr150");
+
+module_param(minor, int, 0444);
+MODULE_PARM_DESC(minor, "Preferred minor device number");
+
+module_param(debug, bool, 0644);
+MODULE_PARM_DESC(debug, "Enable debugging messages");
+
+module_param(disable_rx, bool, 0644);
+MODULE_PARM_DESC(disable_rx, "Disable the IR receiver device");
+
+module_param(disable_tx, bool, 0644);
+MODULE_PARM_DESC(disable_tx, "Disable the IR transmitter device");
lirc-revert-2.6.31-i2c-changes.patch:
a/drivers/input/lirc/lirc_zilog.c | 58 +++++-----
b/drivers/input/lirc/lirc_i2c.c | 216 ++++++++++++++++++++++++++++----------
2 files changed, 198 insertions(+), 76 deletions(-)
--- NEW FILE lirc-revert-2.6.31-i2c-changes.patch ---
drivers/input/lirc/lirc_i2c.c | 216 ++++++++++++++++++++++++++++++---------
drivers/input/lirc/lirc_zilog.c | 58 +++++----
2 files changed, 198 insertions(+), 76 deletions(-)
diff --git a/drivers/input/lirc/lirc_i2c.c b/drivers/input/lirc/lirc_i2c.c
index e27d937..dedf415 100644
--- a/drivers/input/lirc/lirc_i2c.c
+++ b/drivers/input/lirc/lirc_i2c.c
@@ -168,18 +168,15 @@ static int add_to_buf_haup_common(void *data, struct lirc_buffer *buf,
struct IR *ir = data;
__u16 code;
unsigned char codes[2];
- int ret;
/* poll IR chip */
- ret = i2c_master_recv(&ir->c, keybuf, size);
- if (ret == size) {
+ if (size == i2c_master_recv(&ir->c, keybuf, size)) {
ir->b[0] = keybuf[offset];
ir->b[1] = keybuf[offset+1];
ir->b[2] = keybuf[offset+2];
- if (ir->b[0] != 0x00 && ir->b[1] != 0x00)
- dprintk("key (0x%02x/0x%02x)\n", ir->b[0], ir->b[1]);
+ dprintk("key (0x%02x/0x%02x)\n", ir->b[0], ir->b[1]);
} else {
- dprintk("read error (ret=%d)\n", ret);
+ dprintk("read error\n");
/* keep last successful read buffer */
}
@@ -194,7 +191,6 @@ static int add_to_buf_haup_common(void *data, struct lirc_buffer *buf,
codes[1] = code & 0xff;
/* return it */
- dprintk("sending code 0x%02x%02x to lirc\n", codes[0], codes[1]);
lirc_buffer_write(buf, codes);
return 0;
}
@@ -327,8 +323,6 @@ static int set_use_inc(void *data)
{
struct IR *ir = data;
- dprintk("%s called\n", __func__);
-
/* lock bttv in memory while /dev/lirc is in use */
i2c_use_client(&ir->c);
@@ -339,8 +333,6 @@ static void set_use_dec(void *data)
{
struct IR *ir = data;
- dprintk("%s called\n", __func__);
-
i2c_release_client(&ir->c);
}
@@ -352,64 +344,45 @@ static struct lirc_driver lirc_template = {
.owner = THIS_MODULE,
};
-static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id);
-static int ir_remove(struct i2c_client *client);
+static int ir_attach(struct i2c_adapter *adap, int addr,
+ unsigned short flags, int kind);
+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_receiver_id[] = {
- /* Generic entry for any IR receiver */
- { "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,
- .id_table = ir_receiver_id,
+ .attach_adapter = ir_probe,
+ .detach_client = ir_detach,
.command = ir_command,
};
-static void pcf_probe(struct i2c_client *client, struct IR *ir)
-{
- int ret1, ret2, ret3, ret4;
-
- ret1 = i2c_smbus_write_byte(client, 0xff);
- ret2 = i2c_smbus_read_byte(client);
- ret3 = i2c_smbus_write_byte(client, 0x00);
- ret4 = i2c_smbus_read_byte(client);
-
- /* in the Asus TV-Box: bit 1-0 */
- if (((ret2 & 0x03) == 0x03) && ((ret4 & 0x03) == 0x00)) {
- ir->bits = (unsigned char) ~0x07;
- ir->flag = 0x04;
- /* in the Creative/VisionTek BreakOut-Box: bit 7-6 */
- } else if (((ret2 & 0xc0) == 0xc0) && ((ret4 & 0xc0) == 0x00)) {
- ir->bits = (unsigned char) ~0xe0;
- ir->flag = 0x20;
- }
-
- return;
-}
+static struct i2c_client client_template = {
+ .name = "unset",
+ .driver = &driver
+};
-static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
+static int ir_attach(struct i2c_adapter *adap, int addr,
+ unsigned short flags, int kind)
{
struct IR *ir;
- struct i2c_adapter *adap = client->adapter;
- unsigned short addr = client->addr;
- int retval;
+ int err, retval;
+
+ client_template.adapter = adap;
+ client_template.addr = addr;
ir = kzalloc(sizeof(struct IR), GFP_KERNEL);
if (!ir)
return -ENOMEM;
memcpy(&ir->l, &lirc_template, sizeof(struct lirc_driver));
- memcpy(&ir->c, client, sizeof(struct i2c_client));
+ memcpy(&ir->c, &client_template, sizeof(struct i2c_client));
- i2c_set_clientdata(client, ir);
+ ir->c.adapter = adap;
+ ir->c.addr = addr;
+ i2c_set_clientdata(&ir->c, ir);
ir->l.data = ir;
ir->l.minor = minor;
ir->l.sample_rate = 10;
@@ -465,10 +438,11 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
break;
case 0x21:
case 0x23:
- pcf_probe(client, ir);
strlcpy(ir->c.name, "TV-Box IR", I2C_NAME_SIZE);
ir->l.code_length = 8;
ir->l.add_to_buf = add_to_buf_pcf8574;
+ ir->bits = flags & 0xff;
+ ir->flag = (flags >> 8) & 0xff;
break;
default:
/* shouldn't happen */
@@ -479,6 +453,13 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
printk(KERN_INFO "lirc_i2c: chip 0x%x found @ 0x%02x (%s)\n",
adap->id, addr, ir->c.name);
+ /* register device */
+ err = i2c_attach_client(&ir->c);
+ if (err) {
+ kfree(ir);
+ return err;
+ }
+
retval = lirc_register_driver(&ir->l);
if (retval < 0) {
@@ -492,18 +473,149 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
return 0;
}
-static int ir_remove(struct i2c_client *client)
+static int ir_detach(struct i2c_client *client)
{
struct IR *ir = i2c_get_clientdata(client);
/* unregister device */
lirc_unregister_driver(ir->l.minor);
+ i2c_detach_client(&ir->c);
/* free memory */
kfree(ir);
return 0;
}
+static int ir_probe(struct i2c_adapter *adap)
+{
+ /*
+ * The external IR receiver is at i2c address 0x34 (0x35 for
+ * reads). Future Hauppauge cards will have an internal
+ * receiver at 0x30 (0x31 for reads). In theory, both can be
+ * fitted, and Hauppauge suggest an external overrides an
+ * internal.
+ *
+ * That's why we probe 0x1a (~0x34) first. CB
+ *
+ * The i2c address for the Hauppauge PVR-150 card is 0xe2,
+ * so we need to probe 0x71 as well.
+ */
+
+ static const int probe[] = {
+ 0x1a, /* Hauppauge IR external */
+ 0x18, /* Hauppauge IR internal */
+ 0x71, /* Hauppauge IR (PVR150) */
+ 0x4b, /* PV951 IR */
+ 0x64, /* Pixelview IR */
+ 0x30, /* KNC ONE IR */
+ 0x6b, /* Adaptec IR */
+ -1};
+
+ static const int probe_cx88[] = {
+ 0x18, /* Leadtek Winfast PVR2000 */
+ 0x71, /* Hauppauge HVR-IR */
+ -1};
+
+ struct i2c_client c;
+ char buf;
+ int i, rc;
+ memset(&c, 0, sizeof(c));
+
+ if (adap->id == I2C_HW_B_BT848 ||
+ adap->id == I2C_HW_B_CX2341X) {
+ c.adapter = adap;
+ for (i = 0; -1 != probe[i]; i++) {
+ c.addr = probe[i];
+ rc = i2c_master_recv(&c, &buf, 1);
+ dprintk("probe 0x%02x @ %s: %s\n",
+ probe[i], adap->name,
+ (1 == rc) ? "yes" : "no");
+ if (1 == rc) {
+ rc = ir_attach(adap, probe[i], 0, 0);
+ if (rc < 0)
+ goto attach_fail;
+ }
+ }
+ }
+
+ /* Leadtek Winfast PVR2000 or Hauppauge HVR-1300 */
+ else if (adap->id == I2C_HW_B_CX2388x) {
+ c.adapter = adap;
+ for (i = 0; -1 != probe_cx88[i]; i++) {
+ c.addr = probe_cx88[i];
+ rc = i2c_master_recv(&c, &buf, 1);
+ dprintk("probe 0x%02x @ %s: %s\n",
+ c.addr, adap->name,
+ (1 == rc) ? "yes" : "no");
+ if (1 == rc) {
+ rc = ir_attach(adap, c.addr, 0, 0);
+ if (rc < 0)
+ goto attach_fail;
+ }
+ }
+ }
+
+ /* Asus TV-Box and Creative/VisionTek BreakOut-Box (PCF8574) */
+ else if (adap->id == I2C_HW_B_RIVA) {
+ /*
+ * addresses to probe;
+ * leave 0x24 and 0x25 because SAA7113H possibly uses it
+ * 0x21 and 0x22 possibly used by SAA7108E
+ * Asus: 0x21 is a correct address (channel 1 of PCF8574)
+ * Creative: 0x23 is a correct address (channel 3 of PCF8574)
+ * VisionTek: 0x23 is a correct address (channel 3 of PCF8574)
+ */
+ static const int pcf_probe[] = { 0x20, 0x21, 0x22, 0x23,
+ 0x24, 0x25, 0x26, 0x27, -1 };
+ int ret1, ret2, ret3, ret4;
+ unsigned char bits = 0, flag = 0;
+
+ c.adapter = adap;
+ for (i = 0; -1 != pcf_probe[i]; i++) {
+ c.addr = pcf_probe[i];
+ ret1 = i2c_smbus_write_byte(&c, 0xff);
+ ret2 = i2c_smbus_read_byte(&c);
+ ret3 = i2c_smbus_write_byte(&c, 0x00);
+ ret4 = i2c_smbus_read_byte(&c);
+
+ /* ensure that the writable bitmask works correctly */
+ rc = 0;
+ if (ret1 != -1 && ret2 != -1 &&
+ ret3 != -1 && ret4 != -1) {
+ /* in the Asus TV-Box: bit 1-0 */
+ if (((ret2 & 0x03) == 0x03) &&
+ ((ret4 & 0x03) == 0x00)) {
+ bits = (unsigned char) ~0x07;
+ flag = 0x04;
+ rc = 1;
+ }
+ /* in the Creative/VisionTek BreakOut-Box: bit 7-6 */
+ if (((ret2 & 0xc0) == 0xc0) &&
+ ((ret4 & 0xc0) == 0x00)) {
+ bits = (unsigned char) ~0xe0;
+ flag = 0x20;
+ rc = 1;
+ }
+ }
+ dprintk("probe 0x%02x @ %s: %s\n",
+ c.addr, adap->name, rc ? "yes" : "no");
+ if (rc) {
+ rc = ir_attach(adap, pcf_probe[i],
+ bits | (flag << 8), 0);
+ if (rc < 0)
+ goto attach_fail;
+ }
+ }
+ }
+
+ return 0;
+
+attach_fail:
+ printk(KERN_ERR "lirc_i2c: %s: ir_attach failed!\n", __func__);
+ return rc;
+
+}
+
static int ir_command(struct i2c_client *client, unsigned int cmd, void *arg)
{
/* nothing */
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,
v4l-dvb-fix-cx25840-firmware-load.patch:
cx25840-firmware.c | 2 ++
1 file changed, 2 insertions(+)
Index: v4l-dvb-fix-cx25840-firmware-load.patch
===================================================================
RCS file: v4l-dvb-fix-cx25840-firmware-load.patch
diff -N v4l-dvb-fix-cx25840-firmware-load.patch
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ v4l-dvb-fix-cx25840-firmware-load.patch 1 Sep 2009 04:18:45 -0000 1.2
@@ -0,0 +1,29 @@
+
+# HG changeset patch
+# User Steven Toth <stoth at kernellabs.com>
+# Date 1251746101 14400
+# Node ID 38c5fb14c770c256d1a497ff6da3e33849f6b8cf
+# Parent 7c23abfe445f8b57d57db98a97a0786ab801d63e
+CX25840: Bugfix CX23885 and CX241xx caused ivtv regression.
+
+From: Steven Toth <stoth at kernellabs.com>
+
+If we override a global we need to ensure the else case resets it correctly,
+or we end up loading an incorrect firmware.
+
+Priority: normal
+
+Signed-off-by: Steven Toth <stoth at kernellabs.com>
+
+--- a/drivers/media/video/cx25840/cx25840-firmware.c Mon Aug 31 02:03:28 2009 -0300
++++ b/drivers/media/video/cx25840/cx25840-firmware.c Mon Aug 31 15:15:01 2009 -0400
+@@ -109,6 +109,8 @@
+ }
+ else if (state->is_cx231xx)
+ firmware = FWFILE_CX231XX;
++ else
++ firmware = FWFILE;
+
+ if ((state->is_cx231xx) && MAX_BUF_SIZE > 16) {
+ v4l_err(client, " Firmware download size changed to 16 bytes max length\n");
+
Index: config-generic
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/config-generic,v
retrieving revision 1.290
retrieving revision 1.291
diff -u -p -r1.290 -r1.291
--- config-generic 28 Aug 2009 16:47:11 -0000 1.290
+++ config-generic 1 Sep 2009 04:18:44 -0000 1.291
@@ -3744,6 +3744,7 @@ CONFIG_DEFAULT_RELATIME=y
CONFIG_INPUT_LIRC=y
CONFIG_LIRC_DEV=m
CONFIG_LIRC_BT829=m
+CONFIG_LIRC_ENE0100=m
CONFIG_LIRC_I2C=m
CONFIG_LIRC_IGORPLUGUSB=m
CONFIG_LIRC_IMON=m
hdpvr-ir-enable.patch:
Makefile | 4 +---
hdpvr-core.c | 7 +++----
hdpvr-i2c.c | 40 +++++++++++++++++++++++++++++++++-------
3 files changed, 37 insertions(+), 14 deletions(-)
Index: hdpvr-ir-enable.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/hdpvr-ir-enable.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- hdpvr-ir-enable.patch 31 Aug 2009 14:28:07 -0000 1.3
+++ hdpvr-ir-enable.patch 1 Sep 2009 04:18:44 -0000 1.4
@@ -3,8 +3,8 @@ From http://hg.jannau.net/hdpvr/, pendin
---
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(-)
+ drivers/media/video/hdpvr/hdpvr-i2c.c | 40 ++++++++++++++++++++++++++-----
+ 3 files changed, 37 insertions(+), 14 deletions(-)
diff --git a/drivers/media/video/hdpvr/Makefile b/drivers/media/video/hdpvr/Makefile
index e0230fc..79ad2e1 100644
@@ -19,7 +19,7 @@ index e0230fc..79ad2e1 100644
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..9fa3d8d 100644
+index 188bd5a..779f907 100644
--- a/drivers/media/video/hdpvr/hdpvr-core.c
+++ b/drivers/media/video/hdpvr/hdpvr-core.c
@@ -362,9 +362,8 @@ static int hdpvr_probe(struct usb_interface *interface,
@@ -44,7 +44,7 @@ index 188bd5a..9fa3d8d 100644
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..994305c 100644
+index c4b5d15..e0ae619 100644
--- a/drivers/media/video/hdpvr/hdpvr-i2c.c
+++ b/drivers/media/video/hdpvr/hdpvr-i2c.c
@@ -10,6 +10,8 @@
@@ -92,6 +92,15 @@ index c4b5d15..994305c 100644
if (ret < 0)
goto error;
+@@ -67,7 +69,7 @@ static int hdpvr_i2c_write(struct hdpvr_device *dev, unsigned char addr,
+ REQTYPE_I2C_WRITE_STATT, CTRL_READ_REQUEST,
+ 0, 0, buf, 2, 1000);
+
+- if (ret == 2)
++ if ((ret == 2) && (buf[1] == (len - 1)))
+ ret = 0;
+ else if (ret >= 0)
+ ret = -EIO;
@@ -93,10 +95,10 @@ static int hdpvr_transfer(struct i2c_adapter *i2c_adapter, struct i2c_msg *msgs,
if (msgs[i].flags & I2C_M_RD)
Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-11/kernel.spec,v
retrieving revision 1.1723
retrieving revision 1.1724
diff -u -p -r1.1723 -r1.1724
--- kernel.spec 28 Aug 2009 16:47:11 -0000 1.1723
+++ kernel.spec 1 Sep 2009 04:18:44 -0000 1.1724
@@ -655,9 +655,10 @@ Patch1000: linux-2.6-neigh_-fix-state-tr
Patch1200: linux-2.6-xen-fix-brkpoints-hw-watchpoints.patch
Patch1201: linux-2.6-xen-clean-up-warnings.patch
-Patch1515: linux-2.6.29-lirc.patch
+Patch1515: lirc-2.6.31.patch
Patch1517: hid-ignore-all-recent-imon-devices.patch
Patch1518: hdpvr-ir-enable.patch
+Patch1519: lirc-revert-2.6.31-i2c-changes.patch
Patch1700: agp-set_memory_ucwb.patch
# nouveau + drm fixes
@@ -693,6 +694,7 @@ Patch2899: linux-2.6-v4l-dvb-fixes.patch
Patch2900: linux-2.6-v4l-dvb-update.patch
Patch2901: linux-2.6-v4l-dvb-experimental.patch
Patch2903: linux-2.6-revert-dvb-net-kabi-change.patch
+Patch2904: v4l-dvb-fix-cx25840-firmware-load.patch
# fs fixes
Patch3000: linux-2.6-fs-cifs-fix-port-numbers.patch
@@ -1312,7 +1314,10 @@ ApplyPatch linux-2.6-zd1211rw_-adding-08
ApplyPatch linux-2.6-crash-driver.patch
# http://www.lirc.org/
-ApplyPatch linux-2.6.29-lirc.patch
+ApplyPatch lirc-2.6.31.patch
+ApplyPatch hid-ignore-all-recent-imon-devices.patch
+ApplyPatch hdpvr-ir-enable.patch
+ApplyPatch lirc-revert-2.6.31-i2c-changes.patch
# DRM patches
ApplyPatch agp-set_memory_ucwb.patch
@@ -1344,6 +1349,7 @@ ApplyPatch linux-2.6-silence-acpi-blackl
#ApplyPatch linux-2.6-v4l-dvb-update.patch
#ApplyPatch linux-2.6-v4l-dvb-experimental.patch
#ApplyPatch linux-2.6-revert-dvb-net-kabi-change.patch
+ApplyPatch v4l-dvb-fix-cx25840-firmware-load.patch
# kvm
ApplyPatch linux-2.6-kvm-skip-pit-check.patch
@@ -1965,6 +1971,13 @@ fi
# and build.
%changelog
+* Tue Sep 01 2009 Jarod Wilson <jarod at redhat.com> 2.5.30.5-45
+- Refresh lirc patches, add new lirc_ene0100 driver
+- Fix up hdpvr driver for use with modular i2c so that
+ lirc_zilog can actually bind to it
+- Make lirc_zilog IR transmit and receive work on the hdpvr
+- Fix audio on PVR-500 when used in same system as HVR-1800 (#480728)
+
* Fri Aug 28 2009 David Woodhouse <David.Woodhouse at intel.com>
- Enable Solos DSL driver
--- linux-2.6.29-lirc.patch DELETED ---
More information about the fedora-extras-commits
mailing list