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

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * driver/media/radio/radio-tea5764.c
 *
 * Driver for TEA5764 radio chip for linux 2.6.
 * This driver is for TEA5764 chip from NXP, used in EZX phones from Motorola.
 * The I2C protocol is used for communicate with chip.
 *
 * Based in radio-tea5761.c Copyright (C) 2005 Nokia Corporation
 *
 *  Copyright (c) 2008 Fabio Belavenuto <[email protected]>
 *
 * History:
 * 2008-12-06   Fabio Belavenuto <[email protected]>
 *              initial code
 *
 * TODO:
 *  add platform_data support for IRQs platform dependencies
 *  add RDS support
 */
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/init.h>			/* Initdata			*/
#include <linux/videodev2.h>		/* kernel radio structs		*/
#include <linux/i2c.h>			/* I2C				*/
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-event.h>

#define DRIVER_VERSION

#define DRIVER_AUTHOR
#define DRIVER_DESC

#define PINFO(format, ...)
#define PWARN(format, ...)
#define PDEBUG(format, ...)

/* Frequency limits in MHz -- these are European values.  For Japanese
devices, that would be 76000 and 91000.  */
#define FREQ_MIN
#define FREQ_MAX
#define FREQ_MUL

/* TEA5764 registers */
#define TEA5764_MANID
#define TEA5764_CHIPID

#define TEA5764_INTREG_BLMSK
#define TEA5764_INTREG_FRRMSK
#define TEA5764_INTREG_LEVMSK
#define TEA5764_INTREG_IFMSK
#define TEA5764_INTREG_BLMFLAG
#define TEA5764_INTREG_FRRFLAG
#define TEA5764_INTREG_LEVFLAG
#define TEA5764_INTREG_IFFLAG

#define TEA5764_FRQSET_SUD
#define TEA5764_FRQSET_SM

#define TEA5764_TNCTRL_PUPD1
#define TEA5764_TNCTRL_PUPD0
#define TEA5764_TNCTRL_BLIM
#define TEA5764_TNCTRL_SWPM
#define TEA5764_TNCTRL_IFCTC
#define TEA5764_TNCTRL_AFM
#define TEA5764_TNCTRL_SMUTE
#define TEA5764_TNCTRL_SNC
#define TEA5764_TNCTRL_MU
#define TEA5764_TNCTRL_SSL1
#define TEA5764_TNCTRL_SSL0
#define TEA5764_TNCTRL_HLSI
#define TEA5764_TNCTRL_MST
#define TEA5764_TNCTRL_SWP
#define TEA5764_TNCTRL_DTC
#define TEA5764_TNCTRL_AHLSI

#define TEA5764_TUNCHK_LEVEL(x)
#define TEA5764_TUNCHK_IFCNT(x)
#define TEA5764_TUNCHK_TUNTO
#define TEA5764_TUNCHK_LD
#define TEA5764_TUNCHK_STEREO

#define TEA5764_TESTREG_TRIGFR

struct tea5764_regs {} __attribute__ ((packed));

struct tea5764_write_regs {} __attribute__ ((packed));

#ifdef CONFIG_RADIO_TEA5764_XTAL
#define RADIO_TEA5764_XTAL
#else
#define RADIO_TEA5764_XTAL
#endif

static int radio_nr =;
static int use_xtal =;

struct tea5764_device {};

/* I2C code related */
static int tea5764_i2c_read(struct tea5764_device *radio)
{}

static int tea5764_i2c_write(struct tea5764_device *radio)
{}

static void tea5764_power_up(struct tea5764_device *radio)
{}

static void tea5764_power_down(struct tea5764_device *radio)
{}

static void tea5764_set_freq(struct tea5764_device *radio, int freq)
{}

static int tea5764_get_freq(struct tea5764_device *radio)
{}

/* tune an frequency, freq is defined by v4l's TUNER_LOW, i.e. 1/16th kHz */
static void tea5764_tune(struct tea5764_device *radio, int freq)
{}

static void tea5764_set_audout_mode(struct tea5764_device *radio, int audmode)
{}

static int tea5764_get_audout_mode(struct tea5764_device *radio)
{}

static void tea5764_mute(struct tea5764_device *radio, int on)
{}

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

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 int tea5764_s_ctrl(struct v4l2_ctrl *ctrl)
{}

static const struct v4l2_ctrl_ops tea5764_ctrl_ops =;

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

static const struct v4l2_ioctl_ops tea5764_ioctl_ops =;

/* V4L2 interface */
static const struct video_device tea5764_radio_template =;

/* I2C probe: check if the device exists and register with v4l if it is */
static int tea5764_i2c_probe(struct i2c_client *client)
{}

static void tea5764_i2c_remove(struct i2c_client *client)
{}

/* I2C subsystem interface */
static const struct i2c_device_id tea5764_id[] =;
MODULE_DEVICE_TABLE(i2c, tea5764_id);

static struct i2c_driver tea5764_i2c_driver =;

module_i2c_driver();

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

module_param(use_xtal, int, 0);
MODULE_PARM_DESC();
module_param(radio_nr, int, 0);
MODULE_PARM_DESC();