diff options
author | Igor M. Liplianin <liplianin@me.by> | 2011-02-25 16:41:22 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-21 19:32:25 -0400 |
commit | d2ffc447cabb3a497d7f413403abd8793b348329 (patch) | |
tree | 7999af844cecb0ff688ff9b180eb1c9ff5907f93 /drivers/media/dvb/frontends | |
parent | 195288da53e03c35f97df8fa08f48f5b625bfb4e (diff) |
[media] dw2102: add support for Geniatech SU3000 USB DVB-S2 card
The card uses ds3000 demod from Montage.
Signed-off-by: Igor M. Liplianin <liplianin@me.by>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends')
-rw-r--r-- | drivers/media/dvb/frontends/ds3000.c | 40 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/ds3000.h | 1 |
2 files changed, 41 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/ds3000.c b/drivers/media/dvb/frontends/ds3000.c index 993357383fd4..3373890c092e 100644 --- a/drivers/media/dvb/frontends/ds3000.c +++ b/drivers/media/dvb/frontends/ds3000.c | |||
@@ -509,6 +509,33 @@ static int ds3000_load_firmware(struct dvb_frontend *fe, | |||
509 | return 0; | 509 | return 0; |
510 | } | 510 | } |
511 | 511 | ||
512 | static int ds3000_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage) | ||
513 | { | ||
514 | struct ds3000_state *state = fe->demodulator_priv; | ||
515 | u8 data; | ||
516 | |||
517 | dprintk("%s(%d)\n", __func__, voltage); | ||
518 | |||
519 | data = ds3000_readreg(state, 0xa2); | ||
520 | data |= 0x03; /* bit0 V/H, bit1 off/on */ | ||
521 | |||
522 | switch (voltage) { | ||
523 | case SEC_VOLTAGE_18: | ||
524 | data &= ~0x03; | ||
525 | break; | ||
526 | case SEC_VOLTAGE_13: | ||
527 | data &= ~0x03; | ||
528 | data |= 0x01; | ||
529 | break; | ||
530 | case SEC_VOLTAGE_OFF: | ||
531 | break; | ||
532 | } | ||
533 | |||
534 | ds3000_writereg(state, 0xa2, data); | ||
535 | |||
536 | return 0; | ||
537 | } | ||
538 | |||
512 | static void ds3000_dump_registers(struct dvb_frontend *fe) | 539 | static void ds3000_dump_registers(struct dvb_frontend *fe) |
513 | { | 540 | { |
514 | struct ds3000_state *state = fe->demodulator_priv; | 541 | struct ds3000_state *state = fe->demodulator_priv; |
@@ -1255,6 +1282,18 @@ static int ds3000_tune(struct dvb_frontend *fe, | |||
1255 | ds3000_writereg(state, 0xfd, 0x42); | 1282 | ds3000_writereg(state, 0xfd, 0x42); |
1256 | ds3000_writereg(state, 0x08, 0x07);*/ | 1283 | ds3000_writereg(state, 0x08, 0x07);*/ |
1257 | 1284 | ||
1285 | if (state->config->ci_mode) { | ||
1286 | switch (c->delivery_system) { | ||
1287 | case SYS_DVBS: | ||
1288 | default: | ||
1289 | ds3000_writereg(state, 0xfd, 0x80); | ||
1290 | break; | ||
1291 | case SYS_DVBS2: | ||
1292 | ds3000_writereg(state, 0xfd, 0x01); | ||
1293 | break; | ||
1294 | } | ||
1295 | } | ||
1296 | |||
1258 | /* ds3000 out of software reset */ | 1297 | /* ds3000 out of software reset */ |
1259 | ds3000_writereg(state, 0x00, 0x00); | 1298 | ds3000_writereg(state, 0x00, 0x00); |
1260 | /* start ds3000 build-in uC */ | 1299 | /* start ds3000 build-in uC */ |
@@ -1351,6 +1390,7 @@ static struct dvb_frontend_ops ds3000_ops = { | |||
1351 | .read_signal_strength = ds3000_read_signal_strength, | 1390 | .read_signal_strength = ds3000_read_signal_strength, |
1352 | .read_snr = ds3000_read_snr, | 1391 | .read_snr = ds3000_read_snr, |
1353 | .read_ucblocks = ds3000_read_ucblocks, | 1392 | .read_ucblocks = ds3000_read_ucblocks, |
1393 | .set_voltage = ds3000_set_voltage, | ||
1354 | .set_tone = ds3000_set_tone, | 1394 | .set_tone = ds3000_set_tone, |
1355 | .diseqc_send_master_cmd = ds3000_send_diseqc_msg, | 1395 | .diseqc_send_master_cmd = ds3000_send_diseqc_msg, |
1356 | .diseqc_send_burst = ds3000_diseqc_send_burst, | 1396 | .diseqc_send_burst = ds3000_diseqc_send_burst, |
diff --git a/drivers/media/dvb/frontends/ds3000.h b/drivers/media/dvb/frontends/ds3000.h index 67f67038740a..00e4e95590e9 100644 --- a/drivers/media/dvb/frontends/ds3000.h +++ b/drivers/media/dvb/frontends/ds3000.h | |||
@@ -27,6 +27,7 @@ | |||
27 | struct ds3000_config { | 27 | struct ds3000_config { |
28 | /* the demodulator's i2c address */ | 28 | /* the demodulator's i2c address */ |
29 | u8 demod_address; | 29 | u8 demod_address; |
30 | u8 ci_mode; | ||
30 | }; | 31 | }; |
31 | 32 | ||
32 | #if defined(CONFIG_DVB_DS3000) || \ | 33 | #if defined(CONFIG_DVB_DS3000) || \ |