diff options
Diffstat (limited to 'linux/drivers/media/video/cx231xx/cx231xx.h')
-rw-r--r-- | linux/drivers/media/video/cx231xx/cx231xx.h | 60 |
1 files changed, 36 insertions, 24 deletions
diff --git a/linux/drivers/media/video/cx231xx/cx231xx.h b/linux/drivers/media/video/cx231xx/cx231xx.h index 4606f27b4..21b4023dd 100644 --- a/linux/drivers/media/video/cx231xx/cx231xx.h +++ b/linux/drivers/media/video/cx231xx/cx231xx.h @@ -22,13 +22,17 @@ #ifndef _CX231XX_H #define _CX231XX_H -#include "compat.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 "compat.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) @@ -39,14 +43,13 @@ #include "cx231xx-pcb-cfg.h" #include "cx231xx-conf-reg.h" -#define CX231XX_VERSION_CODE KERNEL_VERSION(0, 1, 0) #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 */ @@ -457,6 +460,10 @@ struct cx231xx { 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; @@ -542,9 +549,9 @@ struct cx231xx { /* 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; @@ -554,6 +561,13 @@ struct cx231xx { }; +#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; @@ -567,8 +581,6 @@ 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_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); @@ -585,21 +597,21 @@ int cx231xx_read_modify_write_i2c_dword(struct cx231xx *dev, u8 dev_addr, 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, +/* 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_colibri_adjust_ref_count(struct cx231xx *dev, u32 video_input); +int cx231xx_afe_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, +/* 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_flatiron_set_audio_input(struct cx231xx *dev, u8 audio_input); +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, |