aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Benesch <twoof7@freenet.de>2009-12-19 10:48:22 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 13:10:53 -0500
commit8bba2607f1927cf3166a64dfd4e4c38a2e3af990 (patch)
tree90be74e9f4429a8797cff8eff8f620aa8dbe0883
parent6ed36e6670635b162cc59e40cdb0fbcc51d59d1e (diff)
V4L/DVB: ngene: Added Media-Pointer MP-S2/CineS2 DVB-S2 Twin Tuner
Added support for nGene based Media-Pointer DVB-S2 twin tuner cards. [mchehab@redhat.com: Fix compilation error: unknown field ‘ref_clk’] Signed-off-by: Matthias Benesch <twoof7@freenet.de> Signed-off-by: Oliver Endriss <o.endriss@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb/ngene/ngene-core.c115
1 files changed, 115 insertions, 0 deletions
diff --git a/drivers/media/dvb/ngene/ngene-core.c b/drivers/media/dvb/ngene/ngene-core.c
index eb47b86902f9..0e0c01396ced 100644
--- a/drivers/media/dvb/ngene/ngene-core.c
+++ b/drivers/media/dvb/ngene/ngene-core.c
@@ -44,6 +44,10 @@
44 44
45#include "ngene.h" 45#include "ngene.h"
46 46
47#include "stv6110x.h"
48#include "stv090x.h"
49#include "lnbh24.h"
50
47#ifdef NGENE_COMMAND_API 51#ifdef NGENE_COMMAND_API
48#include "ngene-ioctls.h" 52#include "ngene-ioctls.h"
49#endif 53#endif
@@ -2371,6 +2375,60 @@ fail:
2371/* Demod/tuner attachment ***************************************************/ 2375/* Demod/tuner attachment ***************************************************/
2372/****************************************************************************/ 2376/****************************************************************************/
2373 2377
2378static int tuner_attach_stv6110(struct ngene_channel *chan)
2379{
2380 struct stv090x_config *feconf = (struct stv090x_config *)
2381 chan->dev->card_info->fe_config[chan->number];
2382 struct stv6110x_config *tunerconf = (struct stv6110x_config *)
2383 chan->dev->card_info->tuner_config[chan->number];
2384 struct stv6110x_devctl *ctl;
2385
2386 ctl = dvb_attach(stv6110x_attach, chan->fe, tunerconf,
2387 &chan->i2c_adapter);
2388 if (ctl == NULL) {
2389 printk(KERN_ERR DEVICE_NAME ": No STV6110X found!\n");
2390 return -ENODEV;
2391 }
2392
2393 feconf->tuner_init = ctl->tuner_init;
2394 feconf->tuner_set_mode = ctl->tuner_set_mode;
2395 feconf->tuner_set_frequency = ctl->tuner_set_frequency;
2396 feconf->tuner_get_frequency = ctl->tuner_get_frequency;
2397 feconf->tuner_set_bandwidth = ctl->tuner_set_bandwidth;
2398 feconf->tuner_get_bandwidth = ctl->tuner_get_bandwidth;
2399 feconf->tuner_set_bbgain = ctl->tuner_set_bbgain;
2400 feconf->tuner_get_bbgain = ctl->tuner_get_bbgain;
2401 feconf->tuner_set_refclk = ctl->tuner_set_refclk;
2402 feconf->tuner_get_status = ctl->tuner_get_status;
2403
2404 return 0;
2405}
2406
2407
2408static int demod_attach_stv0900(struct ngene_channel *chan)
2409{
2410 struct stv090x_config *feconf = (struct stv090x_config *)
2411 chan->dev->card_info->fe_config[chan->number];
2412
2413 chan->fe = dvb_attach(stv090x_attach,
2414 feconf,
2415 &chan->i2c_adapter,
2416 chan->number == 0 ? STV090x_DEMODULATOR_0 :
2417 STV090x_DEMODULATOR_1);
2418 if (chan->fe == NULL) {
2419 printk(KERN_ERR DEVICE_NAME ": No STV0900 found!\n");
2420 return -ENODEV;
2421 }
2422
2423 if (!dvb_attach(lnbh24_attach, chan->fe, &chan->i2c_adapter, 0,
2424 0, chan->dev->card_info->lnb[chan->number])) {
2425 printk(KERN_ERR DEVICE_NAME ": No LNBH24 found!\n");
2426 dvb_frontend_detach(chan->fe);
2427 return -ENODEV;
2428 }
2429
2430 return 0;
2431}
2374 2432
2375/****************************************************************************/ 2433/****************************************************************************/
2376/****************************************************************************/ 2434/****************************************************************************/
@@ -2573,6 +2631,59 @@ fail1:
2573/* Card configs *************************************************************/ 2631/* Card configs *************************************************************/
2574/****************************************************************************/ 2632/****************************************************************************/
2575 2633
2634static struct stv090x_config fe_mps2 = {
2635 .device = STV0900,
2636 .demod_mode = STV090x_DUAL,
2637 .clk_mode = STV090x_CLK_EXT,
2638
2639 .xtal = 27000000,
2640 .address = 0x68,
2641// .ref_clk = 27000000,
2642
2643 .ts1_mode = STV090x_TSMODE_SERIAL_PUNCTURED,
2644 .ts2_mode = STV090x_TSMODE_SERIAL_PUNCTURED,
2645
2646 .repeater_level = STV090x_RPTLEVEL_16,
2647
2648 .diseqc_envelope_mode = true,
2649
2650 .tuner_init = NULL,
2651 .tuner_set_mode = NULL,
2652 .tuner_set_frequency = NULL,
2653 .tuner_get_frequency = NULL,
2654 .tuner_set_bandwidth = NULL,
2655 .tuner_get_bandwidth = NULL,
2656 .tuner_set_bbgain = NULL,
2657 .tuner_get_bbgain = NULL,
2658 .tuner_set_refclk = NULL,
2659 .tuner_get_status = NULL,
2660};
2661
2662static struct stv6110x_config tuner_mps2_0 = {
2663 .addr = 0x60,
2664 .refclk = 27000000,
2665};
2666
2667static struct stv6110x_config tuner_mps2_1 = {
2668 .addr = 0x63,
2669 .refclk = 27000000,
2670};
2671
2672static struct ngene_info ngene_info_mps2 = {
2673 .type = NGENE_SIDEWINDER,
2674 .name = "Media-Pointer MP-S2/CineS2 DVB-S2 Twin Tuner",
2675 .io_type = {NGENE_IO_TSIN, NGENE_IO_TSIN},
2676 .demod_attach = {demod_attach_stv0900, demod_attach_stv0900},
2677 .tuner_attach = {tuner_attach_stv6110, tuner_attach_stv6110},
2678 .fe_config = {&fe_mps2, &fe_mps2},
2679 .tuner_config = {&tuner_mps2_0, &tuner_mps2_1},
2680 .lnb = {0x0b, 0x08},
2681 .tsf = {3, 3},
2682 .fw_version = 17,
2683};
2684
2685/****************************************************************************/
2686
2576 2687
2577 2688
2578/****************************************************************************/ 2689/****************************************************************************/
@@ -2587,8 +2698,12 @@ fail1:
2587/****************************************************************************/ 2698/****************************************************************************/
2588 2699
2589static const struct pci_device_id ngene_id_tbl[] __devinitdata = { 2700static const struct pci_device_id ngene_id_tbl[] __devinitdata = {
2701 NGENE_ID(0x18c3, 0xabc3, ngene_info_mps2),
2702 NGENE_ID(0x18c3, 0xabc4, ngene_info_mps2),
2703 NGENE_ID(0x18c3, 0xdb01, ngene_info_mps2),
2590 {0} 2704 {0}
2591}; 2705};
2706MODULE_DEVICE_TABLE(pci, ngene_id_tbl);
2592 2707
2593/****************************************************************************/ 2708/****************************************************************************/
2594/* Init/Exit ****************************************************************/ 2709/* Init/Exit ****************************************************************/