Lines Matching +full:switching +full:- +full:freq

1 // SPDX-License-Identifier: GPL-2.0-only
8 * Copyright(c) 2005-2011 by Mauro Carvalho Chehab
9 * - Added support for a separate Radio tuner
10 * - Major rework and cleanups at the code
31 #include <media/tuner-types.h>
32 #include <media/v4l2-device.h>
33 #include <media/v4l2-ioctl.h>
39 #include "tuner-simple.h"
45 #define UNSET (-1U)
64 static char pal[] = "--";
65 static char secam[] = "--";
66 static char ntsc[] = "-";
88 #define pr_fmt(fmt) KBUILD_MODNAME ": %d-%04x: " fmt, \
89 i2c_adapter_id(t->i2c->adapter), t->i2c->addr
102 * enum tuner_pad_index - tuner pad index for MEDIA_ENT_F_TUNER
109 * an Intermediate Frequency (IF) or to baseband (on zero-IF tuners).
131 * enum if_vid_dec_pad_index - video IF-PLL pad index
137 * IF-PLL video output source pad. Contains the video chrominance
140 * Number of pads of the video IF-PLL.
179 static void set_tv_freq(struct i2c_client *c, unsigned int freq);
180 static void set_radio_freq(struct i2c_client *c, unsigned int freq);
189 int __r = -EINVAL; \
203 if (fe->ops.tuner_ops.release) { in tuner_detach()
204 fe->ops.tuner_ops.release(fe); in tuner_detach()
205 symbol_put_addr(fe->ops.tuner_ops.release); in tuner_detach()
207 if (fe->ops.analog_ops.release) { in tuner_detach()
208 fe->ops.analog_ops.release(fe); in tuner_detach()
209 symbol_put_addr(fe->ops.analog_ops.release); in tuner_detach()
219 if (fe->ops.tuner_ops.release) in tuner_detach()
220 fe->ops.tuner_ops.release(fe); in tuner_detach()
221 if (fe->ops.analog_ops.release) in tuner_detach()
222 fe->ops.analog_ops.release(fe); in tuner_detach()
239 struct dvb_tuner_ops *fe_tuner_ops = &fe->ops.tuner_ops; in fe_set_params()
240 struct tuner *t = fe->analog_demod_priv; in fe_set_params()
242 if (NULL == fe_tuner_ops->set_analog_params) { in fe_set_params()
243 pr_warn("Tuner frontend module has no way to set freq\n"); in fe_set_params()
246 fe_tuner_ops->set_analog_params(fe, params); in fe_set_params()
251 struct dvb_tuner_ops *fe_tuner_ops = &fe->ops.tuner_ops; in fe_standby()
253 if (fe_tuner_ops->sleep) in fe_standby()
254 fe_tuner_ops->sleep(fe); in fe_standby()
259 struct dvb_tuner_ops *fe_tuner_ops = &fe->ops.tuner_ops; in fe_set_config()
260 struct tuner *t = fe->analog_demod_priv; in fe_set_config()
262 if (fe_tuner_ops->set_config) in fe_set_config()
263 return fe_tuner_ops->set_config(fe, priv_cfg); in fe_set_config()
284 * set_type - Sets the tuner type for a given device
291 * @tuner_callback: an optional function to be called when switching
295 * by tun_setup structure. It contains several per-tuner initialization "magic"
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()
308 dprintk("tuner 0x%02x: Tuner type absent\n", c->addr); 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()
455 if ((NULL == analog_ops->set_params) && in set_type()
456 (fe_tuner_ops->set_analog_params)) { in set_type()
458 t->name = fe_tuner_ops->info.name; in set_type()
460 t->fe.analog_demod_priv = t; in set_type()
464 if (fe_tuner_ops->get_rf_strength) in set_type()
465 analog_ops->has_signal = fe_tuner_ops->get_rf_strength; in set_type()
466 if (fe_tuner_ops->get_afc) in set_type()
467 analog_ops->get_afc = fe_tuner_ops->get_afc; 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()
495 c->adapter->name, c->dev.driver->name, c->addr << 1, type, 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()
507 * tuner_s_type_addr - Sets the tuner type for a device
527 tun_setup->type, in tuner_s_type_addr()
528 tun_setup->addr, in tuner_s_type_addr()
529 tun_setup->mode_mask, in tuner_s_type_addr()
530 tun_setup->config); in tuner_s_type_addr()
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()
534 (tun_setup->addr == c->addr)) { in tuner_s_type_addr()
535 set_type(c, tun_setup->type, tun_setup->mode_mask, in tuner_s_type_addr()
536 tun_setup->config, tun_setup->tuner_callback); in tuner_s_type_addr()
539 t->type, t->mode_mask, in tuner_s_type_addr()
540 tun_setup->addr, tun_setup->mode_mask); in tuner_s_type_addr()
546 * tuner_s_config - Sets tuner configuration
551 * Calls tuner set_config() private function to set some tuner-internal
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()
563 if (analog_ops->set_config) { in tuner_s_config()
564 analog_ops->set_config(&t->fe, cfg->priv); in tuner_s_config()
573 * tuner_lookup - Seek for tuner adapters
580 * discarding demod-only adapters (tda9887).
597 if (pos->i2c->adapter != adap || in tuner_lookup()
598 strcmp(pos->i2c->dev.driver->name, "tuner")) in tuner_lookup()
601 mode_mask = pos->mode_mask; in tuner_lookup()
604 /* Note: currently TDA9887 is the only demod-only in tuner_lookup()
607 else if (*tv == NULL && pos->type != TUNER_TDA9887 && in tuner_lookup()
608 (pos->mode_mask & T_ANALOG_TV)) in tuner_lookup()
614 *tuner_probe - Probes the existing tuners on an I2C bus
638 return -ENOMEM; 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()
660 switch (client->addr) { 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()
669 tv->mode_mask &= ~T_RADIO; in tuner_probe()
674 return -ENODEV; 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()
697 /* Sets freq to FM range */ in tuner_probe()
698 tuner_lookup(t->i2c->adapter, &radio, &tv); in tuner_probe()
700 tv->mode_mask &= ~T_RADIO; 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()
730 * IF-PLL demodulator (tda988x). 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()
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()
775 * tuner_remove - detaches a tuner
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()
796 * take care of switching between TV/Radio mode, filtering only the
801 * check_mode - Verify if tuner supports the requested mode
807 * tuner can't support that mode, it returns -EINVAL. Otherwise, it
824 if ((t_mode & t->mode_mask) == 0) in check_mode()
825 return -EINVAL; in check_mode()
831 * set_mode - Switch tuner to other mode.
836 * debug message and returns -EINVAL, changing its state to standby.
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()
848 if (analog_ops->standby) in set_mode()
849 analog_ops->standby(&t->fe); in set_mode()
850 return -EINVAL; in set_mode()
852 t->mode = mode; in set_mode()
859 * set_freq - Set the tuner to the desired frequency.
861 * @freq: frequency to set (0 means to use the current frequency)
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()
868 if (!freq) in set_freq()
869 freq = t->radio_freq; in set_freq()
870 set_radio_freq(client, freq); in set_freq()
872 if (!freq) in set_freq()
873 freq = t->tv_freq; in set_freq()
874 set_tv_freq(client, freq); in set_freq()
883 * set_tv_freq - Set tuner frequency, freq in Units of 62.5 kHz = 1/16MHz
886 * @freq: frequency
888 static void set_tv_freq(struct i2c_client *c, unsigned int freq) in set_tv_freq() argument
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()
903 if (NULL == analog_ops->set_params) { in set_tv_freq()
904 pr_warn("Tuner has no way to set tv freq\n"); in set_tv_freq()
907 if (freq < tv_range[0] * 16 || freq > tv_range[1] * 16) { in set_tv_freq()
908 dprintk("TV freq (%d.%02d) out of range (%d-%d)\n", in set_tv_freq()
909 freq / 16, freq % 16 * 100 / 16, tv_range[0], in set_tv_freq()
911 /* V4L2 spec: if the freq is not possible then the closest in set_tv_freq()
913 if (freq < tv_range[0] * 16) in set_tv_freq()
914 freq = tv_range[0] * 16; in set_tv_freq()
916 freq = tv_range[1] * 16; in set_tv_freq()
918 params.frequency = freq; in set_tv_freq()
919 dprintk("tv freq set to %d.%02d\n", in set_tv_freq()
920 freq / 16, freq % 16 * 100 / 16); 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()
928 * tuner_fixup_std - force a given video standard variant
934 * On other operational systems, the drivers generally have a per-country
935 * code, and some logic to apply per-country hacks. V4L2 API doesn't provide
943 if (pal[0] != '-' && (std & V4L2_STD_PAL) == V4L2_STD_PAL) { in tuner_fixup_std()
973 if (secam[0] != '-' && (std & V4L2_STD_SECAM) == V4L2_STD_SECAM) { in tuner_fixup_std()
1000 if (ntsc[0] != '-' && (std & V4L2_STD_NTSC) == V4L2_STD_NTSC) { in tuner_fixup_std()
1024 * set_radio_freq - Set tuner frequency, freq in Units of 62.5 Hz = 1/16kHz
1027 * @freq: frequency
1029 static void set_radio_freq(struct i2c_client *c, unsigned int freq) in set_radio_freq() argument
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()
1044 if (NULL == analog_ops->set_params) { in set_radio_freq()
1048 if (freq < radio_range[0] * 16000 || freq > radio_range[1] * 16000) { in set_radio_freq()
1049 dprintk("radio freq (%d.%02d) out of range (%d-%d)\n", in set_radio_freq()
1050 freq / 16000, freq % 16000 * 100 / 16000, in set_radio_freq()
1052 /* V4L2 spec: if the freq is not possible then the closest in set_radio_freq()
1054 if (freq < radio_range[0] * 16000) in set_radio_freq()
1055 freq = radio_range[0] * 16000; in set_radio_freq()
1057 freq = radio_range[1] * 16000; in set_radio_freq()
1059 params.frequency = freq; in set_radio_freq()
1060 dprintk("radio freq set to %d.%02d\n", in set_radio_freq()
1061 freq / 16000, freq % 16000 * 100 / 16000); 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()
1068 * supports stereo, so update t->audmode. in set_radio_freq()
1070 t->audmode = params.audmode; in set_radio_freq()
1078 * tuner_status - Dumps the current tuner status at dmesg
1086 struct tuner *t = fe->analog_demod_priv; in tuner_status()
1087 unsigned long freq, freq_fraction; in tuner_status() local
1088 struct dvb_tuner_ops *fe_tuner_ops = &fe->ops.tuner_ops; in tuner_status()
1089 struct analog_demod_ops *analog_ops = &fe->ops.analog_ops; in tuner_status()
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()
1113 pr_info("Frequency: %lu.%02lu MHz\n", freq, freq_fraction); 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()
1117 if (fe_tuner_ops->get_status) { in tuner_status()
1120 fe_tuner_ops->get_status(&t->fe, &tuner_status); in tuner_status()
1126 if (analog_ops->has_signal) { in tuner_status()
1129 if (!analog_ops->has_signal(fe, &signal)) in tuner_status()
1152 * tuner_standby - places the tuner in standby mode
1158 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_standby()
1161 t->standby = true; in tuner_standby()
1162 if (analog_ops->standby) in tuner_standby()
1163 analog_ops->standby(&t->fe); in tuner_standby()
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()
1185 if (set_mode(t, f->type) == 0) in tuner_s_frequency()
1186 set_freq(t, f->frequency); in tuner_s_frequency()
1191 * tuner_g_frequency - Get the tuned frequency for the tuner
1196 * if the tuner matches the f->type.
1197 * Note: f->type should be initialized before calling it.
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()
1215 f->frequency = (V4L2_TUNER_RADIO == f->type) ? in tuner_g_frequency()
1216 t->radio_freq : t->tv_freq; in tuner_g_frequency()
1222 * tuner_g_tuner - Fill in tuner information
1227 * if the tuner matches vt->type.
1228 * Note: vt->type should be initialized before calling it.
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()
1242 u16 signal = (u16)vt->signal; in tuner_g_tuner()
1244 if (!analog_ops->has_signal(&t->fe, &signal)) in tuner_g_tuner()
1245 vt->signal = signal; in tuner_g_tuner()
1247 if (vt->type != V4L2_TUNER_RADIO) { in tuner_g_tuner()
1248 vt->capability |= V4L2_TUNER_CAP_NORM; in tuner_g_tuner()
1249 vt->rangelow = tv_range[0] * 16; in tuner_g_tuner()
1250 vt->rangehigh = tv_range[1] * 16; in tuner_g_tuner()
1255 if (vt->type == t->mode) { in tuner_g_tuner()
1256 vt->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; in tuner_g_tuner()
1257 if (fe_tuner_ops->get_status) { in tuner_g_tuner()
1260 fe_tuner_ops->get_status(&t->fe, &tuner_status); in tuner_g_tuner()
1261 vt->rxsubchans = in tuner_g_tuner()
1266 vt->audmode = t->audmode; in tuner_g_tuner()
1268 vt->capability |= V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; in tuner_g_tuner()
1269 vt->rangelow = radio_range[0] * 16000; in tuner_g_tuner()
1270 vt->rangehigh = radio_range[1] * 16000; in tuner_g_tuner()
1276 * tuner_s_tuner - Set the tuner's audio mode
1280 * Sets the audio mode if the tuner matches vt->type.
1281 * Note: vt->type should be initialized before calling it.
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()
1311 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_log_status()
1313 if (analog_ops->tuner_status) in tuner_log_status()
1314 analog_ops->tuner_status(&t->fe); in tuner_log_status()
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()
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()
1356 /* TUNER_SET_CONFIG is still called by tuner-simple.c, so we have in tuner_command()
1363 return -ENOIOCTLCMD; in tuner_command()