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()
629 struct tuner *t; in tuner_probe() local
636 t = kzalloc(sizeof(struct tuner), GFP_KERNEL); in tuner_probe()
637 if (NULL == t) in tuner_probe()
639 v4l2_i2c_subdev_init(&t->sd, client, &tuner_ops); in tuner_probe()
640 t->i2c = client; in tuner_probe()
641 t->name = "(tuner unset)"; in tuner_probe()
642 t->type = UNSET; in tuner_probe()
643 t->audmode = V4L2_TUNER_MODE_STEREO; in tuner_probe()
644 t->standby = true; in tuner_probe()
645 t->radio_freq = 87.5 * 16000; /* Initial freq range */ in tuner_probe()
646 t->tv_freq = 400 * 16; /* Sets freq to VHF High - needed for some PLL's to properly start */ in tuner_probe()
663 t->i2c->adapter, in tuner_probe()
664 t->i2c->addr) >= 0) { in tuner_probe()
665 t->type = TUNER_TEA5761; in tuner_probe()
666 t->mode_mask = T_RADIO; in tuner_probe()
667 tuner_lookup(t->i2c->adapter, &radio, &tv); in tuner_probe()
673 kfree(t); in tuner_probe()
681 if (tuner_symbol_probe(tda829x_probe, t->i2c->adapter, in tuner_probe()
682 t->i2c->addr) >= 0) { in tuner_probe()
686 t->type = TUNER_TDA9887; in tuner_probe()
687 t->mode_mask = T_RADIO | T_ANALOG_TV; in tuner_probe()
693 t->i2c->adapter, t->i2c->addr) in tuner_probe()
695 t->type = TUNER_TEA5767; in tuner_probe()
696 t->mode_mask = T_RADIO; in tuner_probe()
698 tuner_lookup(t->i2c->adapter, &radio, &tv); in tuner_probe()
715 tuner_lookup(t->i2c->adapter, &radio, &tv); in tuner_probe()
717 t->mode_mask = T_ANALOG_TV; in tuner_probe()
719 t->mode_mask |= T_RADIO; in tuner_probe()
720 dprintk("Setting mode_mask to 0x%02x\n", t->mode_mask); in tuner_probe()
726 t->sd.entity.name = t->name; in tuner_probe()
732 if (t->type == TUNER_TDA9887) { in tuner_probe()
733 t->pad[IF_VID_DEC_PAD_IF_INPUT].flags = MEDIA_PAD_FL_SINK; in tuner_probe()
734 t->pad[IF_VID_DEC_PAD_IF_INPUT].sig_type = PAD_SIGNAL_ANALOG; in tuner_probe()
735 t->pad[IF_VID_DEC_PAD_OUT].flags = MEDIA_PAD_FL_SOURCE; in tuner_probe()
736 t->pad[IF_VID_DEC_PAD_OUT].sig_type = PAD_SIGNAL_ANALOG; in tuner_probe()
737 ret = media_entity_pads_init(&t->sd.entity, in tuner_probe()
739 &t->pad[0]); in tuner_probe()
740 t->sd.entity.function = MEDIA_ENT_F_IF_VID_DECODER; in tuner_probe()
742 t->pad[TUNER_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK; in tuner_probe()
743 t->pad[TUNER_PAD_RF_INPUT].sig_type = PAD_SIGNAL_ANALOG; in tuner_probe()
744 t->pad[TUNER_PAD_OUTPUT].flags = MEDIA_PAD_FL_SOURCE; in tuner_probe()
745 t->pad[TUNER_PAD_OUTPUT].sig_type = PAD_SIGNAL_ANALOG; in tuner_probe()
746 t->pad[TUNER_PAD_AUD_OUT].flags = MEDIA_PAD_FL_SOURCE; in tuner_probe()
747 t->pad[TUNER_PAD_AUD_OUT].sig_type = PAD_SIGNAL_AUDIO; in tuner_probe()
748 ret = media_entity_pads_init(&t->sd.entity, TUNER_NUM_PADS, in tuner_probe()
749 &t->pad[0]); in tuner_probe()
750 t->sd.entity.function = MEDIA_ENT_F_TUNER; in tuner_probe()
755 kfree(t); in tuner_probe()
760 if (t->mode_mask & T_ANALOG_TV) in tuner_probe()
761 t->mode = V4L2_TUNER_ANALOG_TV; in tuner_probe()
763 t->mode = V4L2_TUNER_RADIO; in tuner_probe()
764 set_type(client, t->type, t->mode_mask, t->config, t->fe.callback); in tuner_probe()
765 list_add_tail(&t->list, &tuner_list); in tuner_probe()
768 t->type, in tuner_probe()
769 t->mode_mask & T_RADIO ? " Radio" : "", in tuner_probe()
770 t->mode_mask & T_ANALOG_TV ? " TV" : ""); in tuner_probe()
782 struct tuner *t = to_tuner(i2c_get_clientdata(client)); in tuner_remove() local
784 v4l2_device_unregister_subdev(&t->sd); in tuner_remove()
785 tuner_detach(&t->fe); in tuner_remove()
786 t->fe.analog_demod_priv = NULL; in tuner_remove()
788 list_del(&t->list); in tuner_remove()
789 kfree(t); in tuner_remove()
816 static inline int check_mode(struct tuner *t, enum v4l2_tuner_type mode) in check_mode() argument
824 if ((t_mode & t->mode_mask) == 0) in check_mode()
839 static int set_mode(struct tuner *t, enum v4l2_tuner_type mode) in set_mode() argument
841 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_mode()
843 if (mode != t->mode) { in set_mode()
844 if (check_mode(t, mode) == -EINVAL) { in set_mode()
847 t->standby = true; in set_mode()
849 analog_ops->standby(&t->fe); in set_mode()
852 t->mode = mode; in set_mode()
863 static void set_freq(struct tuner *t, unsigned int freq) in set_freq() argument
865 struct i2c_client *client = v4l2_get_subdevdata(&t->sd); in set_freq()
867 if (t->mode == V4L2_TUNER_RADIO) { in set_freq()
869 freq = t->radio_freq; in set_freq()
873 freq = t->tv_freq; in set_freq()
890 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in set_tv_freq() local
891 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_tv_freq()
894 .mode = t->mode, in set_tv_freq()
895 .audmode = t->audmode, in set_tv_freq()
896 .std = t->std in set_tv_freq()
899 if (t->type == UNSET) { in set_tv_freq()
921 t->tv_freq = freq; in set_tv_freq()
922 t->standby = false; in set_tv_freq()
924 analog_ops->set_params(&t->fe, &params); in set_tv_freq()
941 static v4l2_std_id tuner_fixup_std(struct tuner *t, v4l2_std_id std) in tuner_fixup_std() argument
1031 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in set_radio_freq() local
1032 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_radio_freq()
1035 .mode = t->mode, in set_radio_freq()
1036 .audmode = t->audmode, in set_radio_freq()
1037 .std = t->std in set_radio_freq()
1040 if (t->type == UNSET) { in set_radio_freq()
1062 t->radio_freq = freq; in set_radio_freq()
1063 t->standby = false; in set_radio_freq()
1065 analog_ops->set_params(&t->fe, &params); in set_radio_freq()
1070 t->audmode = params.audmode; in set_radio_freq()
1086 struct tuner *t = fe->analog_demod_priv; in tuner_status() local
1092 switch (t->mode) { in tuner_status()
1104 if (t->mode == V4L2_TUNER_RADIO) { in tuner_status()
1105 freq = t->radio_freq / 16000; in tuner_status()
1106 freq_fraction = (t->radio_freq % 16000) * 100 / 16000; in tuner_status()
1108 freq = t->tv_freq / 16; in tuner_status()
1109 freq_fraction = (t->tv_freq % 16) * 100 / 16; in tuner_status()
1112 t->standby ? " on standby mode" : ""); in tuner_status()
1114 pr_info("Standard: 0x%08lx\n", (unsigned long)t->std); in tuner_status()
1115 if (t->mode != V4L2_TUNER_RADIO) in tuner_status()
1120 fe_tuner_ops->get_status(&t->fe, &tuner_status); in tuner_status()
1140 struct tuner *t = to_tuner(sd); in tuner_s_radio() local
1142 if (set_mode(t, V4L2_TUNER_RADIO) == 0) in tuner_s_radio()
1143 set_freq(t, 0); in tuner_s_radio()
1157 struct tuner *t = to_tuner(sd); in tuner_standby() local
1158 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_standby()
1161 t->standby = true; in tuner_standby()
1163 analog_ops->standby(&t->fe); in tuner_standby()
1169 struct tuner *t = to_tuner(sd); in tuner_s_std() local
1171 if (set_mode(t, V4L2_TUNER_ANALOG_TV)) in tuner_s_std()
1174 t->std = tuner_fixup_std(t, std); in tuner_s_std()
1175 if (t->std != std) in tuner_s_std()
1176 dprintk("Fixup standard %llx to %llx\n", std, t->std); in tuner_s_std()
1177 set_freq(t, 0); in tuner_s_std()
1183 struct tuner *t = to_tuner(sd); in tuner_s_frequency() local
1185 if (set_mode(t, f->type) == 0) in tuner_s_frequency()
1186 set_freq(t, f->frequency); in tuner_s_frequency()
1202 struct tuner *t = to_tuner(sd); in tuner_g_frequency() local
1203 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; in tuner_g_frequency()
1205 if (check_mode(t, f->type) == -EINVAL) in tuner_g_frequency()
1207 if (f->type == t->mode && fe_tuner_ops->get_frequency && !t->standby) { in tuner_g_frequency()
1210 fe_tuner_ops->get_frequency(&t->fe, &abs_freq); in tuner_g_frequency()
1211 f->frequency = (V4L2_TUNER_RADIO == t->mode) ? in tuner_g_frequency()
1216 t->radio_freq : t->tv_freq; in tuner_g_frequency()
1233 struct tuner *t = to_tuner(sd); in tuner_g_tuner() local
1234 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_g_tuner()
1235 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; in tuner_g_tuner()
1237 if (check_mode(t, vt->type) == -EINVAL) in tuner_g_tuner()
1239 if (vt->type == t->mode && analog_ops->get_afc) in tuner_g_tuner()
1240 analog_ops->get_afc(&t->fe, &vt->afc); in tuner_g_tuner()
1241 if (vt->type == t->mode && analog_ops->has_signal) { in tuner_g_tuner()
1244 if (!analog_ops->has_signal(&t->fe, &signal)) in tuner_g_tuner()
1255 if (vt->type == t->mode) { in tuner_g_tuner()
1260 fe_tuner_ops->get_status(&t->fe, &tuner_status); in tuner_g_tuner()
1266 vt->audmode = t->audmode; in tuner_g_tuner()
1286 struct tuner *t = to_tuner(sd); in tuner_s_tuner() local
1288 if (set_mode(t, vt->type)) in tuner_s_tuner()
1291 if (t->mode == V4L2_TUNER_RADIO) { in tuner_s_tuner()
1292 t->audmode = vt->audmode; in tuner_s_tuner()
1299 if (t->audmode != V4L2_TUNER_MODE_MONO && in tuner_s_tuner()
1300 t->audmode != V4L2_TUNER_MODE_STEREO) in tuner_s_tuner()
1301 t->audmode = V4L2_TUNER_MODE_STEREO; in tuner_s_tuner()
1303 set_freq(t, 0); in tuner_s_tuner()
1310 struct tuner *t = to_tuner(sd); in tuner_log_status() local
1311 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_log_status()
1314 analog_ops->tuner_status(&t->fe); in tuner_log_status()
1322 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in tuner_suspend() local
1323 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_suspend()
1327 if (t->fe.ops.tuner_ops.suspend) in tuner_suspend()
1328 t->fe.ops.tuner_ops.suspend(&t->fe); in tuner_suspend()
1329 else if (!t->standby && analog_ops->standby) in tuner_suspend()
1330 analog_ops->standby(&t->fe); in tuner_suspend()
1338 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in tuner_resume() local
1342 if (t->fe.ops.tuner_ops.resume) in tuner_resume()
1343 t->fe.ops.tuner_ops.resume(&t->fe); in tuner_resume()
1344 else if (!t->standby) in tuner_resume()
1345 if (set_mode(t, t->mode) == 0) in tuner_resume()
1346 set_freq(t, 0); in tuner_resume()