rpms/kernel/devel v4l-dvb-fix-cx25840-firmware-loading.patch, NONE, 1.1 kernel.spec, 1.1755, 1.1756 lirc-2.6.31.patch, 1.1, 1.2

Jarod Wilson jwilson at fedoraproject.org
Tue Sep 1 04:44:15 UTC 2009


Author: jwilson

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv15182

Modified Files:
	kernel.spec lirc-2.6.31.patch 
Added Files:
	v4l-dvb-fix-cx25840-firmware-loading.patch 
Log Message:
* Tue Sep 01 2009 Jarod Wilson <jarod at redhat.com>
- Fix up lirc_zilog to enable functional IR transmit and receive
  on the Hauppauge HD PVR
- Fix audio on PVR-500 when used in same system as HVR-1800 (#480728)


v4l-dvb-fix-cx25840-firmware-loading.patch:
 cx25840-firmware.c |   37 ++++++++++++++++++++++---------------
 1 file changed, 22 insertions(+), 15 deletions(-)

--- NEW FILE v4l-dvb-fix-cx25840-firmware-loading.patch ---
# HG changeset patch
# User Hans Verkuil <hverkuil at xs4all.nl>
# Date 1251752272 -7200
# Node ID 36a81289010d614758a64bd757ee37c8c154ad4b
# Parent  f69cb015dc77f8893f5018afff1e60f5b4ea50af
cx25840: fix determining the firmware name

From: Hans Verkuil <hverkuil at xs4all.nl>

Depending on the model there are three different firmwares to choose from.
Unfortunately if a cx23885 is loaded first, then the global firmware name
is overwritten with that firmware and if ivtv is loaded next, then it
tries to load the wrong firmware. In addition, the original approach would
also overwrite any firmware that the user specified explicitly.

Priority: normal

Signed-off-by: Hans Verkuil <hverkuil at xs4all.nl>
CC: Jarod Wilson <jarod at wilsonet.com>

Trivial backport from v4l-dvb hg tip to 2.6.31

Signed-off-by: Jarod Wilson <jarod at redhat.com>

---

 drivers/media/video/cx25840/cx25840-firmware.c |   37 ++++++++++++++---------
 1 files changed, 22 insertions(+), 15 deletions(-)

diff --git a/drivers/media/video/cx25840/cx25840-firmware.c b/drivers/media/video/cx25840/cx25840-firmware.c
index 0df53b0..006ce16 100644
--- a/drivers/media/video/cx25840/cx25840-firmware.c
+++ b/drivers/media/video/cx25840/cx25840-firmware.c
@@ -23,10 +23,6 @@
 
 #include "cx25840-core.h"
 
-#define FWFILE "v4l-cx25840.fw"
-#define FWFILE_CX23885 "v4l-cx23885-avcore-01.fw"
-#define FWFILE_CX231XX "v4l-cx231xx-avcore-01.fw"
-
 /*
  * Mike Isely <isely at pobox.com> - The FWSEND parameter controls the
  * size of the firmware chunks sent down the I2C bus to the chip.
@@ -40,11 +36,11 @@
 
 #define FWDEV(x) &((x)->dev)
 
-static char *firmware = FWFILE;
+static char *firmware = "";
 
 module_param(firmware, charp, 0444);
 
-MODULE_PARM_DESC(firmware, "Firmware image [default: " FWFILE "]");
+MODULE_PARM_DESC(firmware, "Firmware image to load");
 
 static void start_fw_load(struct i2c_client *client)
 {
@@ -65,6 +61,19 @@ static void end_fw_load(struct i2c_client *client)
 	cx25840_write(client, 0x803, 0x03);
 }
 
+static const char *get_fw_name(struct i2c_client *client)
+{
+	struct cx25840_state *state = to_state(i2c_get_clientdata(client));
+
+	if (firmware[0])
+		return firmware;
+	if (state->is_cx23885)
+		return "v4l-cx23885-avcore-01.fw";
+	if (state->is_cx231xx)
+		return "v4l-cx231xx-avcore-01.fw";
+	return "v4l-cx25840.fw";
+}
+
 static int check_fw_load(struct i2c_client *client, int size)
 {
 	/* DL_ADDR_HB DL_ADDR_LB */
@@ -72,11 +81,13 @@ static int check_fw_load(struct i2c_client *client, int size)
 	s |= cx25840_read(client, 0x800);
 
 	if (size != s) {
-		v4l_err(client, "firmware %s load failed\n", firmware);
+		v4l_err(client, "firmware %s load failed\n",
+			get_fw_name(client));
 		return -EINVAL;
 	}
 
-	v4l_info(client, "loaded %s firmware (%d bytes)\n", firmware, size);
+	v4l_info(client, "loaded %s firmware (%d bytes)\n",
+		 get_fw_name(client), size);
 	return 0;
 }
 
@@ -96,21 +107,17 @@ int cx25840_loadfw(struct i2c_client *client)
 	const struct firmware *fw = NULL;
 	u8 buffer[FWSEND];
 	const u8 *ptr;
+	const char *fwname = get_fw_name(client);
 	int size, retval;
 	int MAX_BUF_SIZE = FWSEND;
 
-	if (state->is_cx23885)
-		firmware = FWFILE_CX23885;
-	else if (state->is_cx231xx)
-		firmware = FWFILE_CX231XX;
-
 	if ((state->is_cx231xx) && MAX_BUF_SIZE > 16) {
 		v4l_err(client, " Firmware download size changed to 16 bytes max length\n");
 		MAX_BUF_SIZE = 16;  /* cx231xx cannot accept more than 16 bytes at a time */
 	}
 
-	if (request_firmware(&fw, firmware, FWDEV(client)) != 0) {
-		v4l_err(client, "unable to open firmware %s\n", firmware);
+	if (request_firmware(&fw, fwname, FWDEV(client)) != 0) {
+		v4l_err(client, "unable to open firmware %s\n", fwname);
 		return -EINVAL;
 	}
 


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1755
retrieving revision 1.1756
diff -u -p -r1.1755 -r1.1756
--- kernel.spec	30 Aug 2009 15:23:09 -0000	1.1755
+++ kernel.spec	1 Sep 2009 04:44:15 -0000	1.1756
@@ -711,6 +711,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-loading.patch
 
 # fs fixes
 
@@ -1333,6 +1334,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-loading.patch
 
 # Patches headed upstream
 
@@ -2002,6 +2004,11 @@ fi
 # and build.
 
 %changelog
+* Tue Sep 01 2009 Jarod Wilson <jarod at redhat.com>
+- Fix up lirc_zilog to enable functional IR transmit and receive
+  on the Hauppauge HD PVR
+- Fix audio on PVR-500 when used in same system as HVR-1800 (#480728)
+
 * Sun Aug 30 2009 Chuck Ebbert <cebbert at redhat.com>
 - 2.6.31-rc8-git1
 - Drop linux-2.6-inotify-accounting.patch, merged upstream.

lirc-2.6.31.patch:
 MAINTAINERS                           |    9 
 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      | 1244 ++++++++++++++++++
 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 ++++++++++++++++++++
 26 files changed, 15602 insertions(+)

Index: lirc-2.6.31.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/lirc-2.6.31.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- lirc-2.6.31.patch	30 Aug 2009 05:25:47 -0000	1.1
+++ lirc-2.6.31.patch	1 Sep 2009 04:44:15 -0000	1.2
@@ -1,6 +1,6 @@
 Linux Infrared Remote Control drivers -- http://www.lirc.org
 
-Last updated: Sunday, August 30, 2009
+Last updated: Tuesday, September 01, 2009
 
 From http://git.wilsonet.com/linux-2.6-lirc.git/
 
@@ -24,7 +24,7 @@ Signed-off-by: Jarod Wilson <jarod at redha
  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_mceusb.c      | 1244 ++++++++++++++++++
  drivers/input/lirc/lirc_parallel.c    |  709 ++++++++++
  drivers/input/lirc/lirc_parallel.h    |   26 +
  drivers/input/lirc/lirc_sasem.c       |  931 +++++++++++++
@@ -32,14 +32,14 @@ Signed-off-by: Jarod Wilson <jarod at redha
  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       | 1374 ++++++++++++++++++++
- 26 files changed, 15562 insertions(+), 0 deletions(-)
+ drivers/input/lirc/lirc_zilog.c       | 1395 ++++++++++++++++++++
+ 26 files changed, 15602 insertions(+), 0 deletions(-)
 
 diff --git a/MAINTAINERS b/MAINTAINERS
-index 60299a9..59e34c4 100644
+index 8dca9d8..f25dc26 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -3130,6 +3130,15 @@ W:	http://www.pasemi.com/
+@@ -3129,6 +3129,15 @@ W:	http://www.pasemi.com/
  L:	linuxppc-dev at ozlabs.org
  S:	Supported
  
@@ -727,7 +727,7 @@ index 0000000..0485884
 +MODULE_PARM_DESC(debug, "Debug enabled or not");
 diff --git a/drivers/input/lirc/lirc_dev.c b/drivers/input/lirc/lirc_dev.c
 new file mode 100644
-index 0000000..a23bfea
+index 0000000..48ab5af
 --- /dev/null
 +++ b/drivers/input/lirc/lirc_dev.c
 @@ -0,0 +1,839 @@
@@ -1153,7 +1153,7 @@ index 0000000..a23bfea
 +int lirc_dev_fop_open(struct inode *inode, struct file *file)
 +{
 +	struct irctl *ir;
-+	int retval;
++	int retval = 0;
 +
 +	if (iminor(inode) >= MAX_IRCTL_DEVICES) {
 +		dprintk("lirc_dev [%d]: open result = -ENODEV\n",
@@ -7658,10 +7658,10 @@ index 0000000..3d53181
 +MODULE_PARM_DESC(debug, "Enable debugging messages");
 diff --git a/drivers/input/lirc/lirc_mceusb.c b/drivers/input/lirc/lirc_mceusb.c
 new file mode 100644
-index 0000000..58dfdd5
+index 0000000..3dd4cfb
 --- /dev/null
 +++ b/drivers/input/lirc/lirc_mceusb.c
-@@ -0,0 +1,1225 @@
+@@ -0,0 +1,1244 @@
 +/*
 + * LIRC driver for Windows Media Center Edition USB Infrared Transceivers
 + *
@@ -7677,9 +7677,12 @@ index 0000000..58dfdd5
 + * supports the 1st-gen device now too. Transmitting on the 1st-gen device
 + * is as yet untested, but receiving definitely works.
 + *
-+ * Support for 1st-gen mceusb device added in June of 2009,
++ * Support for 1st-gen device added June 2009,
 + * by Jarod Wilson <jarod at wilsonet.com>
 + *
++ * Transmission support for 1st-gen device added August 2009,
++ * by Patrick Calhoun <phineas at ou.edu>
++ *
 + * Derived from ATI USB driver by Paul Miller and the original
 + * MCE USB driver by Dan Conti (and now including chunks of the latter
 + * relevant to the 1st-gen device initialization)
@@ -7845,6 +7848,8 @@ index 0000000..58dfdd5
 +	{ USB_DEVICE(VENDOR_FORMOSA, 0xe017) },
 +	/* Formosa Industrial Computing / Beanbag Emulation Device */
 +	{ USB_DEVICE(VENDOR_FORMOSA, 0xe018) },
++	/* Formosa21 / eHome Infrared Receiver */
++	{ USB_DEVICE(VENDOR_FORMOSA, 0xe03a) },
 +	/* Formosa Industrial Computing AIM IR605/A */
 +	{ USB_DEVICE(VENDOR_FORMOSA, 0xe03c) },
 +	/* Fintek eHome Infrared Transceiver */
@@ -8519,7 +8524,7 @@ index 0000000..58dfdd5
 +	memset(data, 0, 8);
 +
 +	ret = usb_control_msg(ir->usbdev, usb_rcvctrlpipe(ir->usbdev, 0),
-+			      5, USB_TYPE_VENDOR, 0, 0,
++			      USB_REQ_SET_ADDRESS, USB_TYPE_VENDOR, 0, 0,
 +			      data, 2, HZ * 3);
 +	dprintk("%s - ret = %d, devnum = %d\n",
 +		__func__, ret, ir->usbdev->devnum);
@@ -8533,6 +8538,18 @@ index 0000000..58dfdd5
 +
 +	dprintk("%s - ret = %d\n", __func__, ret);
 +
++	/* strange: bRequest == 4 */
++	ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
++			      4, USB_TYPE_VENDOR,
++			      0x0808, 0x0000, NULL, 0, HZ * 3);
++	dprintk("%s - retB = %d\n", __func__, ret);
++
++	/* strange: bRequest == 2 */
++	ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0),
++			      2, USB_TYPE_VENDOR,
++			      0x0000, 0x0100, NULL, 0, HZ * 3);
++	dprintk("%s - retC = %d\n", __func__, ret);
++
 +	return ret;
 +
 +};
@@ -8793,8 +8810,10 @@ index 0000000..58dfdd5
 +		request_packet_async(ir, ep_out, init1,
 +				     sizeof(init1), MCEUSB_OUTBOUND);
 +		request_packet_async(ir, ep_in, NULL, maxp, MCEUSB_INBOUND);
-+		request_packet_async(ir, ep_out, init2,
-+				     sizeof(init2), MCEUSB_OUTBOUND);
++		/* This breaks transmit on orig ms mce device */
++		if (!ir->flags.microsoft_gen1)
++			request_packet_async(ir, ep_out, init2,
++					     sizeof(init2), MCEUSB_OUTBOUND);
 +		request_packet_async(ir, ep_in, NULL, maxp, 0);
 +	}
 +
@@ -14387,10 +14406,10 @@ index 0000000..2955bad
 +module_exit(ttusbir_exit_module);
 diff --git a/drivers/input/lirc/lirc_zilog.c b/drivers/input/lirc/lirc_zilog.c
 new file mode 100644
-index 0000000..c532399
+index 0000000..f86db02
 --- /dev/null
 +++ b/drivers/input/lirc/lirc_zilog.c
-@@ -0,0 +1,1374 @@
+@@ -0,0 +1,1395 @@
 +/*
 + * i2c IR lirc driver for devices with zilog IR processors
 + *
@@ -14560,7 +14579,7 @@ index 0000000..c532399
 +
 +		/*
 +		 * Send random "poll command" (?)  Windows driver does this
-+		 * and it  is a good point to detect chip failure.
++		 * and it is a good point to detect chip failure.
 +		 */
 +		ret = i2c_master_send(&ir->c_rx, sendbuf, 1);
 +		if (ret != 1) {
@@ -14598,11 +14617,20 @@ index 0000000..c532399
 +		}
 +
 +		/* key pressed ? */
++#ifdef I2C_HW_B_HDPVR
++		if (ir->c_rx.adapter->id == I2C_HW_B_HDPVR) {
++			if (got_data && (keybuf[0] == 0x80))
++				return 0;
++			else if (got_data && (keybuf[0] == 0x00))
++				return -ENODATA;
++		} else if ((ir->b[0] & 0x80) == 0)
++#else
 +		if ((ir->b[0] & 0x80) == 0)
++#endif
 +			return got_data ? 0 : -ENODATA;
 +
 +		/* look what we have */
-+		code = (((__u16)ir->b[0]&0x7f)<<6) | (ir->b[1]>>2);
++		code = (((__u16)ir->b[0] & 0x7f) << 6) | (ir->b[1] >> 2);
 +
 +		codes[0] = (code >> 8) & 0xff;
 +		codes[1] = code & 0xff;
@@ -14611,6 +14639,7 @@ index 0000000..c532399
 +		lirc_buffer_write(&ir->buf, codes);
 +		++got_data;
 +	} while (!lirc_buffer_full(&ir->buf));
++
 +	return 0;
 +}
 +
@@ -15223,6 +15252,16 @@ index 0000000..c532399
 +		return ret < 0 ? ret : -EFAULT;
 +	}
 +
++#ifdef I2C_HW_B_HDPVR
++	/*
++	 * The sleep bits aren't necessary on the HD PVR, and in fact, the
++	 * last i2c_master_recv always fails with a -5, so for now, we're
++	 * going to skip this whole mess and say we're done on the HD PVR
++	 */
++	if (ir->c_rx.adapter->id == I2C_HW_B_HDPVR)
++		goto done;
++#endif
++
 +	/*
 +	 * This bit NAKs until the device is ready, so we retry it
 +	 * sleeping a bit each time.  This seems to be what the windows
@@ -15255,6 +15294,7 @@ index 0000000..c532399
 +		return -EFAULT;
 +	}
 +
++done:
 +	/* Oh good, it worked */
 +	dprintk("sent code %u, key %u\n", code, key);
 +	return 0;




More information about the fedora-extras-commits mailing list