linux/drivers/media/radio/si470x/radio-si470x.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 *  drivers/media/radio/si470x/radio-si470x.h
 *
 *  Driver for radios with Silicon Labs Si470x FM Radio Receivers
 *
 *  Copyright (c) 2009 Tobias Lorenz <[email protected]>
 */


/* driver definitions */
#define DRIVER_NAME


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



/**************************************************************************
 * Register Definitions
 **************************************************************************/
#define RADIO_REGISTER_SIZE
#define RADIO_REGISTER_NUM
#define RDS_REGISTER_NUM

#define DEVICEID
#define DEVICEID_PN
#define DEVICEID_MFGID

#define SI_CHIPID
#define SI_CHIPID_REV
#define SI_CHIPID_DEV
#define SI_CHIPID_FIRMWARE

#define POWERCFG
#define POWERCFG_DSMUTE
#define POWERCFG_DMUTE
#define POWERCFG_MONO
#define POWERCFG_RDSM
#define POWERCFG_SKMODE
#define POWERCFG_SEEKUP
#define POWERCFG_SEEK
#define POWERCFG_DISABLE
#define POWERCFG_ENABLE

#define CHANNEL
#define CHANNEL_TUNE
#define CHANNEL_CHAN

#define SYSCONFIG1
#define SYSCONFIG1_RDSIEN
#define SYSCONFIG1_STCIEN
#define SYSCONFIG1_RDS
#define SYSCONFIG1_DE
#define SYSCONFIG1_AGCD
#define SYSCONFIG1_BLNDADJ
#define SYSCONFIG1_GPIO3
#define SYSCONFIG1_GPIO2
#define SYSCONFIG1_GPIO2_DIS
#define SYSCONFIG1_GPIO2_INT
#define SYSCONFIG1_GPIO1

#define SYSCONFIG2
#define SYSCONFIG2_SEEKTH
#define SYSCONFIG2_BAND
#define SYSCONFIG2_SPACE
#define SYSCONFIG2_VOLUME

#define SYSCONFIG3
#define SYSCONFIG3_SMUTER
#define SYSCONFIG3_SMUTEA
#define SYSCONFIG3_SKSNR
#define SYSCONFIG3_SKCNT

#define TEST1
#define TEST1_AHIZEN

#define TEST2
/* TEST2 only contains reserved bits */

#define BOOTCONFIG
/* BOOTCONFIG only contains reserved bits */

#define STATUSRSSI
#define STATUSRSSI_RDSR
#define STATUSRSSI_STC
#define STATUSRSSI_SF
#define STATUSRSSI_AFCRL
#define STATUSRSSI_RDSS
#define STATUSRSSI_BLERA
#define STATUSRSSI_ST
#define STATUSRSSI_RSSI

#define READCHAN
#define READCHAN_BLERB
#define READCHAN_BLERC
#define READCHAN_BLERD
#define READCHAN_READCHAN

#define RDSA
#define RDSA_RDSA

#define RDSB
#define RDSB_RDSB

#define RDSC
#define RDSC_RDSC

#define RDSD
#define RDSD_RDSD



/**************************************************************************
 * General Driver Definitions
 **************************************************************************/

/*
 * si470x_device - private data
 */
struct si470x_device {};



/**************************************************************************
 * Firmware Versions
 **************************************************************************/

#define RADIO_FW_VERSION



/**************************************************************************
 * Frequency Multiplicator
 **************************************************************************/

/*
 * The frequency is set in units of 62.5 Hz when using V4L2_TUNER_CAP_LOW,
 * 62.5 kHz otherwise.
 * The tuner is able to have a channel spacing of 50, 100 or 200 kHz.
 * tuner->capability is therefore set to V4L2_TUNER_CAP_LOW
 * The FREQ_MUL is then: 1 MHz / 62.5 Hz = 16000
 */
#define FREQ_MUL



/**************************************************************************
 * Common Functions
 **************************************************************************/
extern const struct video_device si470x_viddev_template;
extern const struct v4l2_ctrl_ops si470x_ctrl_ops;
int si470x_disconnect_check(struct si470x_device *radio);
int si470x_set_freq(struct si470x_device *radio, unsigned int freq);
int si470x_start(struct si470x_device *radio);
int si470x_stop(struct si470x_device *radio);