linux/drivers/media/radio/si4713/radio-usb-si4713.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright 2013 Cisco Systems, Inc. and/or its affiliates.
 * All rights reserved.
 */

/* kernel includes */
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/mutex.h>
#include <linux/i2c.h>
/* V4l includes */
#include <linux/videodev2.h>
#include <media/v4l2-common.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include <linux/platform_data/media/si4713.h>

#include "si4713.h"

/* driver and module definitions */
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

/* The Device announces itself as Cygnal Integrated Products, Inc. */
#define USB_SI4713_VENDOR
#define USB_SI4713_PRODUCT

#define BUFFER_LENGTH
#define USB_TIMEOUT
#define USB_RESP_TIMEOUT

/* USB Device ID List */
static const struct usb_device_id usb_si4713_usb_device_table[] =;

MODULE_DEVICE_TABLE(usb, usb_si4713_usb_device_table);

struct si4713_usb_device {};

static inline struct si4713_usb_device *to_si4713_dev(struct v4l2_device *v4l2_dev)
{}

static int vidioc_querycap(struct file *file, void *priv,
					struct v4l2_capability *v)
{}

static int vidioc_g_modulator(struct file *file, void *priv,
				struct v4l2_modulator *vm)
{}

static int vidioc_s_modulator(struct file *file, void *priv,
				const struct v4l2_modulator *vm)
{}

static int vidioc_s_frequency(struct file *file, void *priv,
				const struct v4l2_frequency *vf)
{}

static int vidioc_g_frequency(struct file *file, void *priv,
				struct v4l2_frequency *vf)
{}

static const struct v4l2_ioctl_ops usb_si4713_ioctl_ops =;

/* File system interface */
static const struct v4l2_file_operations usb_si4713_fops =;

static void usb_si4713_video_device_release(struct v4l2_device *v4l2_dev)
{}

/*
 * This command sequence emulates the behaviour of the Windows driver.
 * The structure of these commands was determined by sniffing the
 * usb traffic of the device during startup.
 * Most likely, these commands make some queries to the device.
 * Commands are sent to enquire parameters like the bus mode,
 * component revision, boot mode, the device serial number etc.
 *
 * These commands are necessary to be sent in this order during startup.
 * The device fails to powerup if these commands are not sent.
 *
 * The complete list of startup commands is given in the start_seq table below.
 */
static int si4713_send_startup_command(struct si4713_usb_device *radio)
{}

struct si4713_start_seq_table {};

/*
 * Some of the startup commands that could be recognized are :
 * (0x03): Get serial number of the board (Response : CB000-00-00)
 * (0x06, 0x03, 0x03, 0x08, 0x01, 0x0f) : Get Component revision
 */
static const struct si4713_start_seq_table start_seq[] =;

static int si4713_start_seq(struct si4713_usb_device *radio)
{}

static struct i2c_board_info si4713_board_info =;

struct si4713_command_table {};

/*
 * Structure of a command :
 *	Byte 1 : 0x3f (always)
 *	Byte 2 : 0x06 (send a command)
 *	Byte 3 : Unknown
 *	Byte 4 : Number of arguments + 1 (for the command byte)
 *	Byte 5 : Number of response bytes
 */
static struct si4713_command_table command_table[] =;

static int send_command(struct si4713_usb_device *radio, u8 *payload, char *data, int len)
{}

static int si4713_i2c_read(struct si4713_usb_device *radio, char *data, int len)
{}

static int si4713_i2c_write(struct si4713_usb_device *radio, char *data, int len)
{}

static int si4713_transfer(struct i2c_adapter *i2c_adapter,
				struct i2c_msg *msgs, int num)
{}

static u32 si4713_functionality(struct i2c_adapter *adapter)
{}

static const struct i2c_algorithm si4713_algo =;

/* This name value shows up in the sysfs filename associated
		with this I2C adapter */
static const struct i2c_adapter si4713_i2c_adapter_template =;

static int si4713_register_i2c_adapter(struct si4713_usb_device *radio)
{}

/* check if the device is present and register with v4l and usb if it is */
static int usb_si4713_probe(struct usb_interface *intf,
				const struct usb_device_id *id)
{}

static void usb_si4713_disconnect(struct usb_interface *intf)
{}

/* USB subsystem interface */
static struct usb_driver usb_si4713_driver =;

module_usb_driver();