Lines Matching refs:t
89 i2c_adapter_id(t->i2c->adapter), t->i2c->addr
240 struct tuner *t = fe->analog_demod_priv; in fe_set_params() local
260 struct tuner *t = fe->analog_demod_priv; in fe_set_config() local
301 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in set_type() local
302 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; in set_type()
303 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_type()
312 t->type = type; in set_type()
313 t->config = new_config; in set_type()
316 t->fe.callback = tuner_callback; in set_type()
320 tuner_detach(&t->fe); in set_type()
321 t->fe.analog_demod_priv = NULL; in set_type()
323 switch (t->type) { in set_type()
326 &t->fe, t->i2c->adapter, t->i2c->addr)) in set_type()
331 if (!dvb_attach(tda829x_attach, &t->fe, t->i2c->adapter, in set_type()
332 t->i2c->addr, t->config)) in set_type()
337 if (!dvb_attach(tea5767_attach, &t->fe, in set_type()
338 t->i2c->adapter, t->i2c->addr)) in set_type()
340 t->mode_mask = T_RADIO; in set_type()
343 if (!dvb_attach(tea5761_attach, &t->fe, in set_type()
344 t->i2c->adapter, t->i2c->addr)) in set_type()
346 t->mode_mask = T_RADIO; in set_type()
359 if (!dvb_attach(simple_tuner_attach, &t->fe, in set_type()
360 t->i2c->adapter, t->i2c->addr, t->type)) in set_type()
369 if (!dvb_attach(simple_tuner_attach, &t->fe, in set_type()
370 t->i2c->adapter, t->i2c->addr, t->type)) in set_type()
376 .i2c_adap = t->i2c->adapter, in set_type()
377 .i2c_addr = t->i2c->addr, in set_type()
379 if (!dvb_attach(xc2028_attach, &t->fe, &cfg)) in set_type()
386 &t->fe, t->i2c->adapter, t->i2c->addr)) in set_type()
392 .i2c_address = t->i2c->addr, in set_type()
398 &t->fe, t->i2c->adapter, &xc5000_cfg)) in set_type()
406 .i2c_address = t->i2c->addr, in set_type()
413 &t->fe, t->i2c->adapter, &xc5000c_cfg)) in set_type()
424 if (!dvb_attach(tda18271_attach, &t->fe, t->i2c->addr, in set_type()
425 t->i2c->adapter, &cfg)) in set_type()
433 .i2c_address = t->i2c->addr, in set_type()
442 &t->fe, t->i2c->adapter, &xc4000_cfg)) in set_type()
448 if (!dvb_attach(simple_tuner_attach, &t->fe, in set_type()
449 t->i2c->adapter, t->i2c->addr, t->type)) in set_type()
458 t->name = fe_tuner_ops->info.name; in set_type()
460 t->fe.analog_demod_priv = t; in set_type()
470 t->name = analog_ops->info.name; in set_type()
474 t->sd.entity.name = t->name; in set_type()
477 dprintk("type set to %s\n", t->name); in set_type()
479 t->mode_mask = new_mode_mask; in set_type()
488 if (V4L2_TUNER_RADIO == t->mode) in set_type()
489 set_radio_freq(c, t->radio_freq); in set_type()
491 set_tv_freq(c, t->tv_freq); in set_type()
496 t->mode_mask); in set_type()
500 dprintk("Tuner attach for type = %d failed.\n", t->type); in set_type()
501 t->type = TUNER_ABSENT; in set_type()
523 struct tuner *t = to_tuner(sd); in tuner_s_type_addr() local
532 if ((t->type == UNSET && ((tun_setup->addr == ADDR_UNSET) && in tuner_s_type_addr()
533 (t->mode_mask & tun_setup->mode_mask))) || in tuner_s_type_addr()
539 t->type, t->mode_mask, in tuner_s_type_addr()
557 struct tuner *t = to_tuner(sd); in tuner_s_config() local
558 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_s_config()
560 if (t->type != cfg->tuner) in tuner_s_config()
564 analog_ops->set_config(&t->fe, cfg->priv); in tuner_s_config()
631 struct tuner *t; in tuner_probe() local
638 t = kzalloc(sizeof(struct tuner), GFP_KERNEL); in tuner_probe()
639 if (NULL == t) in tuner_probe()
641 v4l2_i2c_subdev_init(&t->sd, client, &tuner_ops); in tuner_probe()
642 t->i2c = client; in tuner_probe()
643 t->name = "(tuner unset)"; in tuner_probe()
644 t->type = UNSET; in tuner_probe()
645 t->audmode = V4L2_TUNER_MODE_STEREO; in tuner_probe()
646 t->standby = true; in tuner_probe()
647 t->radio_freq = 87.5 * 16000; /* Initial freq range */ in tuner_probe()
648 t->tv_freq = 400 * 16; /* Sets freq to VHF High - needed for some PLL's to properly start */ in tuner_probe()
665 t->i2c->adapter, in tuner_probe()
666 t->i2c->addr) >= 0) { in tuner_probe()
667 t->type = TUNER_TEA5761; in tuner_probe()
668 t->mode_mask = T_RADIO; in tuner_probe()
669 tuner_lookup(t->i2c->adapter, &radio, &tv); in tuner_probe()
675 kfree(t); in tuner_probe()
683 if (tuner_symbol_probe(tda829x_probe, t->i2c->adapter, in tuner_probe()
684 t->i2c->addr) >= 0) { in tuner_probe()
688 t->type = TUNER_TDA9887; in tuner_probe()
689 t->mode_mask = T_RADIO | T_ANALOG_TV; in tuner_probe()
695 t->i2c->adapter, t->i2c->addr) in tuner_probe()
697 t->type = TUNER_TEA5767; in tuner_probe()
698 t->mode_mask = T_RADIO; in tuner_probe()
700 tuner_lookup(t->i2c->adapter, &radio, &tv); in tuner_probe()
717 tuner_lookup(t->i2c->adapter, &radio, &tv); in tuner_probe()
719 t->mode_mask = T_ANALOG_TV; in tuner_probe()
721 t->mode_mask |= T_RADIO; in tuner_probe()
722 dprintk("Setting mode_mask to 0x%02x\n", t->mode_mask); in tuner_probe()
728 t->sd.entity.name = t->name; in tuner_probe()
734 if (t->type == TUNER_TDA9887) { in tuner_probe()
735 t->pad[IF_VID_DEC_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; in tuner_probe()
736 t->pad[IF_VID_DEC_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; in tuner_probe()
737 t->pad[IF_VID_DEC_PAD_OUT].flags = MEDIA_PAD_FL_SOURCE; in tuner_probe()
738 t->pad[IF_VID_DEC_PAD_OUT].sig_type = PAD_SIGNAL_ANALOG; in tuner_probe()
739 ret = media_entity_pads_init(&t->sd.entity, in tuner_probe()
741 &t->pad[0]); in tuner_probe()
742 t->sd.entity.function = MEDIA_ENT_F_IF_VID_DECODER; in tuner_probe()
744 t->pad[TUNER_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK; in tuner_probe()
745 t->pad[TUNER_PAD_RF_INPUT].sig_type = PAD_SIGNAL_ANALOG; in tuner_probe()
746 t->pad[TUNER_PAD_OUTPUT].flags = MEDIA_PAD_FL_SOURCE; in tuner_probe()
747 t->pad[TUNER_PAD_OUTPUT].sig_type = PAD_SIGNAL_ANALOG; in tuner_probe()
748 t->pad[TUNER_PAD_AUD_OUT].flags = MEDIA_PAD_FL_SOURCE; in tuner_probe()
749 t->pad[TUNER_PAD_AUD_OUT].sig_type = PAD_SIGNAL_AUDIO; in tuner_probe()
750 ret = media_entity_pads_init(&t->sd.entity, TUNER_NUM_PADS, in tuner_probe()
751 &t->pad[0]); in tuner_probe()
752 t->sd.entity.function = MEDIA_ENT_F_TUNER; in tuner_probe()
757 kfree(t); in tuner_probe()
762 if (t->mode_mask & T_ANALOG_TV) in tuner_probe()
763 t->mode = V4L2_TUNER_ANALOG_TV; in tuner_probe()
765 t->mode = V4L2_TUNER_RADIO; in tuner_probe()
766 set_type(client, t->type, t->mode_mask, t->config, t->fe.callback); in tuner_probe()
767 list_add_tail(&t->list, &tuner_list); in tuner_probe()
770 t->type, in tuner_probe()
771 t->mode_mask & T_RADIO ? " Radio" : "", in tuner_probe()
772 t->mode_mask & T_ANALOG_TV ? " TV" : ""); in tuner_probe()
784 struct tuner *t = to_tuner(i2c_get_clientdata(client)); in tuner_remove() local
786 v4l2_device_unregister_subdev(&t->sd); in tuner_remove()
787 tuner_detach(&t->fe); in tuner_remove()
788 t->fe.analog_demod_priv = NULL; in tuner_remove()
790 list_del(&t->list); in tuner_remove()
791 kfree(t); in tuner_remove()
818 static inline int check_mode(struct tuner *t, enum v4l2_tuner_type mode) in check_mode() argument
826 if ((t_mode & t->mode_mask) == 0) in check_mode()
841 static int set_mode(struct tuner *t, enum v4l2_tuner_type mode) in set_mode() argument
843 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_mode()
845 if (mode != t->mode) { in set_mode()
846 if (check_mode(t, mode) == -EINVAL) { in set_mode()
849 t->standby = true; in set_mode()
851 analog_ops->standby(&t->fe); in set_mode()
854 t->mode = mode; in set_mode()
865 static void set_freq(struct tuner *t, unsigned int freq) in set_freq() argument
867 struct i2c_client *client = v4l2_get_subdevdata(&t->sd); in set_freq()
869 if (t->mode == V4L2_TUNER_RADIO) { in set_freq()
871 freq = t->radio_freq; in set_freq()
875 freq = t->tv_freq; in set_freq()
892 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in set_tv_freq() local
893 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_tv_freq()
896 .mode = t->mode, in set_tv_freq()
897 .audmode = t->audmode, in set_tv_freq()
898 .std = t->std in set_tv_freq()
901 if (t->type == UNSET) { in set_tv_freq()
923 t->tv_freq = freq; in set_tv_freq()
924 t->standby = false; in set_tv_freq()
926 analog_ops->set_params(&t->fe, ¶ms); in set_tv_freq()
943 static v4l2_std_id tuner_fixup_std(struct tuner *t, v4l2_std_id std) in tuner_fixup_std() argument
1033 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in set_radio_freq() local
1034 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_radio_freq()
1037 .mode = t->mode, in set_radio_freq()
1038 .audmode = t->audmode, in set_radio_freq()
1039 .std = t->std in set_radio_freq()
1042 if (t->type == UNSET) { in set_radio_freq()
1064 t->radio_freq = freq; in set_radio_freq()
1065 t->standby = false; in set_radio_freq()
1067 analog_ops->set_params(&t->fe, ¶ms); in set_radio_freq()
1072 t->audmode = params.audmode; in set_radio_freq()
1088 struct tuner *t = fe->analog_demod_priv; in tuner_status() local
1094 switch (t->mode) { in tuner_status()
1106 if (t->mode == V4L2_TUNER_RADIO) { in tuner_status()
1107 freq = t->radio_freq / 16000; in tuner_status()
1108 freq_fraction = (t->radio_freq % 16000) * 100 / 16000; in tuner_status()
1110 freq = t->tv_freq / 16; in tuner_status()
1111 freq_fraction = (t->tv_freq % 16) * 100 / 16; in tuner_status()
1114 t->standby ? " on standby mode" : ""); in tuner_status()
1116 pr_info("Standard: 0x%08lx\n", (unsigned long)t->std); in tuner_status()
1117 if (t->mode != V4L2_TUNER_RADIO) in tuner_status()
1122 fe_tuner_ops->get_status(&t->fe, &tuner_status); in tuner_status()
1142 struct tuner *t = to_tuner(sd); in tuner_s_radio() local
1144 if (set_mode(t, V4L2_TUNER_RADIO) == 0) in tuner_s_radio()
1145 set_freq(t, 0); in tuner_s_radio()
1159 struct tuner *t = to_tuner(sd); in tuner_standby() local
1160 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_standby()
1163 t->standby = true; in tuner_standby()
1165 analog_ops->standby(&t->fe); in tuner_standby()
1171 struct tuner *t = to_tuner(sd); in tuner_s_std() local
1173 if (set_mode(t, V4L2_TUNER_ANALOG_TV)) in tuner_s_std()
1176 t->std = tuner_fixup_std(t, std); in tuner_s_std()
1177 if (t->std != std) in tuner_s_std()
1178 dprintk("Fixup standard %llx to %llx\n", std, t->std); in tuner_s_std()
1179 set_freq(t, 0); in tuner_s_std()
1185 struct tuner *t = to_tuner(sd); in tuner_s_frequency() local
1187 if (set_mode(t, f->type) == 0) in tuner_s_frequency()
1188 set_freq(t, f->frequency); in tuner_s_frequency()
1204 struct tuner *t = to_tuner(sd); in tuner_g_frequency() local
1205 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; in tuner_g_frequency()
1207 if (check_mode(t, f->type) == -EINVAL) in tuner_g_frequency()
1209 if (f->type == t->mode && fe_tuner_ops->get_frequency && !t->standby) { in tuner_g_frequency()
1212 fe_tuner_ops->get_frequency(&t->fe, &abs_freq); in tuner_g_frequency()
1213 f->frequency = (V4L2_TUNER_RADIO == t->mode) ? in tuner_g_frequency()
1218 t->radio_freq : t->tv_freq; in tuner_g_frequency()
1235 struct tuner *t = to_tuner(sd); in tuner_g_tuner() local
1236 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_g_tuner()
1237 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; in tuner_g_tuner()
1239 if (check_mode(t, vt->type) == -EINVAL) in tuner_g_tuner()
1241 if (vt->type == t->mode && analog_ops->get_afc) in tuner_g_tuner()
1242 analog_ops->get_afc(&t->fe, &vt->afc); in tuner_g_tuner()
1243 if (vt->type == t->mode && analog_ops->has_signal) { in tuner_g_tuner()
1246 if (!analog_ops->has_signal(&t->fe, &signal)) in tuner_g_tuner()
1257 if (vt->type == t->mode) { in tuner_g_tuner()
1262 fe_tuner_ops->get_status(&t->fe, &tuner_status); in tuner_g_tuner()
1268 vt->audmode = t->audmode; in tuner_g_tuner()
1288 struct tuner *t = to_tuner(sd); in tuner_s_tuner() local
1290 if (set_mode(t, vt->type)) in tuner_s_tuner()
1293 if (t->mode == V4L2_TUNER_RADIO) { in tuner_s_tuner()
1294 t->audmode = vt->audmode; in tuner_s_tuner()
1301 if (t->audmode != V4L2_TUNER_MODE_MONO && in tuner_s_tuner()
1302 t->audmode != V4L2_TUNER_MODE_STEREO) in tuner_s_tuner()
1303 t->audmode = V4L2_TUNER_MODE_STEREO; in tuner_s_tuner()
1305 set_freq(t, 0); in tuner_s_tuner()
1312 struct tuner *t = to_tuner(sd); in tuner_log_status() local
1313 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_log_status()
1316 analog_ops->tuner_status(&t->fe); in tuner_log_status()
1324 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in tuner_suspend() local
1325 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_suspend()
1329 if (t->fe.ops.tuner_ops.suspend) in tuner_suspend()
1330 t->fe.ops.tuner_ops.suspend(&t->fe); in tuner_suspend()
1331 else if (!t->standby && analog_ops->standby) in tuner_suspend()
1332 analog_ops->standby(&t->fe); in tuner_suspend()
1340 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in tuner_resume() local
1344 if (t->fe.ops.tuner_ops.resume) in tuner_resume()
1345 t->fe.ops.tuner_ops.resume(&t->fe); in tuner_resume()
1346 else if (!t->standby) in tuner_resume()
1347 if (set_mode(t, t->mode) == 0) in tuner_resume()
1348 set_freq(t, 0); in tuner_resume()