The patch number 12347 was added via Steven Toth <[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <[email protected]>

------

From: Steven Toth  <[email protected]>
cx25840: Bugfix for no DVB-T on the Hauppauge HVR-1700


After the i2c subdev changes the ordering of initialization changed,
causing a total loss of previous GPIO settings and a loss of DTV.
The generic firmware loading routine has now changed to preserve
GPIO values if the device is cx23885 based (safety) and I've
moved the GPIO configuration from probe() into the cx23885 init
func which is a little clearer and fixes the bug.

Priority: normal

Tested-By: Sohail Syyed <[email protected]>
Reviewed-by: Michael Krufky <[email protected]>
Signed-off-by: Steven Toth <[email protected]>


---

 linux/drivers/media/video/cx25840/cx25840-core.c     |   15 ++++++-----
 linux/drivers/media/video/cx25840/cx25840-firmware.c |   13 ++++++++-
 2 files changed, 21 insertions(+), 7 deletions(-)

diff -r f8f134705b65 -r 5414ef3b66ea 
linux/drivers/media/video/cx25840/cx25840-core.c
--- a/linux/drivers/media/video/cx25840/cx25840-core.c  Fri Jul 24 16:19:39 
2009 -0300
+++ b/linux/drivers/media/video/cx25840/cx25840-core.c  Thu Jul 23 11:18:54 
2009 -0400
@@ -341,6 +341,15 @@
        /* Select AFE clock pad output source */
        cx25840_write(client, 0x144, 0x05);
 
+       /* Drive GPIO2 direction and values for HVR1700
+        * where an onboard mux selects the output of demodulator
+        * vs the 417. Failure to set this results in no DTV.
+        * It's safe to set this across all Hauppauge boards
+        * currently, regardless of the board type.
+        */
+       cx25840_write(client, 0x160, 0x1d);
+       cx25840_write(client, 0x164, 0x00);
+
        /* Do the firmware load in a work handler to prevent.
           Otherwise the kernel is blocked waiting for the
           bit-banging i2c interface to finish uploading the
@@ -1610,12 +1619,6 @@
        state->id = id;
        state->rev = device_id;
 
-       if (state->is_cx23885) {
-               /* Drive GPIO2 direction and values */
-               cx25840_write(client, 0x160, 0x1d);
-               cx25840_write(client, 0x164, 0x00);
-       }
-
        return 0;
 }
 
diff -r f8f134705b65 -r 5414ef3b66ea 
linux/drivers/media/video/cx25840/cx25840-firmware.c
--- a/linux/drivers/media/video/cx25840/cx25840-firmware.c      Fri Jul 24 
16:19:39 2009 -0300
+++ b/linux/drivers/media/video/cx25840/cx25840-firmware.c      Thu Jul 23 
11:18:54 2009 -0400
@@ -99,9 +99,14 @@
        const u8 *ptr;
        int size, retval;
        int MAX_BUF_SIZE = FWSEND;
+       u32 gpio_oe = 0, gpio_da = 0;
 
-       if (state->is_cx23885)
+       if (state->is_cx23885) {
                firmware = FWFILE_CX23885;
+               /* Preserve the GPIO OE and output bits */
+               gpio_oe = cx25840_read(client, 0x160);
+               gpio_da = cx25840_read(client, 0x164);
+       }
        else if (state->is_cx231xx)
                firmware = FWFILE_CX231XX;
 
@@ -143,5 +148,11 @@
        size = fw->size;
        release_firmware(fw);
 
+       if (state->is_cx23885) {
+               /* Restore GPIO configuration after f/w load */
+               cx25840_write(client, 0x160, gpio_oe);
+               cx25840_write(client, 0x164, gpio_da);
+       }
+
        return check_fw_load(client, size);
 }


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/5414ef3b66ea2867aae95e92aa8e08333d36d16f

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to