#include "cx88.h"
#include <linux/module.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/firmware.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include <media/drv-intf/cx2341x.h>
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…);
static unsigned int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(…) …;
#define dprintk(level, fmt, arg...) …
#define BLACKBIRD_FIRM_IMAGE_SIZE …
#define IVTV_CMD_HW_BLOCKS_RST …
#define IVTV_API_STD_TIMEOUT …
enum blackbird_capture_type { … };
enum blackbird_capture_bits { … };
enum blackbird_capture_end { … };
enum blackbird_framerate { … };
enum blackbird_stream_port { … };
enum blackbird_data_xfer_status { … };
enum blackbird_picture_mask { … };
enum blackbird_vbi_mode_bits { … };
enum blackbird_vbi_insertion_bits { … };
enum blackbird_dma_unit { … };
enum blackbird_dma_transfer_status_bits { … };
enum blackbird_pause { … };
enum blackbird_copyright { … };
enum blackbird_notification_type { … };
enum blackbird_notification_status { … };
enum blackbird_notification_mailbox { … };
enum blackbird_field1_lines { … };
enum blackbird_field2_lines { … };
enum blackbird_custom_data_type { … };
enum blackbird_mute { … };
enum blackbird_mute_video_mask { … };
enum blackbird_mute_video_shift { … };
#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 …
static void host_setup(struct cx88_core *core)
{ … }
#define P1_MDATA0 …
#define P1_MDATA1 …
#define P1_MDATA2 …
#define P1_MDATA3 …
#define P1_MADDR2 …
#define P1_MADDR1 …
#define P1_MADDR0 …
#define P1_RDATA0 …
#define P1_RDATA1 …
#define P1_RDATA2 …
#define P1_RDATA3 …
#define P1_RADDR0 …
#define P1_RADDR1 …
#define P1_RRDWR …
static int wait_ready_gpio0_bit1(struct cx88_core *core, u32 state)
{ … }
static int memory_write(struct cx88_core *core, u32 address, u32 value)
{ … }
static int memory_read(struct cx88_core *core, u32 address, u32 *value)
{ … }
static int register_write(struct cx88_core *core, u32 address, u32 value)
{ … }
static int register_read(struct cx88_core *core, u32 address, u32 *value)
{ … }
static int blackbird_mbox_func(void *priv, u32 command, int in,
int out, u32 data[CX2341X_MBOX_MAX_DATA])
{ … }
static int blackbird_api_cmd(struct cx8802_dev *dev, u32 command,
u32 inputcnt, u32 outputcnt, ...)
{ … }
static int blackbird_find_mailbox(struct cx8802_dev *dev)
{ … }
static int blackbird_load_firmware(struct cx8802_dev *dev)
{ … }
static void blackbird_codec_settings(struct cx8802_dev *dev)
{ … }
static int blackbird_initialize_codec(struct cx8802_dev *dev)
{ … }
static int blackbird_start_codec(struct cx8802_dev *dev)
{ … }
static int blackbird_stop_codec(struct cx8802_dev *dev)
{ … }
static int queue_setup(struct vb2_queue *q,
unsigned int *num_buffers, unsigned int *num_planes,
unsigned int sizes[], struct device *alloc_devs[])
{ … }
static int buffer_prepare(struct vb2_buffer *vb)
{ … }
static void buffer_finish(struct vb2_buffer *vb)
{ … }
static void buffer_queue(struct vb2_buffer *vb)
{ … }
static int start_streaming(struct vb2_queue *q, unsigned int count)
{ … }
static void stop_streaming(struct vb2_queue *q)
{ … }
static const struct vb2_ops blackbird_qops = …;
static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{ … }
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_s_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_s_frequency(struct file *file, void *priv,
const struct v4l2_frequency *f)
{ … }
static int vidioc_log_status(struct file *file, void *priv)
{ … }
static int vidioc_enum_input(struct file *file, void *priv,
struct v4l2_input *i)
{ … }
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{ … }
static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)
{ … }
static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
{ … }
static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *t)
{ … }
static int vidioc_s_tuner(struct file *file, void *priv,
const struct v4l2_tuner *t)
{ … }
static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *tvnorm)
{ … }
static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id id)
{ … }
static const struct v4l2_file_operations mpeg_fops = …;
static const struct v4l2_ioctl_ops mpeg_ioctl_ops = …;
static const struct video_device cx8802_mpeg_template = …;
static int cx8802_blackbird_advise_acquire(struct cx8802_driver *drv)
{ … }
static int cx8802_blackbird_advise_release(struct cx8802_driver *drv)
{ … }
static void blackbird_unregister_video(struct cx8802_dev *dev)
{ … }
static int blackbird_register_video(struct cx8802_dev *dev)
{ … }
static int cx8802_blackbird_probe(struct cx8802_driver *drv)
{ … }
static int cx8802_blackbird_remove(struct cx8802_driver *drv)
{ … }
static struct cx8802_driver cx8802_blackbird_driver = …;
static int __init blackbird_init(void)
{ … }
static void __exit blackbird_fini(void)
{ … }
module_init(…) …;
module_exit(blackbird_fini);