1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * The Virtual DTV test driver serves as a reference DVB driver and helps
4  * validate the existing APIs in the media subsystem. It can also aid
5  * developers working on userspace applications.
6  *
7  * Copyright (C) 2020 Daniel W. S. Almeida
8  */
9 
10 #ifndef VIDTV_TUNER_H
11 #define VIDTV_TUNER_H
12 
13 #include <linux/types.h>
14 
15 #include <media/dvb_frontend.h>
16 
17 #define NUM_VALID_TUNER_FREQS 8
18 
19 /**
20  * struct vidtv_tuner_config - Configuration used to init the tuner.
21  * @fe: A pointer to the dvb_frontend structure allocated by vidtv_demod.
22  * @mock_power_up_delay_msec: Simulate a power-up delay.
23  * @mock_tune_delay_msec: Simulate a tune delay.
24  * @vidtv_valid_dvb_t_freqs: The valid DVB-T frequencies to simulate.
25  * @vidtv_valid_dvb_c_freqs: The valid DVB-C frequencies to simulate.
26  * @vidtv_valid_dvb_s_freqs: The valid DVB-S frequencies to simulate.
27  * @max_frequency_shift_hz: The maximum frequency shift in HZ allowed when
28  * tuning in a channel
29  *
30  * The configuration used to init the tuner module, usually filled
31  * by a bridge driver. For vidtv, this is filled by vidtv_bridge before the
32  * tuner module is probed.
33  */
34 struct vidtv_tuner_config {
35 	struct dvb_frontend *fe;
36 	u32 mock_power_up_delay_msec;
37 	u32 mock_tune_delay_msec;
38 	u32 vidtv_valid_dvb_t_freqs[NUM_VALID_TUNER_FREQS];
39 	u32 vidtv_valid_dvb_c_freqs[NUM_VALID_TUNER_FREQS];
40 	u32 vidtv_valid_dvb_s_freqs[NUM_VALID_TUNER_FREQS];
41 	u8  max_frequency_shift_hz;
42 };
43 
44 #endif //VIDTV_TUNER_H
45