#include "cx231xx.h"
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/firmware.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include <media/drv-intf/cx2341x.h>
#include <media/tuner.h>
#define CX231xx_FIRM_IMAGE_SIZE …
#define CX231xx_FIRM_IMAGE_NAME …
#define ITVC_WRITE_DIR …
#define ITVC_READ_DIR …
#define MCI_MEMORY_DATA_BYTE0 …
#define MCI_MEMORY_DATA_BYTE1 …
#define MCI_MEMORY_DATA_BYTE2 …
#define MCI_MEMORY_DATA_BYTE3 …
#define MCI_MEMORY_ADDRESS_BYTE2 …
#define MCI_MEMORY_ADDRESS_BYTE1 …
#define MCI_MEMORY_ADDRESS_BYTE0 …
#define MCI_REGISTER_DATA_BYTE0 …
#define MCI_REGISTER_DATA_BYTE1 …
#define MCI_REGISTER_DATA_BYTE2 …
#define MCI_REGISTER_DATA_BYTE3 …
#define MCI_REGISTER_ADDRESS_BYTE0 …
#define MCI_REGISTER_ADDRESS_BYTE1 …
#define MCI_REGISTER_MODE …
#define MCI_MODE_REGISTER_READ …
#define MCI_MODE_REGISTER_WRITE …
#define MCI_MODE_MEMORY_READ …
#define MCI_MODE_MEMORY_WRITE …
static unsigned int mpeglines = …;
module_param(mpeglines, int, 0644);
MODULE_PARM_DESC(…) …;
static unsigned int mpeglinesize = …;
module_param(mpeglinesize, int, 0644);
MODULE_PARM_DESC(…) …;
static unsigned int v4l_debug = …;
module_param(v4l_debug, int, 0644);
MODULE_PARM_DESC(…) …;
#define dprintk(level, fmt, arg...) …
static struct cx231xx_tvnorm cx231xx_tvnorms[] = …;
enum cx231xx_capture_type { … };
enum cx231xx_capture_bits { … };
enum cx231xx_capture_end { … };
enum cx231xx_framerate { … };
enum cx231xx_stream_port { … };
enum cx231xx_data_xfer_status { … };
enum cx231xx_picture_mask { … };
enum cx231xx_vbi_mode_bits { … };
enum cx231xx_vbi_insertion_bits { … };
enum cx231xx_dma_unit { … };
enum cx231xx_dma_transfer_status_bits { … };
enum cx231xx_pause { … };
enum cx231xx_copyright { … };
enum cx231xx_notification_type { … };
enum cx231xx_notification_status { … };
enum cx231xx_notification_mailbox { … };
enum cx231xx_field1_lines { … };
enum cx231xx_field2_lines { … };
enum cx231xx_custom_data_type { … };
enum cx231xx_mute { … };
enum cx231xx_mute_video_mask { … };
enum cx231xx_mute_video_shift { … };
#define IVTV_CMD_HW_BLOCKS_RST …
#define IVTV_API_STD_TIMEOUT …
#define IVTV_REG_ENC_SDRAM_REFRESH …
#define IVTV_REG_ENC_SDRAM_PRECHARGE …
#define IVTV_REG_SPU …
#define IVTV_REG_HW_BLOCKS …
#define IVTV_REG_VPU …
#define IVTV_REG_APU …
#define MC417_MIWR …
#define MC417_MIRD …
#define MC417_MICS …
#define MC417_MIRDY …
#define MC417_MIADDR …
#define MC417_MIDATA …
#define MC417_SPD_CTL(x) …
#define MC417_GPIO_SEL(x) …
#define MC417_UART_GPIO_EN …
#define MC417_SPD_CTL_SLOW …
#define MC417_SPD_CTL_MEDIUM …
#define MC417_SPD_CTL_FAST …
#define MC417_GPIO_SEL_GPIO3 …
#define MC417_GPIO_SEL_GPIO2 …
#define MC417_GPIO_SEL_GPIO1 …
#define MC417_GPIO_SEL_GPIO0 …
#define CX23417_GPIO_MASK …
static int set_itvc_reg(struct cx231xx *dev, u32 gpio_direction, u32 value)
{ … }
static int get_itvc_reg(struct cx231xx *dev, u32 gpio_direction, u32 *val_ptr)
{ … }
static int wait_for_mci_complete(struct cx231xx *dev)
{ … }
static int mc417_register_write(struct cx231xx *dev, u16 address, u32 value)
{ … }
static int mc417_register_read(struct cx231xx *dev, u16 address, u32 *value)
{ … }
static int mc417_memory_write(struct cx231xx *dev, u32 address, u32 value)
{ … }
static int mc417_memory_read(struct cx231xx *dev, u32 address, u32 *value)
{ … }
static char *cmd_to_str(int cmd)
{ … }
static int cx231xx_mbox_func(void *priv, u32 command, int in, int out,
u32 data[CX2341X_MBOX_MAX_DATA])
{ … }
static int cx231xx_api_cmd(struct cx231xx *dev, u32 command,
u32 inputcnt, u32 outputcnt, ...)
{ … }
static int cx231xx_find_mailbox(struct cx231xx *dev)
{ … }
static void mci_write_memory_to_gpio(struct cx231xx *dev, u32 address, u32 value,
u32 *p_fw_image)
{ … }
static int cx231xx_load_firmware(struct cx231xx *dev)
{ … }
static void cx231xx_codec_settings(struct cx231xx *dev)
{ … }
static int cx231xx_initialize_codec(struct cx231xx *dev)
{ … }
static int queue_setup(struct vb2_queue *vq,
unsigned int *nbuffers, unsigned int *nplanes,
unsigned int sizes[], struct device *alloc_devs[])
{ … }
static void buffer_copy(struct cx231xx *dev, char *data, int len, struct urb *urb,
struct cx231xx_dmaqueue *dma_q)
{ … }
static void buffer_filled(char *data, int len, struct urb *urb,
struct cx231xx_dmaqueue *dma_q)
{ … }
static int cx231xx_isoc_copy(struct cx231xx *dev, struct urb *urb)
{ … }
static int cx231xx_bulk_copy(struct cx231xx *dev, struct urb *urb)
{ … }
static void buffer_queue(struct vb2_buffer *vb)
{ … }
static void return_all_buffers(struct cx231xx *dev,
enum vb2_buffer_state state)
{ … }
static int start_streaming(struct vb2_queue *vq, unsigned int count)
{ … }
static void stop_streaming(struct vb2_queue *vq)
{ … }
static const struct vb2_ops cx231xx_video_qops = …;
static int vidioc_g_pixelaspect(struct file *file, void *priv,
int type, struct v4l2_fract *f)
{ … }
static int vidioc_g_selection(struct file *file, void *priv,
struct v4l2_selection *s)
{ … }
static int vidioc_g_std(struct file *file, void *fh0, v4l2_std_id *norm)
{ … }
static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
{ … }
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctl)
{ … }
static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_log_status(struct file *file, void *priv)
{ … }
static const struct v4l2_file_operations mpeg_fops = …;
static const struct v4l2_ioctl_ops mpeg_ioctl_ops = …;
static struct video_device cx231xx_mpeg_template = …;
void cx231xx_417_unregister(struct cx231xx *dev)
{ … }
static int cx231xx_s_video_encoding(struct cx2341x_handler *cxhdl, u32 val)
{ … }
static int cx231xx_s_audio_sampling_freq(struct cx2341x_handler *cxhdl, u32 idx)
{ … }
static const struct cx2341x_handler_ops cx231xx_ops = …;
static void cx231xx_video_dev_init(
struct cx231xx *dev,
struct usb_device *usbdev,
struct video_device *vfd,
const struct video_device *template,
const char *type)
{ … }
int cx231xx_417_register(struct cx231xx *dev)
{ … }
MODULE_FIRMWARE(…);