aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarron Broad <darron@kewl.org>2008-12-18 04:28:35 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:39:17 -0500
commit793927372626bae48b32db24dddde40d73923a9c (patch)
tree462a96b1da4da035e78acb4d835734d8ac20f303
parent6639f1e060c2d2f3331ba6bcefe8f65b623365f3 (diff)
V4L/DVB (9918): 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. Signed-off-by: Darron Broad <darron@kewl.org> Cc: Steven Toth <stoth@hauppauge.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c12
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c48
2 files changed, 36 insertions, 24 deletions
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index ca067ec250af..e162a70748c5 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -1244,8 +1244,16 @@ static int cx8802_blackbird_advise_acquire(struct cx8802_driver *drv)
1244 * We're being given access to re-arrange the GPIOs. 1244 * We're being given access to re-arrange the GPIOs.
1245 * Take the bus off the cx22702 and put the cx23416 on it. 1245 * Take the bus off the cx22702 and put the cx23416 on it.
1246 */ 1246 */
1247 cx_clear(MO_GP0_IO, 0x00000080); /* cx22702 in reset */ 1247 /* Toggle reset on cx22702 leaving i2c active */
1248 cx_set(MO_GP0_IO, 0x00000004); /* Disable the cx22702 */ 1248 cx_set(MO_GP0_IO, 0x00000080);
1249 udelay(1000);
1250 cx_clear(MO_GP0_IO, 0x00000080);
1251 udelay(50);
1252 cx_set(MO_GP0_IO, 0x00000080);
1253 udelay(1000);
1254 /* tri-state the cx22702 pins */
1255 cx_set(MO_GP0_IO, 0x00000004);
1256 udelay(1000);
1249 break; 1257 break;
1250 default: 1258 default:
1251 err = -ENODEV; 1259 err = -ENODEV;
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index e5bbc7b37c39..da4dd4913d9f 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -1128,40 +1128,44 @@ static int cx8802_dvb_advise_acquire(struct cx8802_driver *drv)
1128 * on the bus. Take the bus from the cx23416 and enable the 1128 * on the bus. Take the bus from the cx23416 and enable the
1129 * cx22702 demod 1129 * cx22702 demod
1130 */ 1130 */
1131 cx_set(MO_GP0_IO, 0x00000080); /* cx22702 out of reset and enable */ 1131 /* Toggle reset on cx22702 leaving i2c active */
1132 cx_set(MO_GP0_IO, 0x00000080);
1133 udelay(1000);
1134 cx_clear(MO_GP0_IO, 0x00000080);
1135 udelay(50);
1136 cx_set(MO_GP0_IO, 0x00000080);
1137 udelay(1000);
1138 /* enable the cx22702 pins */
1132 cx_clear(MO_GP0_IO, 0x00000004); 1139 cx_clear(MO_GP0_IO, 0x00000004);
1133 udelay(1000); 1140 udelay(1000);
1134 break; 1141 break;
1135 1142
1136 case CX88_BOARD_HAUPPAUGE_HVR3000: 1143 case CX88_BOARD_HAUPPAUGE_HVR3000:
1137 case CX88_BOARD_HAUPPAUGE_HVR4000: 1144 case CX88_BOARD_HAUPPAUGE_HVR4000:
1138 if(core->dvbdev->frontends.active_fe_id == 1) { 1145 /* Toggle reset on cx22702 leaving i2c active */
1139 /* DVB-S/S2 Enabled */ 1146 cx_set(MO_GP0_IO, 0x00000080);
1140 1147 udelay(1000);
1141 /* Toggle reset on cx22702 leaving i2c active */ 1148 cx_clear(MO_GP0_IO, 0x00000080);
1142 cx_write(MO_GP0_IO, (core->board.input[0].gpio0 & 0x0000ff00) | 0x00000080); 1149 udelay(50);
1143 udelay(1000); 1150 cx_set(MO_GP0_IO, 0x00000080);
1144 cx_clear(MO_GP0_IO, 0x00000080); 1151 udelay(1000);
1145 udelay(50); 1152 switch (core->dvbdev->frontends.active_fe_id) {
1146 cx_set(MO_GP0_IO, 0x00000080); /* cx22702 out of reset */ 1153 case 1: /* DVB-S/S2 Enabled */
1147 cx_set(MO_GP0_IO, 0x00000004); /* tri-state the cx22702 pins */ 1154 /* tri-state the cx22702 pins */
1148 udelay(1000); 1155 cx_set(MO_GP0_IO, 0x00000004);
1149 1156 /* Take the cx24116/cx24123 out of reset */
1150 cx_write(MO_SRST_IO, 1); /* Take the cx24116/cx24123 out of reset */ 1157 cx_write(MO_SRST_IO, 1);
1151 core->dvbdev->ts_gen_cntrl = 0x02; /* Parallel IO */ 1158 core->dvbdev->ts_gen_cntrl = 0x02; /* Parallel IO */
1152 } else 1159 break;
1153 if (core->dvbdev->frontends.active_fe_id == 2) { 1160 case 2: /* DVB-T Enabled */
1154 /* DVB-T Enabled */
1155
1156 /* Put the cx24116/cx24123 into reset */ 1161 /* Put the cx24116/cx24123 into reset */
1157 cx_write(MO_SRST_IO, 0); 1162 cx_write(MO_SRST_IO, 0);
1158 1163 /* enable the cx22702 pins */
1159 /* cx22702 out of reset and enable it */
1160 cx_set(MO_GP0_IO, 0x00000080);
1161 cx_clear(MO_GP0_IO, 0x00000004); 1164 cx_clear(MO_GP0_IO, 0x00000004);
1162 core->dvbdev->ts_gen_cntrl = 0x0c; /* Serial IO */ 1165 core->dvbdev->ts_gen_cntrl = 0x0c; /* Serial IO */
1163 udelay(1000); 1166 break;
1164 } 1167 }
1168 udelay(1000);
1165 break; 1169 break;
1166 1170
1167 default: 1171 default: