#define _CX231XX_H
#include <linux/videodev2.h>
-#include <media/videobuf-vmalloc.h>
-
+#include <linux/types.h>
+#include <linux/ioctl.h>
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
#include <linux/mutex.h>
+
+
+#include <media/videobuf-vmalloc.h>
+#include <media/v4l2-device.h>
#include <media/ir-kbd-i2c.h>
#if defined(CONFIG_VIDEO_CX231XX_DVB) || \
defined(CONFIG_VIDEO_CX231XX_DVB_MODULE)
#endif
#include "cx231xx-reg.h"
-#include "cx231xx-pcb-config.h"
+#include "cx231xx-pcb-cfg.h"
#include "cx231xx-conf-reg.h"
#define DRIVER_NAME "cx231xx"
#define PWR_SLEEP_INTERVAL 5
/* I2C addresses for control block in Cx231xx */
-#define Colibri_DEVICE_ADDRESS 0x60
-#define Flatrion_DEVICE_ADDRESS 0x98
-#define HAMMERHEAD_I2C_ADDRESS 0x88
+#define AFE_DEVICE_ADDRESS 0x60
+#define I2S_BLK_DEVICE_ADDRESS 0x98
+#define VID_BLK_I2C_ADDRESS 0x88
#define DIF_USE_BASEBAND 0xFFFFFFFF
/* Boards supported by driver */
struct cx231xx_input input[MAX_CX231XX_INPUT];
struct cx231xx_input radio;
- IR_KEYTAB_TYPE *ir_codes;
+ struct ir_scancode_table *ir_codes;
};
/* device states */
u8 *p_buffer; /* pointer to the buffer */
};
-struct VENDOR_REQUEST_IN{
+struct VENDOR_REQUEST_IN {
u8 bRequest;
u16 wValue;
u16 wIndex;
u32 shift;
};
-enum TRANSFER_TYPE{
+enum TRANSFER_TYPE {
Raw_Video = 0,
Audio,
Vbi, /* VANC */
struct cx231xx_fmt *format;
+ struct v4l2_device v4l2_dev;
+ struct v4l2_subdev *sd_cx25840;
+ struct v4l2_subdev *sd_tuner;
+
struct cx231xx_IR *ir;
struct list_head devlist;
/* Power Modes */
int power_mode;
- /* colibri parameters */
- enum AFE_MODE colibri_mode;
- u32 colibri_ref_count;
+ /* afe parameters */
+ enum AFE_MODE afe_mode;
+ u32 afe_ref_count;
/* video related parameters */
u32 video_input;
};
+#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 cx231xx_reset_analog_tuner(struct cx231xx *dev);
/* Provided by cx231xx-i2c.c */
-void cx231xx_i2c_call_clients(struct cx231xx_i2c *bus, unsigned int cmd,
- void *arg);
void cx231xx_do_i2c_scan(struct cx231xx *dev, struct i2c_client *c);
int cx231xx_i2c_register(struct cx231xx_i2c *bus);
int cx231xx_i2c_unregister(struct cx231xx_i2c *bus);
u16 saddr, u32 mask, u32 value);
u32 cx231xx_set_field(u32 field_mask, u32 data);
-/* Colibri related functions */
-int cx231xx_colibri_init_super_block(struct cx231xx *dev, u32 ref_count);
-int cx231xx_colibri_init_channels(struct cx231xx *dev);
-int cx231xx_colibri_setup_AFE_for_baseband(struct cx231xx *dev);
-int cx231xx_colibri_set_input_mux(struct cx231xx *dev, u32 input_mux);
-int cx231xx_colibri_set_mode(struct cx231xx *dev, enum AFE_MODE mode);
-int cx231xx_colibri_update_power_control(struct cx231xx *dev, AV_MODE avmode);
-int cx231xx_colibri_adjust_ref_count(struct cx231xx *dev, u32 video_input);
-
-/* flatiron related functions */
-int cx231xx_flatiron_initialize(struct cx231xx *dev);
-int cx231xx_flatiron_update_power_control(struct cx231xx *dev, AV_MODE avmode);
-int cx231xx_flatiron_set_audio_input(struct cx231xx *dev, u8 audio_input);
+/* afe related functions */
+int cx231xx_afe_init_super_block(struct cx231xx *dev, u32 ref_count);
+int cx231xx_afe_init_channels(struct cx231xx *dev);
+int cx231xx_afe_setup_AFE_for_baseband(struct cx231xx *dev);
+int cx231xx_afe_set_input_mux(struct cx231xx *dev, u32 input_mux);
+int cx231xx_afe_set_mode(struct cx231xx *dev, enum AFE_MODE mode);
+int cx231xx_afe_update_power_control(struct cx231xx *dev,
+ enum AV_MODE avmode);
+int cx231xx_afe_adjust_ref_count(struct cx231xx *dev, u32 video_input);
+
+/* i2s block related functions */
+int cx231xx_i2s_blk_initialize(struct cx231xx *dev);
+int cx231xx_i2s_blk_update_power_control(struct cx231xx *dev,
+ enum AV_MODE avmode);
+int cx231xx_i2s_blk_set_audio_input(struct cx231xx *dev, u8 audio_input);
/* DIF related functions */
int cx231xx_dif_configure_C2HH_for_low_IF(struct cx231xx *dev, u32 mode,
int cx231xx_register_analog_devices(struct cx231xx *dev);
void cx231xx_remove_from_devlist(struct cx231xx *dev);
void cx231xx_add_into_devlist(struct cx231xx *dev);
-struct cx231xx *cx231xx_get_device(int minor,
- enum v4l2_buf_type *fh_type, int *has_radio);
void cx231xx_init_extension(struct cx231xx *dev);
void cx231xx_close_extension(struct cx231xx *dev);
int cx231xx_initialize_stream_xfer(struct cx231xx *dev, u32 media_type);
/* Power control functions */
-int cx231xx_set_power_mode(struct cx231xx *dev, AV_MODE mode);
+int cx231xx_set_power_mode(struct cx231xx *dev, enum AV_MODE mode);
int cx231xx_power_suspend(struct cx231xx *dev);
/* chip specific control functions */
int cx231xx_set_decoder_video_input(struct cx231xx *dev, u8 pin_type, u8 input);
int cx231xx_do_mode_ctrl_overrides(struct cx231xx *dev);
int cx231xx_set_audio_input(struct cx231xx *dev, u8 input);
-void get_scale(struct cx231xx *dev,
- unsigned int width, unsigned int height,
- unsigned int *hscale, unsigned int *vscale);
/* Provided by cx231xx-video.c */
int cx231xx_register_extension(struct cx231xx_ops *dev);
extern struct cx231xx_board cx231xx_boards[];
extern struct usb_device_id cx231xx_id_table[];
extern const unsigned int cx231xx_bcount;
-void cx231xx_set_ir(struct cx231xx *dev, struct IR_i2c *ir);
+void cx231xx_register_i2c_ir(struct cx231xx *dev);
int cx231xx_tuner_callback(void *ptr, int component, int command, int arg);
/* Provided by cx231xx-input.c */