linux/drivers/media/test-drivers/vidtv/vidtv_bridge.c

// SPDX-License-Identifier: GPL-2.0
/*
 * The Virtual DTV test driver serves as a reference DVB driver and helps
 * validate the existing APIs in the media subsystem. It can also aid
 * developers working on userspace applications.
 *
 * When this module is loaded, it will attempt to modprobe 'dvb_vidtv_tuner'
 * and 'dvb_vidtv_demod'.
 *
 * Copyright (C) 2020 Daniel W. S. Almeida
 */

#include <linux/dev_printk.h>
#include <linux/moduleparam.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/time.h>
#include <linux/types.h>
#include <linux/workqueue.h>
#include <media/dvbdev.h>
#include <media/media-device.h>

#include "vidtv_bridge.h"
#include "vidtv_common.h"
#include "vidtv_demod.h"
#include "vidtv_mux.h"
#include "vidtv_ts.h"
#include "vidtv_tuner.h"

#define MUX_BUF_MIN_SZ
#define MUX_BUF_MAX_SZ
#define TUNER_DEFAULT_ADDR
#define DEMOD_DEFAULT_ADDR
#define VIDTV_DEFAULT_NETWORK_ID
#define VIDTV_DEFAULT_NETWORK_NAME
#define VIDTV_DEFAULT_TS_ID

/*
 * The LNBf fake parameters here are the ranges used by an
 * Universal (extended) European LNBf, which is likely the most common LNBf
 * found on Satellite digital TV system nowadays.
 */
#define LNB_CUT_FREQUENCY
#define LNB_LOW_FREQ
#define LNB_HIGH_FREQ

static unsigned int drop_tslock_prob_on_low_snr;
module_param(drop_tslock_prob_on_low_snr, uint, 0444);
MODULE_PARM_DESC();

static unsigned int recover_tslock_prob_on_good_snr;
module_param(recover_tslock_prob_on_good_snr, uint, 0444);
MODULE_PARM_DESC();

static unsigned int mock_power_up_delay_msec;
module_param(mock_power_up_delay_msec, uint, 0444);
MODULE_PARM_DESC();

static unsigned int mock_tune_delay_msec;
module_param(mock_tune_delay_msec, uint, 0444);
MODULE_PARM_DESC();

static unsigned int vidtv_valid_dvb_t_freqs[NUM_VALID_TUNER_FREQS] =;

module_param_array();
MODULE_PARM_DESC();

static unsigned int vidtv_valid_dvb_c_freqs[NUM_VALID_TUNER_FREQS] =;

module_param_array();
MODULE_PARM_DESC();

static unsigned int vidtv_valid_dvb_s_freqs[NUM_VALID_TUNER_FREQS] =;
module_param_array();
MODULE_PARM_DESC();

static unsigned int max_frequency_shift_hz;
module_param(max_frequency_shift_hz, uint, 0444);
MODULE_PARM_DESC();

DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nums);

/*
 * Influences the signal acquisition time. See ISO/IEC 13818-1 : 2000. p. 113.
 */
static unsigned int si_period_msec =;
module_param(si_period_msec, uint, 0444);
MODULE_PARM_DESC();

static unsigned int pcr_period_msec =;
module_param(pcr_period_msec, uint, 0444);
MODULE_PARM_DESC();

static unsigned int mux_rate_kbytes_sec =;
module_param(mux_rate_kbytes_sec, uint, 0444);
MODULE_PARM_DESC();

static unsigned int pcr_pid =;
module_param(pcr_pid, uint, 0444);
MODULE_PARM_DESC();

static unsigned int mux_buf_sz_pkts;
module_param(mux_buf_sz_pkts, uint, 0444);
MODULE_PARM_DESC();

static u32 vidtv_bridge_mux_buf_sz_for_mux_rate(void)
{}

static bool vidtv_bridge_check_demod_lock(struct vidtv_dvb *dvb, u32 n)
{}

/*
 * called on a separate thread by the mux when new packets become available
 */
static void vidtv_bridge_on_new_pkts_avail(void *priv, u8 *buf, u32 npkts)
{}

static int vidtv_start_streaming(struct vidtv_dvb *dvb)
{}

static int vidtv_stop_streaming(struct vidtv_dvb *dvb)
{}

static int vidtv_start_feed(struct dvb_demux_feed *feed)
{}

static int vidtv_stop_feed(struct dvb_demux_feed *feed)
{}

static struct dvb_frontend *vidtv_get_frontend_ptr(struct i2c_client *c)
{}

static int vidtv_master_xfer(struct i2c_adapter *i2c_adap,
			     struct i2c_msg msgs[],
			     int num)
{}

static u32 vidtv_i2c_func(struct i2c_adapter *adapter)
{}

static const struct i2c_algorithm vidtv_i2c_algorithm =;

static int vidtv_bridge_i2c_register_adap(struct vidtv_dvb *dvb)
{}

static int vidtv_bridge_register_adap(struct vidtv_dvb *dvb)
{}

static int vidtv_bridge_dmx_init(struct vidtv_dvb *dvb)
{}

static int vidtv_bridge_dmxdev_init(struct vidtv_dvb *dvb)
{}

static int vidtv_bridge_probe_demod(struct vidtv_dvb *dvb, u32 n)
{}

static int vidtv_bridge_probe_tuner(struct vidtv_dvb *dvb, u32 n)
{}

static int vidtv_bridge_dvb_init(struct vidtv_dvb *dvb)
{}

static int vidtv_bridge_probe(struct platform_device *pdev)
{}

static void vidtv_bridge_remove(struct platform_device *pdev)
{}

static void vidtv_bridge_dev_release(struct device *dev)
{}

static struct platform_device vidtv_bridge_dev =;

static struct platform_driver vidtv_bridge_driver =;

static void __exit vidtv_bridge_exit(void)
{}

static int __init vidtv_bridge_init(void)
{}

module_init();
module_exit(vidtv_bridge_exit);

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_ALIAS();
MODULE_ALIAS();