linux/drivers/media/radio/radio-raremono.c

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

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/input.h>
#include <linux/usb.h>
#include <linux/hid.h>
#include <linux/mutex.h>
#include <linux/videodev2.h>
#include <asm/unaligned.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-event.h>

/*
 * 'Thanko's Raremono' is a Japanese si4734-based AM/FM/SW USB receiver:
 *
 * http://www.raremono.jp/product/484.html/
 *
 * The USB protocol has been reversed engineered using wireshark, initially
 * by Dinesh Ram <[email protected]> and finished by Hans Verkuil
 * <[email protected]>.
 *
 * Sadly the firmware used in this product hides lots of goodies since the
 * si4734 has more features than are supported by the firmware. Oh well...
 */

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

/*
 * The Device announces itself as Cygnal Integrated Products, Inc.
 *
 * The vendor and product IDs (and in fact all other lsusb information as
 * well) are identical to the si470x Silicon Labs USB FM Radio Reference
 * Design board, even though this card has a si4734 device. Clearly the
 * designer of this product never bothered to change the USB IDs.
 */

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

MODULE_DEVICE_TABLE(usb, usb_raremono_device_table);

#define BUFFER_LENGTH

/* Timeout is set to a high value, could probably be reduced. Need more tests */
#define USB_TIMEOUT

/* Frequency limits in KHz */
#define FM_FREQ_RANGE_LOW
#define FM_FREQ_RANGE_HIGH

#define AM_FREQ_RANGE_LOW
#define AM_FREQ_RANGE_HIGH

#define SW_FREQ_RANGE_LOW
#define SW_FREQ_RANGE_HIGH

enum {};

static const struct v4l2_frequency_band bands[] =;

struct raremono_device {};

static inline struct raremono_device *to_raremono_dev(struct v4l2_device *v4l2_dev)
{}

/* Set frequency. */
static int raremono_cmd_main(struct raremono_device *radio, unsigned band, unsigned freq)
{}

/* Handle unplugging the device.
 * We call video_unregister_device in any case.
 * The last function called in this procedure is
 * usb_raremono_device_release.
 */
static void usb_raremono_disconnect(struct usb_interface *intf)
{}

/*
 * Linux Video interface
 */
static int vidioc_querycap(struct file *file, void *priv,
					struct v4l2_capability *v)
{}

static int vidioc_enum_freq_bands(struct file *file, void *priv,
		struct v4l2_frequency_band *band)
{}

static int vidioc_g_tuner(struct file *file, void *priv,
		struct v4l2_tuner *v)
{}

static int vidioc_s_tuner(struct file *file, void *priv,
					const struct v4l2_tuner *v)
{}

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

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

static void raremono_device_release(struct v4l2_device *v4l2_dev)
{}

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

static const struct v4l2_ioctl_ops usb_raremono_ioctl_ops =;

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

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

module_usb_driver();