124fb190eSDaniel W. S. Almeida /* SPDX-License-Identifier: GPL-2.0 */
224fb190eSDaniel W. S. Almeida /*
324fb190eSDaniel W. S. Almeida  * The Virtual DTV test driver serves as a reference DVB driver and helps
424fb190eSDaniel W. S. Almeida  * validate the existing APIs in the media subsystem. It can also aid
524fb190eSDaniel W. S. Almeida  * developers working on userspace applications.
624fb190eSDaniel W. S. Almeida  *
724fb190eSDaniel W. S. Almeida  * Copyright (C) 2020 Daniel W. S. Almeida
824fb190eSDaniel W. S. Almeida  */
924fb190eSDaniel W. S. Almeida 
1024fb190eSDaniel W. S. Almeida #ifndef VIDTV_TUNER_H
1124fb190eSDaniel W. S. Almeida #define VIDTV_TUNER_H
1224fb190eSDaniel W. S. Almeida 
1324fb190eSDaniel W. S. Almeida #include <linux/types.h>
1424fb190eSDaniel W. S. Almeida #include <media/dvb_frontend.h>
1524fb190eSDaniel W. S. Almeida 
1624fb190eSDaniel W. S. Almeida #define NUM_VALID_TUNER_FREQS 8
1724fb190eSDaniel W. S. Almeida 
1824fb190eSDaniel W. S. Almeida /**
1924fb190eSDaniel W. S. Almeida  * struct vidtv_tuner_config - Configuration used to init the tuner.
2024fb190eSDaniel W. S. Almeida  * @fe: A pointer to the dvb_frontend structure allocated by vidtv_demod.
2124fb190eSDaniel W. S. Almeida  * @mock_power_up_delay_msec: Simulate a power-up delay.
2224fb190eSDaniel W. S. Almeida  * @mock_tune_delay_msec: Simulate a tune delay.
2324fb190eSDaniel W. S. Almeida  * @vidtv_valid_dvb_t_freqs: The valid DVB-T frequencies to simulate.
2424fb190eSDaniel W. S. Almeida  * @vidtv_valid_dvb_c_freqs: The valid DVB-C frequencies to simulate.
2524fb190eSDaniel W. S. Almeida  * @vidtv_valid_dvb_s_freqs: The valid DVB-S frequencies to simulate.
2624fb190eSDaniel W. S. Almeida  * @max_frequency_shift_hz: The maximum frequency shift in HZ allowed when
2724fb190eSDaniel W. S. Almeida  * tuning in a channel
2824fb190eSDaniel W. S. Almeida  *
2924fb190eSDaniel W. S. Almeida  * The configuration used to init the tuner module, usually filled
3024fb190eSDaniel W. S. Almeida  * by a bridge driver. For vidtv, this is filled by vidtv_bridge before the
3124fb190eSDaniel W. S. Almeida  * tuner module is probed.
3224fb190eSDaniel W. S. Almeida  */
3324fb190eSDaniel W. S. Almeida struct vidtv_tuner_config {
3424fb190eSDaniel W. S. Almeida 	struct dvb_frontend *fe;
3524fb190eSDaniel W. S. Almeida 	u32 mock_power_up_delay_msec;
3624fb190eSDaniel W. S. Almeida 	u32 mock_tune_delay_msec;
3724fb190eSDaniel W. S. Almeida 	u32 vidtv_valid_dvb_t_freqs[NUM_VALID_TUNER_FREQS];
3824fb190eSDaniel W. S. Almeida 	u32 vidtv_valid_dvb_c_freqs[NUM_VALID_TUNER_FREQS];
3924fb190eSDaniel W. S. Almeida 	u32 vidtv_valid_dvb_s_freqs[NUM_VALID_TUNER_FREQS];
4024fb190eSDaniel W. S. Almeida 	u8  max_frequency_shift_hz;
4124fb190eSDaniel W. S. Almeida };
4224fb190eSDaniel W. S. Almeida 
4324fb190eSDaniel W. S. Almeida #endif //VIDTV_TUNER_H
44