aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/stv0288.c
diff options
context:
space:
mode:
authorMalcolm Priestley <tvboxspy@gmail.com>2010-09-26 14:16:20 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-21 05:55:58 -0400
commit352a587ccdd4690b4465e29fef91942d8c94826d (patch)
treea2316a84057001bb1b87b59805e61425c3c14fa1 /drivers/media/dvb/frontends/stv0288.c
parent0e44dec17f8b8737f47c9f547b6674b9921612b9 (diff)
[media] DiSEqC bug fixed for stv0288 based interfaces
Fixed problem with DiSEqC communication. The message was wrongly modulated, so the DiSEqC switch was not work. This patch fixes DiSEqC messages, simple tone burst and tone on/off. I verified it with osciloscope against the DiSEqC documentation. Interface: PCI DVB-S TV tuner TeVii S420 Kernel: 2.6.32-24-generic (UBUNTU 10.4) Signed-off-by: Josef Pavlik <josef@pavlik.it> Tested-by: Malcolm Priestley <tvboxspy@gmail.com> Cc: Igor M. Liplianin <liplianin@me.by> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/stv0288.c')
-rw-r--r--drivers/media/dvb/frontends/stv0288.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/media/dvb/frontends/stv0288.c b/drivers/media/dvb/frontends/stv0288.c
index 89e8db6ed841..63db8fd2754c 100644
--- a/drivers/media/dvb/frontends/stv0288.c
+++ b/drivers/media/dvb/frontends/stv0288.c
@@ -6,6 +6,8 @@
6 Copyright (C) 2008 Igor M. Liplianin <liplianin@me.by> 6 Copyright (C) 2008 Igor M. Liplianin <liplianin@me.by>
7 Removed stb6000 specific tuner code and revised some 7 Removed stb6000 specific tuner code and revised some
8 procedures. 8 procedures.
9 2010-09-01 Josef Pavlik <josef@pavlik.it>
10 Fixed diseqc_msg, diseqc_burst and set_tone problems
9 11
10 This program is free software; you can redistribute it and/or modify 12 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by 13 it under the terms of the GNU General Public License as published by
@@ -156,14 +158,13 @@ static int stv0288_send_diseqc_msg(struct dvb_frontend *fe,
156 158
157 stv0288_writeregI(state, 0x09, 0); 159 stv0288_writeregI(state, 0x09, 0);
158 msleep(30); 160 msleep(30);
159 stv0288_writeregI(state, 0x05, 0x16); 161 stv0288_writeregI(state, 0x05, 0x12);/* modulated mode, single shot */
160 162
161 for (i = 0; i < m->msg_len; i++) { 163 for (i = 0; i < m->msg_len; i++) {
162 if (stv0288_writeregI(state, 0x06, m->msg[i])) 164 if (stv0288_writeregI(state, 0x06, m->msg[i]))
163 return -EREMOTEIO; 165 return -EREMOTEIO;
164 msleep(12);
165 } 166 }
166 167 msleep(m->msg_len*12);
167 return 0; 168 return 0;
168} 169}
169 170
@@ -174,13 +175,14 @@ static int stv0288_send_diseqc_burst(struct dvb_frontend *fe,
174 175
175 dprintk("%s\n", __func__); 176 dprintk("%s\n", __func__);
176 177
177 if (stv0288_writeregI(state, 0x05, 0x16))/* burst mode */ 178 if (stv0288_writeregI(state, 0x05, 0x03))/* burst mode, single shot */
178 return -EREMOTEIO; 179 return -EREMOTEIO;
179 180
180 if (stv0288_writeregI(state, 0x06, burst == SEC_MINI_A ? 0x00 : 0xff)) 181 if (stv0288_writeregI(state, 0x06, burst == SEC_MINI_A ? 0x00 : 0xff))
181 return -EREMOTEIO; 182 return -EREMOTEIO;
182 183
183 if (stv0288_writeregI(state, 0x06, 0x12)) 184 msleep(15);
185 if (stv0288_writeregI(state, 0x05, 0x12))
184 return -EREMOTEIO; 186 return -EREMOTEIO;
185 187
186 return 0; 188 return 0;
@@ -192,18 +194,19 @@ static int stv0288_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
192 194
193 switch (tone) { 195 switch (tone) {
194 case SEC_TONE_ON: 196 case SEC_TONE_ON:
195 if (stv0288_writeregI(state, 0x05, 0x10))/* burst mode */ 197 if (stv0288_writeregI(state, 0x05, 0x10))/* cont carrier */
196 return -EREMOTEIO; 198 return -EREMOTEIO;
197 return stv0288_writeregI(state, 0x06, 0xff); 199 break;
198 200
199 case SEC_TONE_OFF: 201 case SEC_TONE_OFF:
200 if (stv0288_writeregI(state, 0x05, 0x13))/* burst mode */ 202 if (stv0288_writeregI(state, 0x05, 0x12))/* burst mode off*/
201 return -EREMOTEIO; 203 return -EREMOTEIO;
202 return stv0288_writeregI(state, 0x06, 0x00); 204 break;
203 205
204 default: 206 default:
205 return -EINVAL; 207 return -EINVAL;
206 } 208 }
209 return 0;
207} 210}
208 211
209static u8 stv0288_inittab[] = { 212static u8 stv0288_inittab[] = {