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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * The Virtual DVB 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.
 *
 * Copyright (C) 2020 Daniel W. S. Almeida
 * Based on the example driver written by Emard <[email protected]>
 */

#include <linux/errno.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/printk.h>
#include <linux/random.h>
#include <linux/ratelimit.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/workqueue.h>

#include <media/dvb_frontend.h>

#include "vidtv_demod.h"

#define POLL_THRD_TIME

static const struct vidtv_demod_cnr_to_qual_s vidtv_demod_c_cnr_2_qual[] =;

static const struct vidtv_demod_cnr_to_qual_s vidtv_demod_s_cnr_2_qual[] =;

static const struct vidtv_demod_cnr_to_qual_s vidtv_demod_s2_cnr_2_qual[] =;

static const struct vidtv_demod_cnr_to_qual_s vidtv_demod_t_cnr_2_qual[] =;

static const struct vidtv_demod_cnr_to_qual_s *vidtv_match_cnr_s(struct dvb_frontend *fe)
{}

static void vidtv_clean_stats(struct dvb_frontend *fe)
{}

static void vidtv_demod_update_stats(struct dvb_frontend *fe)
{}

static int vidtv_demod_read_status(struct dvb_frontend *fe,
				   enum fe_status *status)
{}

static int vidtv_demod_read_signal_strength(struct dvb_frontend *fe,
					    u16 *strength)
{}

/*
 * NOTE:
 * This is implemented here just to be used as an example for real
 * demod drivers.
 *
 * Should only be implemented if it actually reads something from the hardware.
 * Also, it should check for the locks, in order to avoid report wrong data
 * to userspace.
 */
static int vidtv_demod_get_frontend(struct dvb_frontend *fe,
				    struct dtv_frontend_properties *p)
{}

static int vidtv_demod_set_frontend(struct dvb_frontend *fe)
{}

/*
 * NOTE:
 * This is implemented here just to be used as an example for real
 * demod drivers.
 *
 * Should only be implemented if the demod has support for DVB-S or DVB-S2
 */
static int vidtv_demod_set_tone(struct dvb_frontend *fe,
				enum fe_sec_tone_mode tone)
{}

/*
 * NOTE:
 * This is implemented here just to be used as an example for real
 * demod drivers.
 *
 * Should only be implemented if the demod has support for DVB-S or DVB-S2
 */
static int vidtv_demod_set_voltage(struct dvb_frontend *fe,
				   enum fe_sec_voltage voltage)
{}

/*
 * NOTE:
 * This is implemented here just to be used as an example for real
 * demod drivers.
 *
 * Should only be implemented if the demod has support for DVB-S or DVB-S2
 */
static int vidtv_send_diseqc_msg(struct dvb_frontend *fe,
				 struct dvb_diseqc_master_cmd *cmd)
{}

/*
 * NOTE:
 * This is implemented here just to be used as an example for real
 * demod drivers.
 *
 * Should only be implemented if the demod has support for DVB-S or DVB-S2
 */
static int vidtv_diseqc_send_burst(struct dvb_frontend *fe,
				   enum fe_sec_mini_cmd burst)
{}

static void vidtv_demod_release(struct dvb_frontend *fe)
{}

static const struct dvb_frontend_ops vidtv_demod_ops =;

static const struct i2c_device_id vidtv_demod_i2c_id_table[] =;
MODULE_DEVICE_TABLE(i2c, vidtv_demod_i2c_id_table);

static int vidtv_demod_i2c_probe(struct i2c_client *client)
{}

static void vidtv_demod_i2c_remove(struct i2c_client *client)
{}

static struct i2c_driver vidtv_demod_i2c_driver =;

module_i2c_driver();

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