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>
38 #include "tuner-xc2028.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
640 return -ENOMEM; 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()
662 switch (client->addr) { 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()
671 tv->mode_mask &= ~T_RADIO; in tuner_probe()
676 return -ENODEV; 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()
699 /* Sets freq to FM range */ in tuner_probe()
700 tuner_lookup(t->i2c->adapter, &radio, &tv); in tuner_probe()
702 tv->mode_mask &= ~T_RADIO; 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()
732 * IF-PLL demodulator (tda988x). 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()
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()
777 * tuner_remove - detaches a tuner
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()
799 * take care of switching between TV/Radio mode, filtering only the
804 * check_mode - Verify if tuner supports the requested mode
810 * tuner can't support that mode, it returns -EINVAL. Otherwise, it
827 if ((t_mode & t->mode_mask) == 0) in check_mode()
828 return -EINVAL; in check_mode()
834 * set_mode - Switch tuner to other mode.
839 * debug message and returns -EINVAL, changing its state to standby.
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()
851 if (analog_ops->standby) in set_mode()
852 analog_ops->standby(&t->fe); in set_mode()
853 return -EINVAL; in set_mode()
855 t->mode = mode; in set_mode()
862 * set_freq - Set the tuner to the desired frequency.
864 * @freq: frequency to set (0 means to use the current frequency)
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()
871 if (!freq) in set_freq()
872 freq = t->radio_freq; in set_freq()
873 set_radio_freq(client, freq); in set_freq()
875 if (!freq) in set_freq()
876 freq = t->tv_freq; in set_freq()
877 set_tv_freq(client, freq); in set_freq()
886 * set_tv_freq - Set tuner frequency, freq in Units of 62.5 kHz = 1/16MHz
889 * @freq: frequency
891 static void set_tv_freq(struct i2c_client *c, unsigned int freq) in set_tv_freq() argument
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()
906 if (NULL == analog_ops->set_params) { in set_tv_freq()
907 pr_warn("Tuner has no way to set tv freq\n"); in set_tv_freq()
910 if (freq < tv_range[0] * 16 || freq > tv_range[1] * 16) { in set_tv_freq()
911 dprintk("TV freq (%d.%02d) out of range (%d-%d)\n", in set_tv_freq()
912 freq / 16, freq % 16 * 100 / 16, tv_range[0], in set_tv_freq()
914 /* V4L2 spec: if the freq is not possible then the closest in set_tv_freq()
916 if (freq < tv_range[0] * 16) in set_tv_freq()
917 freq = tv_range[0] * 16; in set_tv_freq()
919 freq = tv_range[1] * 16; in set_tv_freq()
921 params.frequency = freq; in set_tv_freq()
922 dprintk("tv freq set to %d.%02d\n", in set_tv_freq()
923 freq / 16, freq % 16 * 100 / 16); 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()
931 * tuner_fixup_std - force a given video standard variant
937 * On other operational systems, the drivers generally have a per-country
938 * code, and some logic to apply per-country hacks. V4L2 API doesn't provide
946 if (pal[0] != '-' && (std & V4L2_STD_PAL) == V4L2_STD_PAL) { in tuner_fixup_std()
976 if (secam[0] != '-' && (std & V4L2_STD_SECAM) == V4L2_STD_SECAM) { in tuner_fixup_std()
1003 if (ntsc[0] != '-' && (std & V4L2_STD_NTSC) == V4L2_STD_NTSC) { in tuner_fixup_std()
1027 * set_radio_freq - Set tuner frequency, freq in Units of 62.5 Hz = 1/16kHz
1030 * @freq: frequency
1032 static void set_radio_freq(struct i2c_client *c, unsigned int freq) in set_radio_freq() argument
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()
1047 if (NULL == analog_ops->set_params) { in set_radio_freq()
1051 if (freq < radio_range[0] * 16000 || freq > radio_range[1] * 16000) { in set_radio_freq()
1052 dprintk("radio freq (%d.%02d) out of range (%d-%d)\n", in set_radio_freq()
1053 freq / 16000, freq % 16000 * 100 / 16000, in set_radio_freq()
1055 /* V4L2 spec: if the freq is not possible then the closest in set_radio_freq()
1057 if (freq < radio_range[0] * 16000) in set_radio_freq()
1058 freq = radio_range[0] * 16000; in set_radio_freq()
1060 freq = radio_range[1] * 16000; in set_radio_freq()
1062 params.frequency = freq; in set_radio_freq()
1063 dprintk("radio freq set to %d.%02d\n", in set_radio_freq()
1064 freq / 16000, freq % 16000 * 100 / 16000); 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()
1071 * supports stereo, so update t->audmode. in set_radio_freq()
1073 t->audmode = params.audmode; in set_radio_freq()
1081 * tuner_status - Dumps the current tuner status at dmesg
1089 struct tuner *t = fe->analog_demod_priv; in tuner_status()
1090 unsigned long freq, freq_fraction; in tuner_status() local
1091 struct dvb_tuner_ops *fe_tuner_ops = &fe->ops.tuner_ops; in tuner_status()
1092 struct analog_demod_ops *analog_ops = &fe->ops.analog_ops; in tuner_status()
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()
1116 pr_info("Frequency: %lu.%02lu MHz\n", freq, freq_fraction); 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()
1120 if (fe_tuner_ops->get_status) { in tuner_status()
1123 fe_tuner_ops->get_status(&t->fe, &tuner_status); in tuner_status()
1129 if (analog_ops->has_signal) { in tuner_status()
1132 if (!analog_ops->has_signal(fe, &signal)) in tuner_status()
1155 * tuner_standby - places the tuner in standby mode
1161 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_standby()
1164 t->standby = true; in tuner_standby()
1165 if (analog_ops->standby) in tuner_standby()
1166 analog_ops->standby(&t->fe); in tuner_standby()
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()
1188 if (set_mode(t, f->type) == 0) in tuner_s_frequency()
1189 set_freq(t, f->frequency); in tuner_s_frequency()
1194 * tuner_g_frequency - Get the tuned frequency for the tuner
1199 * if the tuner matches the f->type.
1200 * Note: f->type should be initialized before calling it.
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()
1218 f->frequency = (V4L2_TUNER_RADIO == f->type) ? in tuner_g_frequency()
1219 t->radio_freq : t->tv_freq; in tuner_g_frequency()
1225 * tuner_g_tuner - Fill in tuner information
1230 * if the tuner matches vt->type.
1231 * Note: vt->type should be initialized before calling it.
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()
1245 u16 signal = (u16)vt->signal; in tuner_g_tuner()
1247 if (!analog_ops->has_signal(&t->fe, &signal)) in tuner_g_tuner()
1248 vt->signal = signal; in tuner_g_tuner()
1250 if (vt->type != V4L2_TUNER_RADIO) { in tuner_g_tuner()
1251 vt->capability |= V4L2_TUNER_CAP_NORM; in tuner_g_tuner()
1252 vt->rangelow = tv_range[0] * 16; in tuner_g_tuner()
1253 vt->rangehigh = tv_range[1] * 16; in tuner_g_tuner()
1258 if (vt->type == t->mode) { in tuner_g_tuner()
1259 vt->rxsubchans = V4L2_TUNER_SUB_MONO | V4L2_TUNER_SUB_STEREO; in tuner_g_tuner()
1260 if (fe_tuner_ops->get_status) { in tuner_g_tuner()
1263 fe_tuner_ops->get_status(&t->fe, &tuner_status); in tuner_g_tuner()
1264 vt->rxsubchans = in tuner_g_tuner()
1269 vt->audmode = t->audmode; in tuner_g_tuner()
1271 vt->capability |= V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; in tuner_g_tuner()
1272 vt->rangelow = radio_range[0] * 16000; in tuner_g_tuner()
1273 vt->rangehigh = radio_range[1] * 16000; in tuner_g_tuner()
1279 * tuner_s_tuner - Set the tuner's audio mode
1283 * Sets the audio mode if the tuner matches vt->type.
1284 * Note: vt->type should be initialized before calling it.
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()
1314 struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops; in tuner_log_status()
1316 if (analog_ops->tuner_status) in tuner_log_status()
1317 analog_ops->tuner_status(&t->fe); in tuner_log_status()
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()
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()
1359 /* TUNER_SET_CONFIG is still called by tuner-simple.c, so we have in tuner_command()
1366 return -ENOIOCTLCMD; in tuner_command()