Lines Matching defs:t

89 	i2c_adapter_id(t->i2c->adapter), t->i2c->addr
240 struct tuner *t = fe->analog_demod_priv;
260 struct tuner *t = fe->analog_demod_priv;
301 struct tuner *t = to_tuner(i2c_get_clientdata(c));
302 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops;
303 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
312 t->type = type;
313 t->config = new_config;
316 t->fe.callback = tuner_callback;
320 tuner_detach(&t->fe);
321 t->fe.analog_demod_priv = NULL;
323 switch (t->type) {
326 &t->fe, t->i2c->adapter, t->i2c->addr))
331 if (!dvb_attach(tda829x_attach, &t->fe, t->i2c->adapter,
332 t->i2c->addr, t->config))
337 if (!dvb_attach(tea5767_attach, &t->fe,
338 t->i2c->adapter, t->i2c->addr))
340 t->mode_mask = T_RADIO;
343 if (!dvb_attach(tea5761_attach, &t->fe,
344 t->i2c->adapter, t->i2c->addr))
346 t->mode_mask = T_RADIO;
359 if (!dvb_attach(simple_tuner_attach, &t->fe,
360 t->i2c->adapter, t->i2c->addr, t->type))
369 if (!dvb_attach(simple_tuner_attach, &t->fe,
370 t->i2c->adapter, t->i2c->addr, t->type))
376 .i2c_adap = t->i2c->adapter,
377 .i2c_addr = t->i2c->addr,
379 if (!dvb_attach(xc2028_attach, &t->fe, &cfg))
386 &t->fe, t->i2c->adapter, t->i2c->addr))
392 .i2c_address = t->i2c->addr,
398 &t->fe, t->i2c->adapter, &xc5000_cfg))
406 .i2c_address = t->i2c->addr,
413 &t->fe, t->i2c->adapter, &xc5000c_cfg))
424 if (!dvb_attach(tda18271_attach, &t->fe, t->i2c->addr,
425 t->i2c->adapter, &cfg))
433 .i2c_address = t->i2c->addr,
442 &t->fe, t->i2c->adapter, &xc4000_cfg))
448 if (!dvb_attach(simple_tuner_attach, &t->fe,
449 t->i2c->adapter, t->i2c->addr, t->type))
458 t->name = fe_tuner_ops->info.name;
460 t->fe.analog_demod_priv = t;
470 t->name = analog_ops->info.name;
474 t->sd.entity.name = t->name;
477 dprintk("type set to %s\n", t->name);
479 t->mode_mask = new_mode_mask;
488 if (V4L2_TUNER_RADIO == t->mode)
489 set_radio_freq(c, t->radio_freq);
491 set_tv_freq(c, t->tv_freq);
496 t->mode_mask);
500 dprintk("Tuner attach for type = %d failed.\n", t->type);
501 t->type = TUNER_ABSENT;
523 struct tuner *t = to_tuner(sd);
532 if ((t->type == UNSET && ((tun_setup->addr == ADDR_UNSET) &&
533 (t->mode_mask & tun_setup->mode_mask))) ||
539 t->type, t->mode_mask,
557 struct tuner *t = to_tuner(sd);
558 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
560 if (t->type != cfg->tuner)
564 analog_ops->set_config(&t->fe, cfg->priv);
629 struct tuner *t;
636 t = kzalloc(sizeof(struct tuner), GFP_KERNEL);
637 if (NULL == t)
639 v4l2_i2c_subdev_init(&t->sd, client, &tuner_ops);
640 t->i2c = client;
641 t->name = "(tuner unset)";
642 t->type = UNSET;
643 t->audmode = V4L2_TUNER_MODE_STEREO;
644 t->standby = true;
645 t->radio_freq = 87.5 * 16000; /* Initial freq range */
646 t->tv_freq = 400 * 16; /* Sets freq to VHF High - needed for some PLL's to properly start */
663 t->i2c->adapter,
664 t->i2c->addr) >= 0) {
665 t->type = TUNER_TEA5761;
666 t->mode_mask = T_RADIO;
667 tuner_lookup(t->i2c->adapter, &radio, &tv);
673 kfree(t);
679 /* If chip is not tda8290, don't register.
681 if (tuner_symbol_probe(tda829x_probe, t->i2c->adapter,
682 t->i2c->addr) >= 0) {
686 t->type = TUNER_TDA9887;
687 t->mode_mask = T_RADIO | T_ANALOG_TV;
693 t->i2c->adapter, t->i2c->addr)
695 t->type = TUNER_TEA5767;
696 t->mode_mask = T_RADIO;
698 tuner_lookup(t->i2c->adapter, &radio, &tv);
715 tuner_lookup(t->i2c->adapter, &radio, &tv);
717 t->mode_mask = T_ANALOG_TV;
719 t->mode_mask |= T_RADIO;
720 dprintk("Setting mode_mask to 0x%02x\n", t->mode_mask);
726 t->sd.entity.name = t->name;
732 if (t->type == TUNER_TDA9887) {
733 t->pad[IF_VID_DEC_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK;
734 t->pad[IF_VID_DEC_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG;
735 t->pad[IF_VID_DEC_PAD_OUT].flags = MEDIA_PAD_FL_SOURCE;
736 t->pad[IF_VID_DEC_PAD_OUT].sig_type = PAD_SIGNAL_ANALOG;
737 ret = media_entity_pads_init(&t->sd.entity,
739 &t->pad[0]);
740 t->sd.entity.function = MEDIA_ENT_F_IF_VID_DECODER;
742 t->pad[TUNER_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK;
743 t->pad[TUNER_PAD_RF_INPUT].sig_type = PAD_SIGNAL_ANALOG;
744 t->pad[TUNER_PAD_OUTPUT].flags = MEDIA_PAD_FL_SOURCE;
745 t->pad[TUNER_PAD_OUTPUT].sig_type = PAD_SIGNAL_ANALOG;
746 t->pad[TUNER_PAD_AUD_OUT].flags = MEDIA_PAD_FL_SOURCE;
747 t->pad[TUNER_PAD_AUD_OUT].sig_type = PAD_SIGNAL_AUDIO;
748 ret = media_entity_pads_init(&t->sd.entity, TUNER_NUM_PADS,
749 &t->pad[0]);
750 t->sd.entity.function = MEDIA_ENT_F_TUNER;
755 kfree(t);
760 if (t->mode_mask & T_ANALOG_TV)
761 t->mode = V4L2_TUNER_ANALOG_TV;
763 t->mode = V4L2_TUNER_RADIO;
764 set_type(client, t->type, t->mode_mask, t->config, t->fe.callback);
765 list_add_tail(&t->list, &tuner_list);
768 t->type,
769 t->mode_mask & T_RADIO ? " Radio" : "",
770 t->mode_mask & T_ANALOG_TV ? " TV" : "");
782 struct tuner *t = to_tuner(i2c_get_clientdata(client));
784 v4l2_device_unregister_subdev(&t->sd);
785 tuner_detach(&t->fe);
786 t->fe.analog_demod_priv = NULL;
788 list_del(&t->list);
789 kfree(t);
802 * @t: a pointer to the module's internal struct_tuner
807 * tuner can't support that mode, it returns -EINVAL. Otherwise, it
816 static inline int check_mode(struct tuner *t, enum v4l2_tuner_type mode)
824 if ((t_mode & t->mode_mask) == 0)
832 * @t: a pointer to the module's internal struct_tuner
835 * If tuner doesn't support the needed mode (radio or TV), prints a
839 static int set_mode(struct tuner *t, enum v4l2_tuner_type mode)
841 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
843 if (mode != t->mode) {
844 if (check_mode(t, mode) == -EINVAL) {
845 dprintk("Tuner doesn't support mode %d. Putting tuner to sleep\n",
847 t->standby = true;
849 analog_ops->standby(&t->fe);
852 t->mode = mode;
860 * @t: a pointer to the module's internal struct_tuner
863 static void set_freq(struct tuner *t, unsigned int freq)
865 struct i2c_client *client = v4l2_get_subdevdata(&t->sd);
867 if (t->mode == V4L2_TUNER_RADIO) {
869 freq = t->radio_freq;
873 freq = t->tv_freq;
890 struct tuner *t = to_tuner(i2c_get_clientdata(c));
891 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
894 .mode = t->mode,
895 .audmode = t->audmode,
896 .std = t->std
899 if (t->type == UNSET) {
921 t->tv_freq = freq;
922 t->standby = false;
924 analog_ops->set_params(&t->fe, &params);
930 * @t: tuner internal struct
935 * code, and some logic to apply per-country hacks. V4L2 API doesn't provide
941 static v4l2_std_id tuner_fixup_std(struct tuner *t, v4l2_std_id std)
1031 struct tuner *t = to_tuner(i2c_get_clientdata(c));
1032 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
1035 .mode = t->mode,
1036 .audmode = t->audmode,
1037 .std = t->std
1040 if (t->type == UNSET) {
1062 t->radio_freq = freq;
1063 t->standby = false;
1065 analog_ops->set_params(&t->fe, &params);
1068 * supports stereo, so update t->audmode.
1070 t->audmode = params.audmode;
1086 struct tuner *t = fe->analog_demod_priv;
1092 switch (t->mode) {
1104 if (t->mode == V4L2_TUNER_RADIO) {
1105 freq = t->radio_freq / 16000;
1106 freq_fraction = (t->radio_freq % 16000) * 100 / 16000;
1108 freq = t->tv_freq / 16;
1109 freq_fraction = (t->tv_freq % 16) * 100 / 16;
1112 t->standby ? " on standby mode" : "");
1114 pr_info("Standard: 0x%08lx\n", (unsigned long)t->std);
1115 if (t->mode != V4L2_TUNER_RADIO)
1120 fe_tuner_ops->get_status(&t->fe, &tuner_status);
1140 struct tuner *t = to_tuner(sd);
1142 if (set_mode(t, V4L2_TUNER_RADIO) == 0)
1143 set_freq(t, 0);
1157 struct tuner *t = to_tuner(sd);
1158 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
1161 t->standby = true;
1163 analog_ops->standby(&t->fe);
1169 struct tuner *t = to_tuner(sd);
1171 if (set_mode(t, V4L2_TUNER_ANALOG_TV))
1174 t->std = tuner_fixup_std(t, std);
1175 if (t->std != std)
1176 dprintk("Fixup standard %llx to %llx\n", std, t->std);
1177 set_freq(t, 0);
1183 struct tuner *t = to_tuner(sd);
1185 if (set_mode(t, f->type) == 0)
1186 set_freq(t, f->frequency);
1202 struct tuner *t = to_tuner(sd);
1203 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops;
1205 if (check_mode(t, f->type) == -EINVAL)
1207 if (f->type == t->mode && fe_tuner_ops->get_frequency && !t->standby) {
1210 fe_tuner_ops->get_frequency(&t->fe, &abs_freq);
1211 f->frequency = (V4L2_TUNER_RADIO == t->mode) ?
1216 t->radio_freq : t->tv_freq;
1233 struct tuner *t = to_tuner(sd);
1234 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
1235 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops;
1237 if (check_mode(t, vt->type) == -EINVAL)
1239 if (vt->type == t->mode && analog_ops->get_afc)
1240 analog_ops->get_afc(&t->fe, &vt->afc);
1241 if (vt->type == t->mode && analog_ops->has_signal) {
1244 if (!analog_ops->has_signal(&t->fe, &signal))
1255 if (vt->type == t->mode) {
1260 fe_tuner_ops->get_status(&t->fe, &tuner_status);
1266 vt->audmode = t->audmode;
1286 struct tuner *t = to_tuner(sd);
1288 if (set_mode(t, vt->type))
1291 if (t->mode == V4L2_TUNER_RADIO) {
1292 t->audmode = vt->audmode;
1299 if (t->audmode != V4L2_TUNER_MODE_MONO &&
1300 t->audmode != V4L2_TUNER_MODE_STEREO)
1301 t->audmode = V4L2_TUNER_MODE_STEREO;
1303 set_freq(t, 0);
1310 struct tuner *t = to_tuner(sd);
1311 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
1314 analog_ops->tuner_status(&t->fe);
1322 struct tuner *t = to_tuner(i2c_get_clientdata(c));
1323 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
1327 if (t->fe.ops.tuner_ops.suspend)
1328 t->fe.ops.tuner_ops.suspend(&t->fe);
1329 else if (!t->standby && analog_ops->standby)
1330 analog_ops->standby(&t->fe);
1338 struct tuner *t = to_tuner(i2c_get_clientdata(c));
1342 if (t->fe.ops.tuner_ops.resume)
1343 t->fe.ops.tuner_ops.resume(&t->fe);
1344 else if (!t->standby)
1345 if (set_mode(t, t->mode) == 0)
1346 set_freq(t, 0);