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()
819 static inline int check_mode(struct tuner *t, enum v4l2_tuner_type mode) in check_mode() argument
827 if ((t_mode & t->mode_mask) == 0) in check_mode()
842 static int set_mode(struct tuner *t, enum v4l2_tuner_type mode) in set_mode() argument
844 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_mode()
846 if (mode != t->mode) { in set_mode()
847 if (check_mode(t, mode) == -EINVAL) { in set_mode()
850 t->standby = true; in set_mode()
852 analog_ops->standby(&t->fe); in set_mode()
855 t->mode = mode; in set_mode()
866 static void set_freq(struct tuner *t, unsigned int freq) in set_freq() argument
868 struct i2c_client *client = v4l2_get_subdevdata(&t->sd); in set_freq()
870 if (t->mode == V4L2_TUNER_RADIO) { in set_freq()
872 freq = t->radio_freq; in set_freq()
876 freq = t->tv_freq; in set_freq()
893 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in set_tv_freq() local
894 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_tv_freq()
897 .mode = t->mode, in set_tv_freq()
898 .audmode = t->audmode, in set_tv_freq()
899 .std = t->std in set_tv_freq()
902 if (t->type == UNSET) { in set_tv_freq()
924 t->tv_freq = freq; in set_tv_freq()
925 t->standby = false; in set_tv_freq()
927 analog_ops->set_params(&t->fe, &params); in set_tv_freq()
944 static v4l2_std_id tuner_fixup_std(struct tuner *t, v4l2_std_id std) in tuner_fixup_std() argument
1034 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in set_radio_freq() local
1035 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_radio_freq()
1038 .mode = t->mode, in set_radio_freq()
1039 .audmode = t->audmode, in set_radio_freq()
1040 .std = t->std in set_radio_freq()
1043 if (t->type == UNSET) { in set_radio_freq()
1065 t->radio_freq = freq; in set_radio_freq()
1066 t->standby = false; in set_radio_freq()
1068 analog_ops->set_params(&t->fe, &params); in set_radio_freq()
1073 t->audmode = params.audmode; in set_radio_freq()
1089 struct tuner *t = fe->analog_demod_priv; in tuner_status() local
1095 switch (t->mode) { in tuner_status()
1107 if (t->mode == V4L2_TUNER_RADIO) { in tuner_status()
1108 freq = t->radio_freq / 16000; in tuner_status()
1109 freq_fraction = (t->radio_freq % 16000) * 100 / 16000; in tuner_status()
1111 freq = t->tv_freq / 16; in tuner_status()
1112 freq_fraction = (t->tv_freq % 16) * 100 / 16; in tuner_status()
1115 t->standby ? " on standby mode" : ""); in tuner_status()
1117 pr_info("Standard: 0x%08lx\n", (unsigned long)t->std); in tuner_status()
1118 if (t->mode != V4L2_TUNER_RADIO) in tuner_status()
1123 fe_tuner_ops->get_status(&t->fe, &tuner_status); in tuner_status()
1143 struct tuner *t = to_tuner(sd); in tuner_s_radio() local
1145 if (set_mode(t, V4L2_TUNER_RADIO) == 0) in tuner_s_radio()
1146 set_freq(t, 0); in tuner_s_radio()
1160 struct tuner *t = to_tuner(sd); in tuner_standby() local
1161 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_standby()
1164 t->standby = true; in tuner_standby()
1166 analog_ops->standby(&t->fe); in tuner_standby()
1172 struct tuner *t = to_tuner(sd); in tuner_s_std() local
1174 if (set_mode(t, V4L2_TUNER_ANALOG_TV)) in tuner_s_std()
1177 t->std = tuner_fixup_std(t, std); in tuner_s_std()
1178 if (t->std != std) in tuner_s_std()
1179 dprintk("Fixup standard %llx to %llx\n", std, t->std); in tuner_s_std()
1180 set_freq(t, 0); in tuner_s_std()
1186 struct tuner *t = to_tuner(sd); in tuner_s_frequency() local
1188 if (set_mode(t, f->type) == 0) in tuner_s_frequency()
1189 set_freq(t, f->frequency); in tuner_s_frequency()
1205 struct tuner *t = to_tuner(sd); in tuner_g_frequency() local
1206 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; in tuner_g_frequency()
1208 if (check_mode(t, f->type) == -EINVAL) in tuner_g_frequency()
1210 if (f->type == t->mode && fe_tuner_ops->get_frequency && !t->standby) { in tuner_g_frequency()
1213 fe_tuner_ops->get_frequency(&t->fe, &abs_freq); in tuner_g_frequency()
1214 f->frequency = (V4L2_TUNER_RADIO == t->mode) ? in tuner_g_frequency()
1219 t->radio_freq : t->tv_freq; in tuner_g_frequency()
1236 struct tuner *t = to_tuner(sd); in tuner_g_tuner() local
1237 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_g_tuner()
1238 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; in tuner_g_tuner()
1240 if (check_mode(t, vt->type) == -EINVAL) in tuner_g_tuner()
1242 if (vt->type == t->mode && analog_ops->get_afc) in tuner_g_tuner()
1243 analog_ops->get_afc(&t->fe, &vt->afc); in tuner_g_tuner()
1244 if (vt->type == t->mode && analog_ops->has_signal) { in tuner_g_tuner()
1247 if (!analog_ops->has_signal(&t->fe, &signal)) in tuner_g_tuner()
1258 if (vt->type == t->mode) { in tuner_g_tuner()
1263 fe_tuner_ops->get_status(&t->fe, &tuner_status); in tuner_g_tuner()
1269 vt->audmode = t->audmode; in tuner_g_tuner()
1289 struct tuner *t = to_tuner(sd); in tuner_s_tuner() local
1291 if (set_mode(t, vt->type)) in tuner_s_tuner()
1294 if (t->mode == V4L2_TUNER_RADIO) { in tuner_s_tuner()
1295 t->audmode = vt->audmode; in tuner_s_tuner()
1302 if (t->audmode != V4L2_TUNER_MODE_MONO && in tuner_s_tuner()
1303 t->audmode != V4L2_TUNER_MODE_STEREO) in tuner_s_tuner()
1304 t->audmode = V4L2_TUNER_MODE_STEREO; in tuner_s_tuner()
1306 set_freq(t, 0); in tuner_s_tuner()
1313 struct tuner *t = to_tuner(sd); in tuner_log_status() local
1314 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_log_status()
1317 analog_ops->tuner_status(&t->fe); in tuner_log_status()
1325 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in tuner_suspend() local
1326 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_suspend()
1330 if (t->fe.ops.tuner_ops.suspend) in tuner_suspend()
1331 t->fe.ops.tuner_ops.suspend(&t->fe); in tuner_suspend()
1332 else if (!t->standby && analog_ops->standby) in tuner_suspend()
1333 analog_ops->standby(&t->fe); in tuner_suspend()
1341 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in tuner_resume() local
1345 if (t->fe.ops.tuner_ops.resume) in tuner_resume()
1346 t->fe.ops.tuner_ops.resume(&t->fe); in tuner_resume()
1347 else if (!t->standby) in tuner_resume()
1348 if (set_mode(t, t->mode) == 0) in tuner_resume()
1349 set_freq(t, 0); in tuner_resume()