diff options
Diffstat (limited to 'drivers/media/dvb/frontends')
| -rw-r--r-- | drivers/media/dvb/frontends/tda10086.c | 28 | ||||
| -rw-r--r-- | drivers/media/dvb/frontends/tda10086.h | 3 |
2 files changed, 25 insertions, 6 deletions
diff --git a/drivers/media/dvb/frontends/tda10086.c b/drivers/media/dvb/frontends/tda10086.c index 9d26ace65151..0d2b69a99ad4 100644 --- a/drivers/media/dvb/frontends/tda10086.c +++ b/drivers/media/dvb/frontends/tda10086.c | |||
| @@ -106,9 +106,12 @@ static int tda10086_write_mask(struct tda10086_state *state, int reg, int mask, | |||
| 106 | static int tda10086_init(struct dvb_frontend* fe) | 106 | static int tda10086_init(struct dvb_frontend* fe) |
| 107 | { | 107 | { |
| 108 | struct tda10086_state* state = fe->demodulator_priv; | 108 | struct tda10086_state* state = fe->demodulator_priv; |
| 109 | u8 t22k_off = 0x80; | ||
| 109 | 110 | ||
| 110 | dprintk ("%s\n", __FUNCTION__); | 111 | dprintk ("%s\n", __FUNCTION__); |
| 111 | 112 | ||
| 113 | if (state->config->diseqc_tone) | ||
| 114 | t22k_off = 0; | ||
| 112 | // reset | 115 | // reset |
| 113 | tda10086_write_byte(state, 0x00, 0x00); | 116 | tda10086_write_byte(state, 0x00, 0x00); |
| 114 | msleep(10); | 117 | msleep(10); |
| @@ -158,7 +161,7 @@ static int tda10086_init(struct dvb_frontend* fe) | |||
| 158 | tda10086_write_byte(state, 0x3d, 0x80); | 161 | tda10086_write_byte(state, 0x3d, 0x80); |
| 159 | 162 | ||
| 160 | // setup SEC | 163 | // setup SEC |
| 161 | tda10086_write_byte(state, 0x36, 0x80); // all SEC off, no 22k tone | 164 | tda10086_write_byte(state, 0x36, t22k_off); // all SEC off, 22k tone |
| 162 | tda10086_write_byte(state, 0x34, (((1<<19) * (22000/1000)) / (SACLK/1000))); // } tone frequency | 165 | tda10086_write_byte(state, 0x34, (((1<<19) * (22000/1000)) / (SACLK/1000))); // } tone frequency |
| 163 | tda10086_write_byte(state, 0x35, (((1<<19) * (22000/1000)) / (SACLK/1000)) >> 8); // } | 166 | tda10086_write_byte(state, 0x35, (((1<<19) * (22000/1000)) / (SACLK/1000)) >> 8); // } |
| 164 | 167 | ||
| @@ -180,16 +183,20 @@ static void tda10086_diseqc_wait(struct tda10086_state *state) | |||
| 180 | static int tda10086_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) | 183 | static int tda10086_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) |
| 181 | { | 184 | { |
| 182 | struct tda10086_state* state = fe->demodulator_priv; | 185 | struct tda10086_state* state = fe->demodulator_priv; |
| 186 | u8 t22k_off = 0x80; | ||
| 183 | 187 | ||
| 184 | dprintk ("%s\n", __FUNCTION__); | 188 | dprintk ("%s\n", __FUNCTION__); |
| 185 | 189 | ||
| 190 | if (state->config->diseqc_tone) | ||
| 191 | t22k_off = 0; | ||
| 192 | |||
| 186 | switch (tone) { | 193 | switch (tone) { |
| 187 | case SEC_TONE_OFF: | 194 | case SEC_TONE_OFF: |
| 188 | tda10086_write_byte(state, 0x36, 0x80); | 195 | tda10086_write_byte(state, 0x36, t22k_off); |
| 189 | break; | 196 | break; |
| 190 | 197 | ||
| 191 | case SEC_TONE_ON: | 198 | case SEC_TONE_ON: |
| 192 | tda10086_write_byte(state, 0x36, 0x81); | 199 | tda10086_write_byte(state, 0x36, 0x01 + t22k_off); |
| 193 | break; | 200 | break; |
| 194 | } | 201 | } |
| 195 | 202 | ||
| @@ -202,9 +209,13 @@ static int tda10086_send_master_cmd (struct dvb_frontend* fe, | |||
| 202 | struct tda10086_state* state = fe->demodulator_priv; | 209 | struct tda10086_state* state = fe->demodulator_priv; |
| 203 | int i; | 210 | int i; |
| 204 | u8 oldval; | 211 | u8 oldval; |
| 212 | u8 t22k_off = 0x80; | ||
| 205 | 213 | ||
| 206 | dprintk ("%s\n", __FUNCTION__); | 214 | dprintk ("%s\n", __FUNCTION__); |
| 207 | 215 | ||
| 216 | if (state->config->diseqc_tone) | ||
| 217 | t22k_off = 0; | ||
| 218 | |||
| 208 | if (cmd->msg_len > 6) | 219 | if (cmd->msg_len > 6) |
| 209 | return -EINVAL; | 220 | return -EINVAL; |
| 210 | oldval = tda10086_read_byte(state, 0x36); | 221 | oldval = tda10086_read_byte(state, 0x36); |
| @@ -212,7 +223,8 @@ static int tda10086_send_master_cmd (struct dvb_frontend* fe, | |||
| 212 | for(i=0; i< cmd->msg_len; i++) { | 223 | for(i=0; i< cmd->msg_len; i++) { |
| 213 | tda10086_write_byte(state, 0x48+i, cmd->msg[i]); | 224 | tda10086_write_byte(state, 0x48+i, cmd->msg[i]); |
| 214 | } | 225 | } |
| 215 | tda10086_write_byte(state, 0x36, 0x88 | ((cmd->msg_len - 1) << 4)); | 226 | tda10086_write_byte(state, 0x36, (0x08 + t22k_off) |
| 227 | | ((cmd->msg_len - 1) << 4)); | ||
| 216 | 228 | ||
| 217 | tda10086_diseqc_wait(state); | 229 | tda10086_diseqc_wait(state); |
| 218 | 230 | ||
| @@ -225,16 +237,20 @@ static int tda10086_send_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t minic | |||
| 225 | { | 237 | { |
| 226 | struct tda10086_state* state = fe->demodulator_priv; | 238 | struct tda10086_state* state = fe->demodulator_priv; |
| 227 | u8 oldval = tda10086_read_byte(state, 0x36); | 239 | u8 oldval = tda10086_read_byte(state, 0x36); |
| 240 | u8 t22k_off = 0x80; | ||
| 228 | 241 | ||
| 229 | dprintk ("%s\n", __FUNCTION__); | 242 | dprintk ("%s\n", __FUNCTION__); |
| 230 | 243 | ||
| 244 | if (state->config->diseqc_tone) | ||
| 245 | t22k_off = 0; | ||
| 246 | |||
| 231 | switch(minicmd) { | 247 | switch(minicmd) { |
| 232 | case SEC_MINI_A: | 248 | case SEC_MINI_A: |
| 233 | tda10086_write_byte(state, 0x36, 0x84); | 249 | tda10086_write_byte(state, 0x36, 0x04 + t22k_off); |
| 234 | break; | 250 | break; |
| 235 | 251 | ||
| 236 | case SEC_MINI_B: | 252 | case SEC_MINI_B: |
| 237 | tda10086_write_byte(state, 0x36, 0x86); | 253 | tda10086_write_byte(state, 0x36, 0x06 + t22k_off); |
| 238 | break; | 254 | break; |
| 239 | } | 255 | } |
| 240 | 256 | ||
diff --git a/drivers/media/dvb/frontends/tda10086.h b/drivers/media/dvb/frontends/tda10086.h index ed584a8f4a89..eeceaeee78ff 100644 --- a/drivers/media/dvb/frontends/tda10086.h +++ b/drivers/media/dvb/frontends/tda10086.h | |||
| @@ -33,6 +33,9 @@ struct tda10086_config | |||
| 33 | 33 | ||
| 34 | /* does the "inversion" need inverted? */ | 34 | /* does the "inversion" need inverted? */ |
| 35 | u8 invert; | 35 | u8 invert; |
| 36 | |||
| 37 | /* do we need the diseqc signal with carrier? */ | ||
| 38 | u8 diseqc_tone; | ||
| 36 | }; | 39 | }; |
| 37 | 40 | ||
| 38 | #if defined(CONFIG_DVB_TDA10086) || (defined(CONFIG_DVB_TDA10086_MODULE) && defined(MODULE)) | 41 | #if defined(CONFIG_DVB_TDA10086) || (defined(CONFIG_DVB_TDA10086_MODULE) && defined(MODULE)) |
