Lines Matching refs:t

46 #define PREFIX (t->i2c->dev.driver->name)
89 i2c_adapter_id(t->i2c->adapter), \
90 t->i2c->addr, ##arg); \
95 i2c_adapter_id(t->i2c->adapter), \
96 t->i2c->addr, ##arg); \
101 i2c_adapter_id(t->i2c->adapter), \
102 t->i2c->addr, ##arg); \
108 i2c_adapter_id(t->i2c->adapter), \
109 t->i2c->addr, ##arg); \
207 struct tuner *t = fe->analog_demod_priv; in fe_set_params() local
227 struct tuner *t = fe->analog_demod_priv; in fe_set_config() local
268 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in set_type() local
269 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; in set_type()
270 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_type()
279 t->type = type; in set_type()
280 t->config = new_config; in set_type()
283 t->fe.callback = tuner_callback; in set_type()
287 tuner_detach(&t->fe); in set_type()
288 t->fe.analog_demod_priv = NULL; in set_type()
290 switch (t->type) { in set_type()
293 &t->fe, t->i2c->adapter, t->i2c->addr)) in set_type()
298 if (!dvb_attach(tda829x_attach, &t->fe, t->i2c->adapter, in set_type()
299 t->i2c->addr, t->config)) in set_type()
304 if (!dvb_attach(tea5767_attach, &t->fe, in set_type()
305 t->i2c->adapter, t->i2c->addr)) in set_type()
307 t->mode_mask = T_RADIO; in set_type()
310 if (!dvb_attach(tea5761_attach, &t->fe, in set_type()
311 t->i2c->adapter, t->i2c->addr)) in set_type()
313 t->mode_mask = T_RADIO; in set_type()
326 if (!dvb_attach(simple_tuner_attach, &t->fe, in set_type()
327 t->i2c->adapter, t->i2c->addr, t->type)) in set_type()
336 if (!dvb_attach(simple_tuner_attach, &t->fe, in set_type()
337 t->i2c->adapter, t->i2c->addr, t->type)) in set_type()
343 .i2c_adap = t->i2c->adapter, in set_type()
344 .i2c_addr = t->i2c->addr, in set_type()
346 if (!dvb_attach(xc2028_attach, &t->fe, &cfg)) in set_type()
353 &t->fe, t->i2c->adapter, t->i2c->addr)) in set_type()
359 .i2c_address = t->i2c->addr, in set_type()
365 &t->fe, t->i2c->adapter, &xc5000_cfg)) in set_type()
373 .i2c_address = t->i2c->addr, in set_type()
380 &t->fe, t->i2c->adapter, &xc5000c_cfg)) in set_type()
391 if (!dvb_attach(tda18271_attach, &t->fe, t->i2c->addr, in set_type()
392 t->i2c->adapter, &cfg)) in set_type()
400 .i2c_address = t->i2c->addr, in set_type()
409 &t->fe, t->i2c->adapter, &xc4000_cfg)) in set_type()
415 if (!dvb_attach(simple_tuner_attach, &t->fe, in set_type()
416 t->i2c->adapter, t->i2c->addr, t->type)) in set_type()
425 t->name = fe_tuner_ops->info.name; in set_type()
427 t->fe.analog_demod_priv = t; in set_type()
437 t->name = analog_ops->info.name; in set_type()
441 t->sd.entity.name = t->name; in set_type()
444 tuner_dbg("type set to %s\n", t->name); in set_type()
446 t->mode_mask = new_mode_mask; in set_type()
455 if (V4L2_TUNER_RADIO == t->mode) in set_type()
456 set_radio_freq(c, t->radio_freq); in set_type()
458 set_tv_freq(c, t->tv_freq); in set_type()
463 t->mode_mask); in set_type()
467 tuner_dbg("Tuner attach for type = %d failed.\n", t->type); in set_type()
468 t->type = TUNER_ABSENT; in set_type()
490 struct tuner *t = to_tuner(sd); in tuner_s_type_addr() local
499 if ((t->type == UNSET && ((tun_setup->addr == ADDR_UNSET) && in tuner_s_type_addr()
500 (t->mode_mask & tun_setup->mode_mask))) || in tuner_s_type_addr()
507 t->type, t->mode_mask, in tuner_s_type_addr()
525 struct tuner *t = to_tuner(sd); in tuner_s_config() local
526 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_s_config()
528 if (t->type != cfg->tuner) in tuner_s_config()
532 analog_ops->set_config(&t->fe, cfg->priv); in tuner_s_config()
599 struct tuner *t; in tuner_probe() local
606 t = kzalloc(sizeof(struct tuner), GFP_KERNEL); in tuner_probe()
607 if (NULL == t) in tuner_probe()
609 v4l2_i2c_subdev_init(&t->sd, client, &tuner_ops); in tuner_probe()
610 t->i2c = client; in tuner_probe()
611 t->name = "(tuner unset)"; in tuner_probe()
612 t->type = UNSET; in tuner_probe()
613 t->audmode = V4L2_TUNER_MODE_STEREO; in tuner_probe()
614 t->standby = true; in tuner_probe()
615 t->radio_freq = 87.5 * 16000; /* Initial freq range */ in tuner_probe()
616 t->tv_freq = 400 * 16; /* Sets freq to VHF High - needed for some PLL's to properly start */ in tuner_probe()
635 t->i2c->adapter, in tuner_probe()
636 t->i2c->addr) >= 0) { in tuner_probe()
637 t->type = TUNER_TEA5761; in tuner_probe()
638 t->mode_mask = T_RADIO; in tuner_probe()
639 tuner_lookup(t->i2c->adapter, &radio, &tv); in tuner_probe()
645 kfree(t); in tuner_probe()
653 if (tuner_symbol_probe(tda829x_probe, t->i2c->adapter, in tuner_probe()
654 t->i2c->addr) >= 0) { in tuner_probe()
658 t->type = TUNER_TDA9887; in tuner_probe()
659 t->mode_mask = T_RADIO | T_ANALOG_TV; in tuner_probe()
665 t->i2c->adapter, t->i2c->addr) in tuner_probe()
667 t->type = TUNER_TEA5767; in tuner_probe()
668 t->mode_mask = T_RADIO; in tuner_probe()
670 tuner_lookup(t->i2c->adapter, &radio, &tv); in tuner_probe()
687 tuner_lookup(t->i2c->adapter, &radio, &tv); in tuner_probe()
689 t->mode_mask = T_ANALOG_TV; in tuner_probe()
691 t->mode_mask |= T_RADIO; in tuner_probe()
692 tuner_dbg("Setting mode_mask to 0x%02x\n", t->mode_mask); in tuner_probe()
698 t->pad.flags = MEDIA_PAD_FL_SOURCE; in tuner_probe()
699 t->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_TUNER; in tuner_probe()
700 t->sd.entity.name = t->name; in tuner_probe()
702 ret = media_entity_init(&t->sd.entity, 1, &t->pad, 0); in tuner_probe()
705 kfree(t); in tuner_probe()
710 if (t->mode_mask & T_ANALOG_TV) in tuner_probe()
711 t->mode = V4L2_TUNER_ANALOG_TV; in tuner_probe()
713 t->mode = V4L2_TUNER_RADIO; in tuner_probe()
714 set_type(client, t->type, t->mode_mask, t->config, t->fe.callback); in tuner_probe()
715 list_add_tail(&t->list, &tuner_list); in tuner_probe()
718 t->type, in tuner_probe()
719 t->mode_mask & T_RADIO ? " Radio" : "", in tuner_probe()
720 t->mode_mask & T_ANALOG_TV ? " TV" : ""); in tuner_probe()
732 struct tuner *t = to_tuner(i2c_get_clientdata(client)); in tuner_remove() local
734 v4l2_device_unregister_subdev(&t->sd); in tuner_remove()
735 tuner_detach(&t->fe); in tuner_remove()
736 t->fe.analog_demod_priv = NULL; in tuner_remove()
738 list_del(&t->list); in tuner_remove()
739 kfree(t); in tuner_remove()
765 static inline int check_mode(struct tuner *t, enum v4l2_tuner_type mode) in check_mode() argument
773 if ((t_mode & t->mode_mask) == 0) in check_mode()
788 static int set_mode(struct tuner *t, enum v4l2_tuner_type mode) in set_mode() argument
790 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_mode()
792 if (mode != t->mode) { in set_mode()
793 if (check_mode(t, mode) == -EINVAL) { in set_mode()
796 t->standby = true; in set_mode()
798 analog_ops->standby(&t->fe); in set_mode()
801 t->mode = mode; in set_mode()
812 static void set_freq(struct tuner *t, unsigned int freq) in set_freq() argument
814 struct i2c_client *client = v4l2_get_subdevdata(&t->sd); in set_freq()
816 if (t->mode == V4L2_TUNER_RADIO) { in set_freq()
818 freq = t->radio_freq; in set_freq()
822 freq = t->tv_freq; in set_freq()
839 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in set_tv_freq() local
840 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_tv_freq()
843 .mode = t->mode, in set_tv_freq()
844 .audmode = t->audmode, in set_tv_freq()
845 .std = t->std in set_tv_freq()
848 if (t->type == UNSET) { in set_tv_freq()
870 t->tv_freq = freq; in set_tv_freq()
871 t->standby = false; in set_tv_freq()
873 analog_ops->set_params(&t->fe, &params); in set_tv_freq()
890 static v4l2_std_id tuner_fixup_std(struct tuner *t, v4l2_std_id std) in tuner_fixup_std() argument
980 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in set_radio_freq() local
981 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in set_radio_freq()
984 .mode = t->mode, in set_radio_freq()
985 .audmode = t->audmode, in set_radio_freq()
986 .std = t->std in set_radio_freq()
989 if (t->type == UNSET) { in set_radio_freq()
1011 t->radio_freq = freq; in set_radio_freq()
1012 t->standby = false; in set_radio_freq()
1014 analog_ops->set_params(&t->fe, &params); in set_radio_freq()
1019 t->audmode = params.audmode; in set_radio_freq()
1035 struct tuner *t = fe->analog_demod_priv; in tuner_status() local
1041 switch (t->mode) { in tuner_status()
1053 if (t->mode == V4L2_TUNER_RADIO) { in tuner_status()
1054 freq = t->radio_freq / 16000; in tuner_status()
1055 freq_fraction = (t->radio_freq % 16000) * 100 / 16000; in tuner_status()
1057 freq = t->tv_freq / 16; in tuner_status()
1058 freq_fraction = (t->tv_freq % 16) * 100 / 16; in tuner_status()
1061 t->standby ? " on standby mode" : ""); in tuner_status()
1063 tuner_info("Standard: 0x%08lx\n", (unsigned long)t->std); in tuner_status()
1064 if (t->mode != V4L2_TUNER_RADIO) in tuner_status()
1069 fe_tuner_ops->get_status(&t->fe, &tuner_status); in tuner_status()
1089 struct tuner *t = to_tuner(sd); in tuner_s_radio() local
1091 if (set_mode(t, V4L2_TUNER_RADIO) == 0) in tuner_s_radio()
1092 set_freq(t, 0); in tuner_s_radio()
1107 struct tuner *t = to_tuner(sd); in tuner_s_power() local
1108 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_s_power()
1111 if (t->standby && set_mode(t, t->mode) == 0) { in tuner_s_power()
1113 set_freq(t, 0); in tuner_s_power()
1119 t->standby = true; in tuner_s_power()
1121 analog_ops->standby(&t->fe); in tuner_s_power()
1127 struct tuner *t = to_tuner(sd); in tuner_s_std() local
1129 if (set_mode(t, V4L2_TUNER_ANALOG_TV)) in tuner_s_std()
1132 t->std = tuner_fixup_std(t, std); in tuner_s_std()
1133 if (t->std != std) in tuner_s_std()
1134 tuner_dbg("Fixup standard %llx to %llx\n", std, t->std); in tuner_s_std()
1135 set_freq(t, 0); in tuner_s_std()
1141 struct tuner *t = to_tuner(sd); in tuner_s_frequency() local
1143 if (set_mode(t, f->type) == 0) in tuner_s_frequency()
1144 set_freq(t, f->frequency); in tuner_s_frequency()
1160 struct tuner *t = to_tuner(sd); in tuner_g_frequency() local
1161 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; in tuner_g_frequency()
1163 if (check_mode(t, f->type) == -EINVAL) in tuner_g_frequency()
1165 if (f->type == t->mode && fe_tuner_ops->get_frequency && !t->standby) { in tuner_g_frequency()
1168 fe_tuner_ops->get_frequency(&t->fe, &abs_freq); in tuner_g_frequency()
1169 f->frequency = (V4L2_TUNER_RADIO == t->mode) ? in tuner_g_frequency()
1174 t->radio_freq : t->tv_freq; in tuner_g_frequency()
1191 struct tuner *t = to_tuner(sd); in tuner_g_tuner() local
1192 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_g_tuner()
1193 struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops; in tuner_g_tuner()
1195 if (check_mode(t, vt->type) == -EINVAL) in tuner_g_tuner()
1197 if (vt->type == t->mode && analog_ops->get_afc) in tuner_g_tuner()
1198 analog_ops->get_afc(&t->fe, &vt->afc); in tuner_g_tuner()
1199 if (vt->type == t->mode && analog_ops->has_signal) { in tuner_g_tuner()
1202 if (!analog_ops->has_signal(&t->fe, &signal)) in tuner_g_tuner()
1213 if (vt->type == t->mode) { in tuner_g_tuner()
1218 fe_tuner_ops->get_status(&t->fe, &tuner_status); in tuner_g_tuner()
1224 vt->audmode = t->audmode; in tuner_g_tuner()
1244 struct tuner *t = to_tuner(sd); in tuner_s_tuner() local
1246 if (set_mode(t, vt->type)) in tuner_s_tuner()
1249 if (t->mode == V4L2_TUNER_RADIO) { in tuner_s_tuner()
1250 t->audmode = vt->audmode; in tuner_s_tuner()
1257 if (t->audmode != V4L2_TUNER_MODE_MONO && in tuner_s_tuner()
1258 t->audmode != V4L2_TUNER_MODE_STEREO) in tuner_s_tuner()
1259 t->audmode = V4L2_TUNER_MODE_STEREO; in tuner_s_tuner()
1261 set_freq(t, 0); in tuner_s_tuner()
1268 struct tuner *t = to_tuner(sd); in tuner_log_status() local
1269 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_log_status()
1272 analog_ops->tuner_status(&t->fe); in tuner_log_status()
1280 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in tuner_suspend() local
1281 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_suspend()
1285 if (t->fe.ops.tuner_ops.suspend) in tuner_suspend()
1286 t->fe.ops.tuner_ops.suspend(&t->fe); in tuner_suspend()
1287 else if (!t->standby && analog_ops->standby) in tuner_suspend()
1288 analog_ops->standby(&t->fe); in tuner_suspend()
1296 struct tuner *t = to_tuner(i2c_get_clientdata(c)); in tuner_resume() local
1300 if (t->fe.ops.tuner_ops.resume) in tuner_resume()
1301 t->fe.ops.tuner_ops.resume(&t->fe); in tuner_resume()
1302 else if (!t->standby) in tuner_resume()
1303 if (set_mode(t, t->mode) == 0) in tuner_resume()
1304 set_freq(t, 0); in tuner_resume()