The patch number 9918 was added via Mauro Carvalho Chehab <mche...@redhat.com>
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:
        v4l-dvb-maintai...@linuxtv.org

------

From: Darron Broad  <dar...@kewl.org>
cx88: advise/acquire clean-up for HVR-1300/3000/4000


This cleans-up the advise/acquire methods.

This has been tested on the hvr-1300/4000 and assumed to be
correct on the hvr-3000.

This update also fixes analogue tuning on the hvr-1300
when in blackbird mode.

Priority: normal

Signed-off-by: Darron Broad <dar...@kewl.org>
CC: Steven Toth <st...@hauppauge.com>
Signed-off-by: Mauro Carvalho Chehab <mche...@redhat.com>


---

 linux/drivers/media/video/cx88/cx88-blackbird.c |   12 +++
 linux/drivers/media/video/cx88/cx88-dvb.c       |   50 ++++++++--------
 2 files changed, 37 insertions(+), 25 deletions(-)

diff -r 576096447a45 -r d2eedb425718 
linux/drivers/media/video/cx88/cx88-blackbird.c
--- a/linux/drivers/media/video/cx88/cx88-blackbird.c   Thu Dec 18 07:28:18 
2008 -0200
+++ b/linux/drivers/media/video/cx88/cx88-blackbird.c   Thu Dec 18 07:28:35 
2008 -0200
@@ -1263,8 +1263,16 @@ static int cx8802_blackbird_advise_acqui
                 * We're being given access to re-arrange the GPIOs.
                 * Take the bus off the cx22702 and put the cx23416 on it.
                 */
-               cx_clear(MO_GP0_IO, 0x00000080); /* cx22702 in reset */
-               cx_set(MO_GP0_IO,   0x00000004); /* Disable the cx22702 */
+               /* Toggle reset on cx22702 leaving i2c active */
+               cx_set(MO_GP0_IO, 0x00000080);
+               udelay(1000);
+               cx_clear(MO_GP0_IO, 0x00000080);
+               udelay(50);
+               cx_set(MO_GP0_IO, 0x00000080);
+               udelay(1000);
+               /* tri-state the cx22702 pins */
+               cx_set(MO_GP0_IO, 0x00000004);
+               udelay(1000);
                break;
        default:
                err = -ENODEV;
diff -r 576096447a45 -r d2eedb425718 linux/drivers/media/video/cx88/cx88-dvb.c
--- a/linux/drivers/media/video/cx88/cx88-dvb.c Thu Dec 18 07:28:18 2008 -0200
+++ b/linux/drivers/media/video/cx88/cx88-dvb.c Thu Dec 18 07:28:35 2008 -0200
@@ -1135,40 +1135,44 @@ static int cx8802_dvb_advise_acquire(str
                 * on the bus. Take the bus from the cx23416 and enable the
                 * cx22702 demod
                 */
-               cx_set(MO_GP0_IO,   0x00000080); /* cx22702 out of reset and 
enable */
+               /* Toggle reset on cx22702 leaving i2c active */
+               cx_set(MO_GP0_IO, 0x00000080);
+               udelay(1000);
+               cx_clear(MO_GP0_IO, 0x00000080);
+               udelay(50);
+               cx_set(MO_GP0_IO, 0x00000080);
+               udelay(1000);
+               /* enable the cx22702 pins */
                cx_clear(MO_GP0_IO, 0x00000004);
                udelay(1000);
                break;
 
        case CX88_BOARD_HAUPPAUGE_HVR3000:
        case CX88_BOARD_HAUPPAUGE_HVR4000:
-               if(core->dvbdev->frontends.active_fe_id == 1) {
-                       /* DVB-S/S2 Enabled */
-
-                       /* Toggle reset on cx22702 leaving i2c active */
-                       cx_write(MO_GP0_IO, (core->board.input[0].gpio0 & 
0x0000ff00) | 0x00000080);
-                       udelay(1000);
-                       cx_clear(MO_GP0_IO, 0x00000080);
-                       udelay(50);
-                       cx_set(MO_GP0_IO, 0x00000080); /* cx22702 out of reset 
*/
-                       cx_set(MO_GP0_IO, 0x00000004); /* tri-state the cx22702 
pins */
-                       udelay(1000);
-
-                       cx_write(MO_SRST_IO, 1); /* Take the cx24116/cx24123 
out of reset */
+               /* Toggle reset on cx22702 leaving i2c active */
+               cx_set(MO_GP0_IO, 0x00000080);
+               udelay(1000);
+               cx_clear(MO_GP0_IO, 0x00000080);
+               udelay(50);
+               cx_set(MO_GP0_IO, 0x00000080);
+               udelay(1000);
+               switch (core->dvbdev->frontends.active_fe_id) {
+               case 1: /* DVB-S/S2 Enabled */
+                       /* tri-state the cx22702 pins */
+                       cx_set(MO_GP0_IO, 0x00000004);
+                       /* Take the cx24116/cx24123 out of reset */
+                       cx_write(MO_SRST_IO, 1);
                        core->dvbdev->ts_gen_cntrl = 0x02; /* Parallel IO */
-               } else
-               if (core->dvbdev->frontends.active_fe_id == 2) {
-                       /* DVB-T Enabled */
-
+                       break;
+               case 2: /* DVB-T Enabled */
                        /* Put the cx24116/cx24123 into reset */
                        cx_write(MO_SRST_IO, 0);
-
-                       /* cx22702 out of reset and enable it */
-                       cx_set(MO_GP0_IO,   0x00000080);
+                       /* enable the cx22702 pins */
                        cx_clear(MO_GP0_IO, 0x00000004);
                        core->dvbdev->ts_gen_cntrl = 0x0c; /* Serial IO */
-                       udelay(1000);
-               }
+                       break;
+               }
+               udelay(1000);
                break;
 
        default:


---

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

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to