#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/interrupt.h>
#include <linux/mfd/wl1273-core.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#define DRIVER_DESC …
#define WL1273_POWER_SET_OFF …
#define WL1273_POWER_SET_FM …
#define WL1273_POWER_SET_RDS …
#define WL1273_POWER_SET_RETENTION …
#define WL1273_PUPD_SET_OFF …
#define WL1273_PUPD_SET_ON …
#define WL1273_PUPD_SET_RETENTION …
#define WL1273_FREQ(x) …
#define WL1273_INV_FREQ(x) …
static int radio_nr;
module_param(radio_nr, int, 0);
MODULE_PARM_DESC(…) …;
struct wl1273_device { … };
#define WL1273_IRQ_MASK …
static unsigned int rds_buf = …;
module_param(rds_buf, uint, 0);
MODULE_PARM_DESC(…) …;
static int wl1273_fm_write_fw(struct wl1273_core *core,
__u8 *fw, int len)
{ … }
#define WL1273_FIFO_HAS_DATA(status) …
#define WL1273_RDS_CORRECTABLE_ERROR …
#define WL1273_RDS_UNCORRECTABLE_ERROR …
static int wl1273_fm_rds(struct wl1273_device *radio)
{ … }
static irqreturn_t wl1273_fm_irq_thread_handler(int irq, void *dev_id)
{ … }
static int wl1273_fm_set_tx_freq(struct wl1273_device *radio, unsigned int freq)
{ … }
static int wl1273_fm_set_rx_freq(struct wl1273_device *radio, unsigned int freq)
{ … }
static int wl1273_fm_get_freq(struct wl1273_device *radio)
{ … }
static int wl1273_fm_upload_firmware_patch(struct wl1273_device *radio)
{ … }
static int wl1273_fm_stop(struct wl1273_device *radio)
{ … }
static int wl1273_fm_start(struct wl1273_device *radio, int new_mode)
{ … }
static int wl1273_fm_suspend(struct wl1273_device *radio)
{ … }
static int wl1273_fm_set_mode(struct wl1273_device *radio, int mode)
{ … }
static int wl1273_fm_set_seek(struct wl1273_device *radio,
unsigned int wrap_around,
unsigned int seek_upward,
int level)
{ … }
static unsigned int wl1273_fm_get_tx_ctune(struct wl1273_device *radio)
{ … }
static int wl1273_fm_set_preemphasis(struct wl1273_device *radio,
unsigned int preemphasis)
{ … }
static int wl1273_fm_rds_on(struct wl1273_device *radio)
{ … }
static int wl1273_fm_rds_off(struct wl1273_device *radio)
{ … }
static int wl1273_fm_set_rds(struct wl1273_device *radio, unsigned int new_mode)
{ … }
static ssize_t wl1273_fm_fops_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{ … }
static __poll_t wl1273_fm_fops_poll(struct file *file,
struct poll_table_struct *pts)
{ … }
static int wl1273_fm_fops_open(struct file *file)
{ … }
static int wl1273_fm_fops_release(struct file *file)
{ … }
static ssize_t wl1273_fm_fops_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
static const struct v4l2_file_operations wl1273_fops = …;
static int wl1273_fm_vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *capability)
{ … }
static int wl1273_fm_vidioc_g_input(struct file *file, void *priv,
unsigned int *i)
{ … }
static int wl1273_fm_vidioc_s_input(struct file *file, void *priv,
unsigned int i)
{ … }
static int wl1273_fm_set_tx_power(struct wl1273_device *radio, u16 power)
{ … }
#define WL1273_SPACING_50kHz …
#define WL1273_SPACING_100kHz …
#define WL1273_SPACING_200kHz …
static int wl1273_fm_tx_set_spacing(struct wl1273_device *radio,
unsigned int spacing)
{ … }
static int wl1273_fm_g_volatile_ctrl(struct v4l2_ctrl *ctrl)
{ … }
#define WL1273_MUTE_SOFT_ENABLE …
#define WL1273_MUTE_AC …
#define WL1273_MUTE_HARD_LEFT …
#define WL1273_MUTE_HARD_RIGHT …
#define WL1273_MUTE_SOFT_FORCE …
static inline struct wl1273_device *to_radio(struct v4l2_ctrl *ctrl)
{ … }
static int wl1273_fm_vidioc_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static int wl1273_fm_vidioc_g_audio(struct file *file, void *priv,
struct v4l2_audio *audio)
{ … }
static int wl1273_fm_vidioc_s_audio(struct file *file, void *priv,
const struct v4l2_audio *audio)
{ … }
#define WL1273_RDS_NOT_SYNCHRONIZED …
#define WL1273_RDS_SYNCHRONIZED …
static int wl1273_fm_vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *tuner)
{ … }
static int wl1273_fm_vidioc_s_tuner(struct file *file, void *priv,
const struct v4l2_tuner *tuner)
{ … }
static int wl1273_fm_vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *freq)
{ … }
static int wl1273_fm_vidioc_s_frequency(struct file *file, void *priv,
const struct v4l2_frequency *freq)
{ … }
#define WL1273_DEFAULT_SEEK_LEVEL …
static int wl1273_fm_vidioc_s_hw_freq_seek(struct file *file, void *priv,
const struct v4l2_hw_freq_seek *seek)
{ … }
static int wl1273_fm_vidioc_s_modulator(struct file *file, void *priv,
const struct v4l2_modulator *modulator)
{ … }
static int wl1273_fm_vidioc_g_modulator(struct file *file, void *priv,
struct v4l2_modulator *modulator)
{ … }
static int wl1273_fm_vidioc_log_status(struct file *file, void *priv)
{ … }
static void wl1273_vdev_release(struct video_device *dev)
{ … }
static const struct v4l2_ctrl_ops wl1273_ctrl_ops = …;
static const struct v4l2_ioctl_ops wl1273_ioctl_ops = …;
static const struct video_device wl1273_viddev_template = …;
static void wl1273_fm_radio_remove(struct platform_device *pdev)
{ … }
static int wl1273_fm_radio_probe(struct platform_device *pdev)
{ … }
static struct platform_driver wl1273_fm_radio_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;