26 #define FE_SUPPORTED(fe) (defined(CONFIG_DVB_##fe) || \
27 (defined(CONFIG_DVB_##fe##_MODULE) && defined(MODULE)))
30 #if FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)
35 deb_tuner(
"polarity/voltage = %u\n", voltage);
51 err(
"unknown SEC_VOLTAGE value");
58 #if FE_SUPPORTED(S5H1420) || FE_SUPPORTED(STV0299) || FE_SUPPORTED(MT312)
69 #if FE_SUPPORTED(MT312) && FE_SUPPORTED(PLL)
87 err(
"unknown SEC_TONE value");
100 udelay(data ? 500 : 1000);
102 udelay(data ? 1000 : 500);
108 for (i = 7; i >= 0; i--) {
111 flexcop_diseqc_send_bit(fe,
d);
113 flexcop_diseqc_send_bit(fe, par);
116 static int flexcop_send_diseqc_msg(
struct dvb_frontend *fe,
117 int len,
u8 *
msg,
unsigned long burst)
124 for (i = 0; i < len; i++)
125 flexcop_diseqc_send_byte(fe,msg[i]);
130 flexcop_diseqc_send_byte(fe, 0xff);
142 static int flexcop_diseqc_send_master_cmd(
struct dvb_frontend *fe,
145 return flexcop_send_diseqc_msg(fe, cmd->
msg_len, cmd->
msg, 0);
148 static int flexcop_diseqc_send_burst(
struct dvb_frontend *fe,
151 return flexcop_send_diseqc_msg(fe, 0,
NULL, minicmd);
154 static struct mt312_config skystar23_samsung_tbdu18132_config = {
177 ops->
sleep = flexcop_sleep;
181 #define skystar2_rev23_attach NULL
185 #if FE_SUPPORTED(STV0299) && FE_SUPPORTED(PLL)
186 static int samsung_tbmu24112_set_symbol_rate(
struct dvb_frontend *fe,
192 if (srate < 1500000) {
193 aclk = 0xb7; bclk = 0x47;
194 }
else if (srate < 3000000) {
195 aclk = 0xb7; bclk = 0x4b;
196 }
else if (srate < 7000000) {
197 aclk = 0xb7; bclk = 0x4f;
198 }
else if (srate < 14000000) {
199 aclk = 0xb7; bclk = 0x53;
200 }
else if (srate < 30000000) {
201 aclk = 0xb6; bclk = 0x53;
202 }
else if (srate < 45000000) {
203 aclk = 0xb4; bclk = 0x51;
206 stv0299_writereg(fe, 0x13, aclk);
207 stv0299_writereg(fe, 0x14, bclk);
208 stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff);
209 stv0299_writereg(fe, 0x20, (ratio >> 8) & 0xff);
210 stv0299_writereg(fe, 0x21, ratio & 0xf0);
214 static u8 samsung_tbmu24112_inittab[] = {
261 .inittab = samsung_tbmu24112_inittab,
268 .set_symbol_rate = samsung_tbmu24112_set_symbol_rate,
282 fc->
fe->ops.set_voltage = flexcop_set_voltage;
284 fc->
fe->ops.sleep = flexcop_sleep;
289 #define skystar2_rev26_attach NULL
293 #if FE_SUPPORTED(S5H1420) && FE_SUPPORTED(ISL6421) && FE_SUPPORTED(TUNER_ITD1000)
297 .repeated_start_workaround = 1,
323 fc->
fe->ops.sleep = flexcop_sleep;
329 err(
"ISL6421 could NOT be attached");
332 info(
"ISL6421 successfully attached");
335 r108.
raw = 0x00000506;
338 &skystar2_rev2_7_itd1000_config)) {
339 err(
"ITD1000 could NOT be attached");
343 info(
"ITD1000 successfully attached");
355 #define skystar2_rev27_attach NULL
359 #if FE_SUPPORTED(CX24123) && FE_SUPPORTED(ISL6421) && FE_SUPPORTED(TUNER_CX24113)
366 static const struct cx24113_config skystar2_rev2_8_cx24113_config = {
387 err(
"CX24113 could NOT be attached");
390 info(
"CX24113 successfully attached");
395 err(
"ISL6421 could NOT be attached");
399 info(
"ISL6421 successfully attached");
405 #define skystar2_rev28_attach NULL
409 #if FE_SUPPORTED(MT352) && FE_SUPPORTED(PLL)
410 static int samsung_tdtc9251dh0_demod_init(
struct dvb_frontend *fe)
412 static u8 mt352_clock_config[] = { 0x89, 0x18, 0x2d };
413 static u8 mt352_reset[] = { 0x50, 0x80 };
414 static u8 mt352_adc_ctl_1_cfg[] = { 0x8E, 0x40 };
415 static u8 mt352_agc_cfg[] = { 0x67, 0x28, 0xa1 };
416 static u8 mt352_capt_range_cfg[] = { 0x75, 0x32 };
418 mt352_write(fe, mt352_clock_config,
sizeof(mt352_clock_config));
420 mt352_write(fe, mt352_reset,
sizeof(mt352_reset));
421 mt352_write(fe, mt352_adc_ctl_1_cfg,
sizeof(mt352_adc_ctl_1_cfg));
422 mt352_write(fe, mt352_agc_cfg,
sizeof(mt352_agc_cfg));
423 mt352_write(fe, mt352_capt_range_cfg,
sizeof(mt352_capt_range_cfg));
427 static struct mt352_config samsung_tdtc9251dh0_config = {
429 .demod_init = samsung_tdtc9251dh0_demod_init,
443 #define airstar_dvbt_attach NULL
447 #if FE_SUPPORTED(BCM3510)
448 static int flexcop_fe_request_firmware(
struct dvb_frontend *fe,
457 .request_firmware = flexcop_fe_request_firmware,
467 #define airstar_atsc1_attach NULL
471 #if FE_SUPPORTED(NXT200X) && FE_SUPPORTED(PLL)
487 #define airstar_atsc2_attach NULL
491 #if FE_SUPPORTED(LGDT330X)
496 .clock_polarity_flip = 1,
507 TUNER_LG_TDVS_H06XF);
510 #define airstar_atsc3_attach NULL
514 #if FE_SUPPORTED(STV0297) && FE_SUPPORTED(PLL)
515 static u8 alps_tdee4_stv0297_inittab[] = {
590 .inittab = alps_tdee4_stv0297_inittab,
603 if (fc->
fe->ops.i2c_gate_ctrl)
604 fc->
fe->ops.i2c_gate_ctrl(fc->
fe, 0);
605 fc->
fe->ops.i2c_gate_ctrl =
NULL;
619 #define cablestar2_attach NULL
625 } flexcop_frontends[] = {
641 for (i = 0; i <
ARRAY_SIZE(flexcop_frontends); i++) {
642 if (!flexcop_frontends[i].
attach)
646 fc->
dev_type = flexcop_frontends[
i].type;
656 err(
"no frontend driver found for this B2C2/FlexCop adapter");
660 info(
"found '%s' .", fc->
fe->ops.info.name);
662 err(
"frontend registration failed!");