/*Limits the max URB message size */ #define URB_MAX_CTRL_SIZE 80
/* Params for validated field */ #define CX231XX_BOARD_NOT_VALIDATED 1 #define CX231XX_BOARD_VALIDATED 0
/* maximum number of cx231xx boards */ #define CX231XX_MAXBOARDS 8
/* maximum number of frames that can be queued */ #define CX231XX_NUM_FRAMES 5
/* number of buffers for isoc transfers */ #define CX231XX_NUM_BUFS 8
/* number of packets for each buffer windows requests only 40 packets .. so we better do the same this is what I found out for all alternate numbers there!
*/ #define CX231XX_NUM_PACKETS 40
/* default alternate; 0 means choose the best */ #define CX231XX_PINOUT 0
#define CX231XX_INTERLACED_DEFAULT 1
/* time to wait when stopping the isoc transfer */ #define CX231XX_URB_TIMEOUT \
msecs_to_jiffies(CX231XX_NUM_BUFS * CX231XX_NUM_PACKETS)
struct cx231xx_fmt { char *name;
u32 fourcc; /* v4l2 format id */ int depth; int reg;
};
/* buffer for one video frame */ struct cx231xx_buffer { /* common v4l buffer stuff -- must be first */ struct vb2_v4l2_buffer vb; struct list_head list; struct list_head frame; int top_field; int receiving;
};
/* cx231xx has two audio inputs: tuner and line in */ enum cx231xx_amux { /* This is the only entry for cx231xx tuner input */
CX231XX_AMUX_VIDEO, /* cx231xx tuner */
CX231XX_AMUX_LINE_IN, /* Line In */
};
struct cx231xx_reg_seq { unsignedchar bit; unsignedchar val; int sleep;
};
int users, shutdown; /* locks */
spinlock_t slock;
int alt; /* alternate */ int max_pkt_size; /* max packet size of isoc transaction */ int num_alt; /* Number of alternative settings */ unsignedint *alt_max_pkt_size; /* array of wMaxPacketSize */
u16 end_point_addr;
};
/* 0-- STOP transaction */ #define I2C_STOP 0x0 /* 1-- do not transmit STOP at end of transaction */ #define I2C_NOSTOP 0x1 /* 1--allow slave to insert clock wait states */ #define I2C_SYNC 0x1
struct cx231xx_i2c { struct cx231xx *dev;
int nr;
/* i2c i/o */ struct i2c_adapter i2c_adap; int i2c_rc;
/* different settings for each bus */
u8 i2c_period;
u8 i2c_nostop;
u8 i2c_reserve;
};
struct cx231xx_i2c_xfer_data {
u8 dev_addr;
u8 direction; /* 1 - IN, 0 - OUT */
u8 saddr_len; /* sub address len */
u16 saddr_dat; /* sub addr data */
u8 buf_size; /* buffer size */
u8 *p_buffer; /* pointer to the buffer */
};
/* usb transfer */ int alt; /* alternate */ int max_pkt_size; /* max packet size of isoc transaction */ int num_alt; /* Number of alternative settings */ unsignedint *alt_max_pkt_size; /* array of wMaxPacketSize */
u16 end_point_addr;
};
/* Allow a single tsport to have multiple frontends */
u32 num_frontends; void *port_priv;
};
/* main device struct */ struct cx231xx { /* generic device properties */ char name[30]; /* name (including minor) of the device */ int model; /* index in the device_data struct */ int devno; /* marks the number of this device */ struct device *dev; /* pointer to USB interface's dev */
struct cx231xx_board board;
/* For I2C IR support */ struct IR_i2c_init_data init_data; struct i2c_client *ir_i2c_client;
/* video for linux */ int users; /* user count for exclusive use */ struct video_device vdev; /* video for linux device struct */
v4l2_std_id norm; /* selected tv norm */ int ctl_freq; /* selected frequency */ unsignedint ctl_ainput; /* selected audio input */
/* frame properties */ int width; /* current frame width */ int height; /* current frame height */ int interlaced; /* 1=interlace fields, 0=just top fields */ unsignedint size;
#define cx25840_call(cx231xx, o, f, args...) \
v4l2_subdev_call(cx231xx->sd_cx25840, o, f, ##args) #define tuner_call(cx231xx, o, f, args...) \
v4l2_subdev_call(cx231xx->sd_tuner, o, f, ##args) #define call_all(dev, o, f, args...) \
v4l2_device_call_until_err(&dev->v4l2_dev, 0, o, f, ##args)
struct cx231xx_ops { struct list_head next; char *name; int id; int (*init) (struct cx231xx *); int (*fini) (struct cx231xx *);
};
/* call back functions in dvb module */ int cx231xx_set_analog_freq(struct cx231xx *dev, u32 freq); int cx231xx_reset_analog_tuner(struct cx231xx *dev);
/* Provided by cx231xx-i2c.c */ void cx231xx_do_i2c_scan(struct cx231xx *dev, int i2c_port); int cx231xx_i2c_register(struct cx231xx_i2c *bus); void cx231xx_i2c_unregister(struct cx231xx_i2c *bus); int cx231xx_i2c_mux_create(struct cx231xx *dev); int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no); void cx231xx_i2c_mux_unregister(struct cx231xx *dev); struct i2c_adapter *cx231xx_get_i2c_adap(struct cx231xx *dev, int i2c_port);
int cx231xx_dif_set_standard(struct cx231xx *dev, u32 standard); int cx231xx_tuner_pre_channel_change(struct cx231xx *dev); int cx231xx_tuner_post_channel_change(struct cx231xx *dev);
/* read from control pipe */ int cx231xx_read_ctrl_reg(struct cx231xx *dev, u8 req, u16 reg, char *buf, int len);
/* write to control pipe */ int cx231xx_write_ctrl_reg(struct cx231xx *dev, u8 req, u16 reg, char *buf, int len); int cx231xx_mode_register(struct cx231xx *dev, u16 address, u32 mode);
int cx231xx_send_vendor_cmd(struct cx231xx *dev, struct VENDOR_REQUEST_IN *ven_req); int cx231xx_send_usb_command(struct cx231xx_i2c *i2c_bus, struct cx231xx_i2c_xfer_data *req_data);
/* Gpio related functions */ int cx231xx_send_gpio_cmd(struct cx231xx *dev, u32 gpio_bit, u8 *gpio_val,
u8 len, u8 request, u8 direction); int cx231xx_set_gpio_value(struct cx231xx *dev, int pin_number, int pin_value); int cx231xx_set_gpio_direction(struct cx231xx *dev, int pin_number, int pin_value);
int cx231xx_gpio_i2c_start(struct cx231xx *dev); int cx231xx_gpio_i2c_end(struct cx231xx *dev); int cx231xx_gpio_i2c_write_byte(struct cx231xx *dev, u8 data); int cx231xx_gpio_i2c_read_byte(struct cx231xx *dev, u8 *buf); int cx231xx_gpio_i2c_read_ack(struct cx231xx *dev); int cx231xx_gpio_i2c_write_ack(struct cx231xx *dev); int cx231xx_gpio_i2c_write_nak(struct cx231xx *dev);
int cx231xx_gpio_i2c_read(struct cx231xx *dev, u8 dev_addr, u8 *buf, u8 len); int cx231xx_gpio_i2c_write(struct cx231xx *dev, u8 dev_addr, u8 *buf, u8 len);
/* audio related functions */ int cx231xx_set_audio_decoder_input(struct cx231xx *dev, enum AUDIO_INPUT audio_input);
int cx231xx_capture_start(struct cx231xx *dev, int start, u8 media_type); int cx231xx_set_video_alternate(struct cx231xx *dev); int cx231xx_set_alt_setting(struct cx231xx *dev, u8 index, u8 alt); int is_fw_load(struct cx231xx *dev); int cx231xx_check_fw(struct cx231xx *dev); int cx231xx_init_isoc(struct cx231xx *dev, int max_packets, int num_bufs, int max_pkt_size, int (*isoc_copy) (struct cx231xx *dev, struct urb *urb)); int cx231xx_init_bulk(struct cx231xx *dev, int max_packets, int num_bufs, int max_pkt_size, int (*bulk_copy) (struct cx231xx *dev, struct urb *urb)); void cx231xx_stop_TS1(struct cx231xx *dev); void cx231xx_start_TS1(struct cx231xx *dev); void cx231xx_uninit_isoc(struct cx231xx *dev); void cx231xx_uninit_bulk(struct cx231xx *dev); int cx231xx_set_mode(struct cx231xx *dev, enum cx231xx_mode set_mode); int cx231xx_unmute_audio(struct cx231xx *dev); int cx231xx_ep5_bulkout(struct cx231xx *dev, u8 *firmware, u16 size); void cx231xx_disable656(struct cx231xx *dev); void cx231xx_enable656(struct cx231xx *dev); int cx231xx_demod_reset(struct cx231xx *dev); int cx231xx_gpio_set(struct cx231xx *dev, struct cx231xx_reg_seq *gpio);
/* Stream control functions */ int cx231xx_start_stream(struct cx231xx *dev, u32 ep_mask); int cx231xx_stop_stream(struct cx231xx *dev, u32 ep_mask);
int cx231xx_initialize_stream_xfer(struct cx231xx *dev, u32 media_type);
/* Power control functions */ int cx231xx_set_power_mode(struct cx231xx *dev, enum AV_MODE mode);
/* chip specific control functions */ int cx231xx_init_ctrl_pin_status(struct cx231xx *dev); int cx231xx_set_agc_analog_digital_mux_select(struct cx231xx *dev,
u8 analog_or_digital); int cx231xx_enable_i2c_port_3(struct cx231xx *dev, bool is_port_3);
/* video audio decoder related functions */ void video_mux(struct cx231xx *dev, int index); int cx231xx_set_video_input_mux(struct cx231xx *dev, u8 input); int cx231xx_set_decoder_video_input(struct cx231xx *dev, u8 pin_type, u32 input); int cx231xx_do_mode_ctrl_overrides(struct cx231xx *dev); int cx231xx_set_audio_input(struct cx231xx *dev, u8 input);
/* Provided by cx231xx-video.c */ int cx231xx_register_extension(struct cx231xx_ops *dev); void cx231xx_unregister_extension(struct cx231xx_ops *dev); void cx231xx_init_extension(struct cx231xx *dev); void cx231xx_close_extension(struct cx231xx *dev); void cx231xx_v4l2_create_entities(struct cx231xx *dev); int cx231xx_querycap(struct file *file, void *priv, struct v4l2_capability *cap); int cx231xx_g_tuner(struct file *file, void *priv, struct v4l2_tuner *t); int cx231xx_s_tuner(struct file *file, void *priv, conststruct v4l2_tuner *t); int cx231xx_g_frequency(struct file *file, void *priv, struct v4l2_frequency *f); int cx231xx_s_frequency(struct file *file, void *priv, conststruct v4l2_frequency *f); int cx231xx_enum_input(struct file *file, void *priv, struct v4l2_input *i); int cx231xx_g_input(struct file *file, void *priv, unsignedint *i); int cx231xx_s_input(struct file *file, void *priv, unsignedint i); int cx231xx_g_chip_info(struct file *file, void *fh, struct v4l2_dbg_chip_info *chip); int cx231xx_g_register(struct file *file, void *priv, struct v4l2_dbg_register *reg); int cx231xx_s_register(struct file *file, void *priv, conststruct v4l2_dbg_register *reg);
/* Provided by cx231xx-cards.c */ externvoid cx231xx_pre_card_setup(struct cx231xx *dev); externvoid cx231xx_card_setup(struct cx231xx *dev); externstruct cx231xx_board cx231xx_boards[]; externstruct usb_device_id cx231xx_id_table[]; int cx231xx_tuner_callback(void *ptr, int component, int command, int arg);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.