162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * The Virtual DTV test driver serves as a reference DVB driver and helps
462306a36Sopenharmony_ci * validate the existing APIs in the media subsystem. It can also aid
562306a36Sopenharmony_ci * developers working on userspace applications.
662306a36Sopenharmony_ci *
762306a36Sopenharmony_ci * Copyright (C) 2020 Daniel W. S. Almeida
862306a36Sopenharmony_ci */
962306a36Sopenharmony_ci
1062306a36Sopenharmony_ci#ifndef VIDTV_TUNER_H
1162306a36Sopenharmony_ci#define VIDTV_TUNER_H
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci#include <linux/types.h>
1462306a36Sopenharmony_ci
1562306a36Sopenharmony_ci#include <media/dvb_frontend.h>
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#define NUM_VALID_TUNER_FREQS 8
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci/**
2062306a36Sopenharmony_ci * struct vidtv_tuner_config - Configuration used to init the tuner.
2162306a36Sopenharmony_ci * @fe: A pointer to the dvb_frontend structure allocated by vidtv_demod.
2262306a36Sopenharmony_ci * @mock_power_up_delay_msec: Simulate a power-up delay.
2362306a36Sopenharmony_ci * @mock_tune_delay_msec: Simulate a tune delay.
2462306a36Sopenharmony_ci * @vidtv_valid_dvb_t_freqs: The valid DVB-T frequencies to simulate.
2562306a36Sopenharmony_ci * @vidtv_valid_dvb_c_freqs: The valid DVB-C frequencies to simulate.
2662306a36Sopenharmony_ci * @vidtv_valid_dvb_s_freqs: The valid DVB-S frequencies to simulate.
2762306a36Sopenharmony_ci * @max_frequency_shift_hz: The maximum frequency shift in HZ allowed when
2862306a36Sopenharmony_ci * tuning in a channel
2962306a36Sopenharmony_ci *
3062306a36Sopenharmony_ci * The configuration used to init the tuner module, usually filled
3162306a36Sopenharmony_ci * by a bridge driver. For vidtv, this is filled by vidtv_bridge before the
3262306a36Sopenharmony_ci * tuner module is probed.
3362306a36Sopenharmony_ci */
3462306a36Sopenharmony_cistruct vidtv_tuner_config {
3562306a36Sopenharmony_ci	struct dvb_frontend *fe;
3662306a36Sopenharmony_ci	u32 mock_power_up_delay_msec;
3762306a36Sopenharmony_ci	u32 mock_tune_delay_msec;
3862306a36Sopenharmony_ci	u32 vidtv_valid_dvb_t_freqs[NUM_VALID_TUNER_FREQS];
3962306a36Sopenharmony_ci	u32 vidtv_valid_dvb_c_freqs[NUM_VALID_TUNER_FREQS];
4062306a36Sopenharmony_ci	u32 vidtv_valid_dvb_s_freqs[NUM_VALID_TUNER_FREQS];
4162306a36Sopenharmony_ci	u8  max_frequency_shift_hz;
4262306a36Sopenharmony_ci};
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci#endif //VIDTV_TUNER_H
45