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

// SPDX-License-Identifier: GPL-2.0-only
/*
 * GemTek radio card driver
 *
 * Copyright 1998 Jonas Munsin <[email protected]>
 *
 * GemTek hasn't released any specs on the card, so the protocol had to
 * be reverse engineered with dosemu.
 *
 * Besides the protocol changes, this is mostly a copy of:
 *
 *    RadioTrack II driver for Linux radio support (C) 1998 Ben Pfaff
 *
 *    Based on RadioTrack I/RadioReveal (C) 1997 M. Kirkwood
 *    Converted to new API by Alan Cox <[email protected]>
 *    Various bugfixes and enhancements by Russell Kroll <[email protected]>
 *
 * Converted to the radio-isa framework by Hans Verkuil <[email protected]>
 * Converted to V4L2 API by Mauro Carvalho Chehab <[email protected]>
 *
 * Note: this card seems to swap the left and right audio channels!
 *
 * Fully tested with the Keene USB FM Transmitter and the v4l2-compliance tool.
 */

#include <linux/module.h>	/* Modules			*/
#include <linux/init.h>		/* Initdata			*/
#include <linux/ioport.h>	/* request_region		*/
#include <linux/delay.h>	/* udelay			*/
#include <linux/videodev2.h>	/* kernel radio structs		*/
#include <linux/mutex.h>
#include <linux/io.h>		/* outb, outb_p			*/
#include <linux/pnp.h>
#include <linux/slab.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-device.h>
#include "radio-isa.h"

/*
 * Module info.
 */

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

/*
 * Module params.
 */

#ifndef CONFIG_RADIO_GEMTEK_PORT
#define CONFIG_RADIO_GEMTEK_PORT
#endif
#ifndef CONFIG_RADIO_GEMTEK_PROBE
#define CONFIG_RADIO_GEMTEK_PROBE
#endif

#define GEMTEK_MAX

static bool probe =;
static bool hardmute;
static int io[GEMTEK_MAX] =;
static int radio_nr[GEMTEK_MAX]	=;

module_param(probe, bool, 0444);
MODULE_PARM_DESC();

module_param(hardmute, bool, 0644);
MODULE_PARM_DESC();

module_param_array();
MODULE_PARM_DESC();

module_param_array();
MODULE_PARM_DESC();

/*
 * Frequency calculation constants.  Intermediate frequency 10.52 MHz (nominal
 * value 10.7 MHz), reference divisor 6.39 kHz (nominal 6.25 kHz).
 */
#define FSCALE
#define IF_OFFSET
#define REF_FREQ

#define GEMTEK_CK
#define GEMTEK_DA
#define GEMTEK_CE
#define GEMTEK_NS
#define GEMTEK_MT
#define GEMTEK_STDF_3_125_KHZ
#define GEMTEK_PLL_OFF

#define BU2614_BUS_SIZE

#define SHORT_DELAY
#define LONG_DELAY

struct gemtek {};

#define BU2614_FREQ_BITS
#define BU2614_PORT_BITS
#define BU2614_VOID_BITS
#define BU2614_FMES_BITS
#define BU2614_STDF_BITS
#define BU2614_SWIN_BITS
#define BU2614_SWAL_BITS
#define BU2614_VOID2_BITS
#define BU2614_FMUN_BITS
#define BU2614_TEST_BITS

#define BU2614_FREQ_SHIFT
#define BU2614_PORT_SHIFT
#define BU2614_VOID_SHIFT
#define BU2614_FMES_SHIFT
#define BU2614_STDF_SHIFT
#define BU2614_SWIN_SHIFT
#define BU2614_SWAL_SHIFT
#define BU2614_VOID2_SHIFT
#define BU2614_FMUN_SHIFT
#define BU2614_TEST_SHIFT

#define MKMASK(field)
#define BU2614_PORT_MASK
#define BU2614_FREQ_MASK
#define BU2614_VOID_MASK
#define BU2614_FMES_MASK
#define BU2614_STDF_MASK
#define BU2614_SWIN_MASK
#define BU2614_SWAL_MASK
#define BU2614_VOID2_MASK
#define BU2614_FMUN_MASK
#define BU2614_TEST_MASK

/*
 * Set data which will be sent to BU2614FS.
 */
#define gemtek_bu2614_set(dev, field, data)

/*
 * Transmit settings to BU2614FS over GemTek IC.
 */
static void gemtek_bu2614_transmit(struct gemtek *gt)
{}

/*
 * Calculate divisor from FM-frequency for BU2614FS (3.125 KHz STDF expected).
 */
static unsigned long gemtek_convfreq(unsigned long freq)
{}

static struct radio_isa_card *gemtek_alloc(void)
{}

/*
 * Set FM-frequency.
 */
static int gemtek_s_frequency(struct radio_isa_card *isa, u32 freq)
{}

/*
 * Set mute flag.
 */
static int gemtek_s_mute_volume(struct radio_isa_card *isa, bool mute, int vol)
{}

static u32 gemtek_g_rxsubchans(struct radio_isa_card *isa)
{}

/*
 * Check if requested card acts like GemTek Radio card.
 */
static bool gemtek_probe(struct radio_isa_card *isa, int io)
{}

static const struct radio_isa_ops gemtek_ops =;

static const int gemtek_ioports[] =;

#ifdef CONFIG_PNP
static const struct pnp_device_id gemtek_pnp_devices[] =;

MODULE_DEVICE_TABLE(pnp, gemtek_pnp_devices);
#endif

static struct radio_isa_driver gemtek_driver =;

static int __init gemtek_init(void)
{}

static void __exit gemtek_exit(void)
{}

module_init();
module_exit(gemtek_exit);