/* tv standard selection for Temic 4046 FM5 this value takes the low bits of control byte 2 from datasheet Rev.01, Feb.00 standard BG I L L2 D picture IF 38.9 38.9 38.9 33.95 38.9 sound 1 33.4 32.9 32.4 40.45 32.4 sound 2 33.16 NICAM 33.05 32.348 33.05 33.05
*/ #define TEMIC_SET_PAL_I 0x05 #define TEMIC_SET_PAL_DK 0x09 #define TEMIC_SET_PAL_L 0x0a /* SECAM ? */ #define TEMIC_SET_PAL_L2 0x0b /* change IF ! */ #define TEMIC_SET_PAL_BG 0x0c
/* tv tuner system standard selection for Philips FQ1216ME this value takes the low bits of control byte 2 from datasheet "1999 Nov 16" (supersedes "1999 Mar 23") standard BG DK I L L` picture carrier 38.90 38.90 38.90 38.90 33.95 colour 34.47 34.47 34.47 34.47 38.38 sound 1 33.40 32.40 32.90 32.40 40.45 sound 2 33.16 - - - - NICAM 33.05 33.05 32.35 33.05 39.80
*/ #define PHILIPS_SET_PAL_I 0x01 /* Bit 2 always zero !*/ #define PHILIPS_SET_PAL_BGDK 0x09 #define PHILIPS_SET_PAL_L2 0x0a #define PHILIPS_SET_PAL_L 0x0b
/* system switching for Philips FI1216MF MK2 from datasheet "1996 Jul 09", standard BG L L' picture carrier 38.90 38.90 33.95 colour 34.47 34.37 38.38 sound 1 33.40 32.40 40.45 sound 2 33.16 - - NICAM 33.05 33.05 39.80
*/ #define PHILIPS_MF_SET_STD_BG 0x01 /* Bit 2 must be zero, Bit 3 is system output */ #define PHILIPS_MF_SET_STD_L 0x03 /* Used on Secam France */ #define PHILIPS_MF_SET_STD_LC 0x02 /* Used on SECAM L' */
staticinlineint tuner_stereo(constint type, constint status)
{ switch (type) { case TUNER_PHILIPS_FM1216ME_MK3: case TUNER_PHILIPS_FM1236_MK3: case TUNER_PHILIPS_FM1256_IH3: case TUNER_LG_NTSC_TAPE: case TUNER_TCL_MF02GIP_5N: return ((status & TUNER_SIGNAL) == TUNER_STEREO_MK3); case TUNER_PHILIPS_FM1216MK5: return status | TUNER_STEREO; default: return status & TUNER_STEREO;
}
}
switch (type) { case TUNER_PARAM_TYPE_RADIO:
name = "radio"; break; case TUNER_PARAM_TYPE_PAL:
name = "pal"; break; case TUNER_PARAM_TYPE_SECAM:
name = "secam"; break; case TUNER_PARAM_TYPE_NTSC:
name = "ntsc"; break; case TUNER_PARAM_TYPE_DIGITAL:
name = "digital"; break; default:
name = "unknown"; break;
} return name;
}
for (i = 0; i < tun->count; i++) if (desired_type == tun->params[i].type) break;
/* use default tuner params if desired_type not available */ if (i == tun->count) {
tuner_dbg("desired params (%s) undefined for tuner %d\n",
tuner_param_name(desired_type), priv->type);
i = 0;
}
tuner_dbg("using tuner params #%d (%s)\n", i,
tuner_param_name(tun->params[i].type));
for (i = 0; i < t_params->count; i++) { if (*frequency > t_params->ranges[i].limit) continue; break;
} if (i == t_params->count) {
tuner_dbg("frequency out of range (%d > %d)\n",
*frequency, t_params->ranges[i - 1].limit);
*frequency = t_params->ranges[--i].limit;
}
*config = t_params->ranges[i].config;
*cb = t_params->ranges[i].cb;
switch (priv->type) { case TUNER_LG_TDVS_H06XF:
simple_set_aux_byte(fe, config, 0x20); break; case TUNER_PHILIPS_FQ1216LME_MK3:
simple_set_aux_byte(fe, config, 0x60); /* External AGC */ break; case TUNER_MICROTUNE_4042FI5:
{ /* FIXME - this may also work for other tuners */ unsignedlong timeout = jiffies + msecs_to_jiffies(1);
u8 status_byte = 0;
/* Wait until the PLL locks */ for (;;) { if (time_after(jiffies, timeout)) return 0;
rc = tuner_i2c_xfer_recv(&priv->i2c_props,
&status_byte, 1); if (1 != rc) {
tuner_warn("i2c i/o read error: rc == %d (should be 1)\n",
rc); break;
} if (status_byte & TUNER_PLL_LOCKED) break;
udelay(10);
}
/* Set the charge pump for optimized phase noise figure */
config &= ~TUNER_CHARGE_PUMP;
buffer[0] = (div>>8) & 0x7f;
buffer[1] = div & 0xff;
buffer[2] = config;
buffer[3] = cb;
tuner_dbg("tv 0x%02x 0x%02x 0x%02x 0x%02x\n",
buffer[0], buffer[1], buffer[2], buffer[3]);
switch (priv->type) { case TUNER_TENA_9533_DI: case TUNER_YMEC_TVF_5533MF:
tuner_dbg("This tuner doesn't have FM. Most cards have a TEA5767 for FM\n"); return -EINVAL; case TUNER_PHILIPS_FM1216ME_MK3: case TUNER_PHILIPS_FM1236_MK3: case TUNER_PHILIPS_FMD1216ME_MK3: case TUNER_PHILIPS_FMD1216MEX_MK3: case TUNER_LG_NTSC_TAPE: case TUNER_PHILIPS_FM1256_IH3: case TUNER_TCL_MF02GIP_5N:
buffer[3] = 0x19; break; case TUNER_PHILIPS_FM1216MK5:
buffer[2] = 0x88;
buffer[3] = 0x09; break; case TUNER_TNF_5335MF:
buffer[3] = 0x11; break; case TUNER_LG_PAL_FM:
buffer[3] = 0xa5; break; case TUNER_THOMSON_DTT761X:
buffer[3] = 0x39; break; case TUNER_PHILIPS_FQ1216LME_MK3: case TUNER_PHILIPS_FQ1236_MK5:
tuner_err("This tuner doesn't have FM\n"); /* Set the low band for sanity, since it covers 88-108 MHz */
buffer[3] = 0x01; break; case TUNER_MICROTUNE_4049FM5: default:
buffer[3] = 0xa4; break;
}
/* IFPCoff = Video Intermediate Frequency - Vif: 940 =16*58.75 NTSC/J (Japan) 732 =16*45.75 M/N STD 704 =16*44 ATSC (at DVB code) 632 =16*39.50 I U.K. 622.4=16*38.90 B/G D/K I, L STD 592 =16*37.00 D China 590 =16.36.875 B Australia 543.2=16*33.95 L' STD 171.2=16*10.70 FM Radio (at set_radio_freq)
*/
for (j = tun->count-1; j > 0; j--) if (tun->params[j].type == TUNER_PARAM_TYPE_RADIO) break; /* default t_params (j=0) will be used if desired type wasn't found */
t_params = &tun->params[j];
/* Select Radio 1st IF used */ switch (t_params->radio_if) { case 0: /* 10.7 MHz */
freq += (unsignedint)(10.7*16000); break; case 1: /* 33.3 MHz */
freq += (unsignedint)(33.3*16000); break; case 2: /* 41.3 MHz */
freq += (unsignedint)(41.3*16000); break; default:
tuner_warn("Unsupported radio_if value %d\n",
t_params->radio_if); return 0;
}
static u32 simple_dvb_configure(struct dvb_frontend *fe, u8 *buf, const u32 delsys, const u32 freq, const u32 bw)
{ /* This function returns the tuned frequency on success, 0 on error */ struct tuner_simple_priv *priv = fe->tuner_priv; conststruct tunertype *tun = priv->tun; conststruct tuner_params *t_params;
u8 config, cb;
u32 div; int ret;
u32 frequency = freq / 62500;
if (!tun->stepsize) { /* tuner-core was loaded before the digital tuner was
* configured and somehow picked the wrong tuner type */
tuner_err("attempt to treat tuner %d (%s) as digital tuner without stepsize defined.\n",
priv->type, priv->tun->name); return 0; /* failure */
}
t_params = simple_tuner_params(fe, TUNER_PARAM_TYPE_DIGITAL);
ret = simple_config_lookup(fe, t_params, &frequency, &config, &cb); if (ret < 0) return 0; /* failure */
/* put analog demod in standby when tuning digital */ if (fe->ops.analog_ops.standby)
fe->ops.analog_ops.standby(fe);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
/* buf[0] contains the i2c address, but *
* we already have it in i2c_props.addr */
ret = tuner_i2c_xfer_send(&priv->i2c_props, buf+1, 4); if (ret != 4) goto fail;
return 0;
fail: /* calc_regs sets frequency and bandwidth. if we failed, unset them */
priv->frequency = prev_freq;
priv->bandwidth = prev_bw;
/* If i2c_adap is set, check that the tuner is at the correct address. * Otherwise, if i2c_adap is NULL, the tuner will be programmed directly * by the digital demod via calc_regs.
*/ if (i2c_adap != NULL) {
u8 b[1]; struct i2c_msg msg = {
.addr = i2c_addr, .flags = I2C_M_RD,
.buf = b, .len = 1,
};
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 1);
if (1 != i2c_transfer(i2c_adap, &msg, 1))
printk(KERN_WARNING "tuner-simple %d-%04x: unable to probe %s, proceeding anyway.",
i2c_adapter_id(i2c_adap), i2c_addr,
tuners[type].name);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
}
if (type != priv->type)
tuner_warn("couldn't set type to %d. Using %d (%s) instead\n",
type, priv->type, priv->tun->name); else
tuner_info("type set to %d (%s)\n",
priv->type, priv->tun->name);
if ((debug) || ((atv_input[priv->nr] > 0) ||
(dtv_input[priv->nr] > 0))) { if (0 == atv_input[priv->nr])
tuner_info("tuner %d atv rf input will be autoselected\n",
priv->nr); else
tuner_info("tuner %d atv rf input will be set to input %d (insmod option)\n",
priv->nr, atv_input[priv->nr]); if (0 == dtv_input[priv->nr])
tuner_info("tuner %d dtv rf input will be autoselected\n",
priv->nr); else
tuner_info("tuner %d dtv rf input will be set to input %d (insmod option)\n",
priv->nr, dtv_input[priv->nr]);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.