提交 ecc67d10 编写于 作者: S Sri Deevi 提交者: Mauro Carvalho Chehab

V4L/DVB (11129): cx231xx: Use generic names for each device block

Signed-off-by: NSrinivasa Deevi <srinivasa.deevi@conexant.com>
Reviewed-by: NHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 b1196126
......@@ -883,7 +883,7 @@ int cx231xx_dev_init(struct cx231xx *dev)
/* init hardware */
/* Note : with out calling set power mode function,
colibri can not be set up correctly */
afe can not be set up correctly */
errCode = cx231xx_set_power_mode(dev, POLARIS_AVMODE_ANALOGT_TV);
if (errCode < 0) {
cx231xx_errdev
......@@ -893,17 +893,17 @@ int cx231xx_dev_init(struct cx231xx *dev)
}
/* initialize Colibri block */
errCode = cx231xx_colibri_init_super_block(dev, 0x23c);
errCode = cx231xx_afe_init_super_block(dev, 0x23c);
if (errCode < 0) {
cx231xx_errdev
("%s: cx231xx_colibri init super block - errCode [%d]!\n",
("%s: cx231xx_afe init super block - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
errCode = cx231xx_colibri_init_channels(dev);
errCode = cx231xx_afe_init_channels(dev);
if (errCode < 0) {
cx231xx_errdev
("%s: cx231xx_colibri init channels - errCode [%d]!\n",
("%s: cx231xx_afe init channels - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
......@@ -917,11 +917,11 @@ int cx231xx_dev_init(struct cx231xx *dev)
return errCode;
}
/* flatiron related functions */
errCode = cx231xx_flatiron_initialize(dev);
/* I2S block related functions */
errCode = cx231xx_i2s_blk_initialize(dev);
if (errCode < 0) {
cx231xx_errdev
("%s: cx231xx_flatiron initialize - errCode [%d]!\n",
("%s: cx231xx_i2s block initialize - errCode [%d]!\n",
__func__, errCode);
return errCode;
}
......
......@@ -91,10 +91,10 @@ enum TS_PORT{
#define EAVP_MASK 0x8
enum EAV_PRESENT{
NO_EXTERNAL_AV = 0x0, /* 0: No External A/V inputs
(no need for Flatiron),
(no need for i2s blcok),
Analog Tuner must be present */
EXTERNAL_AV = 0x8 /* 1: External A/V inputs
present (requires Flatiron) */
present (requires i2s blk) */
};
#define ATM_MASK 0x30
......@@ -123,10 +123,6 @@ enum AVDEC_STATUS{
};
#define BO_1_MASK 0x100
enum HAMMERHEAD__STATUS{
HAMMERHEAD_ONLY = 0x0, /* 0:Hammerhead Only */
HAMMERHEAD_SC = 0x100 /* 1:Hammerhead and SC */
};
#define BUSPOWER_MASK 0xC4 /* for Polaris spec 0.8 */
#define SELFPOWER_MASK 0x86
......
......@@ -1421,36 +1421,36 @@ static int vidioc_g_register(struct file *file, void *priv,
reg->val = value[0] | value[1] << 8 |
value[2] << 16 | value[3] << 24;
break;
case 1: /* Colibri - read byte */
ret = cx231xx_read_i2c_data(dev, Colibri_DEVICE_ADDRESS,
case 1: /* AFE - read byte */
ret = cx231xx_read_i2c_data(dev, AFE_DEVICE_ADDRESS,
(u16)reg->reg, 2, &data, 1);
reg->val = le32_to_cpu(data & 0xff);
break;
case 14: /* Colibri - read dword */
ret = cx231xx_read_i2c_data(dev, Colibri_DEVICE_ADDRESS,
case 14: /* AFE - read dword */
ret = cx231xx_read_i2c_data(dev, AFE_DEVICE_ADDRESS,
(u16)reg->reg, 2, &data, 4);
reg->val = le32_to_cpu(data);
break;
case 2: /* Hammerhead - read byte */
ret = cx231xx_read_i2c_data(dev, HAMMERHEAD_I2C_ADDRESS,
case 2: /* Video Block - read byte */
ret = cx231xx_read_i2c_data(dev, VID_BLK_I2C_ADDRESS,
(u16)reg->reg, 2, &data, 1);
reg->val = le32_to_cpu(data & 0xff);
break;
case 24: /* Hammerhead - read dword */
ret = cx231xx_read_i2c_data(dev, HAMMERHEAD_I2C_ADDRESS,
case 24: /* Video Block - read dword */
ret = cx231xx_read_i2c_data(dev, VID_BLK_I2C_ADDRESS,
(u16)reg->reg, 2, &data, 4);
reg->val = le32_to_cpu(data);
break;
case 3: /* flatiron - read byte */
case 3: /* I2S block - read byte */
ret = cx231xx_read_i2c_data(dev,
Flatrion_DEVICE_ADDRESS,
I2S_BLK_DEVICE_ADDRESS,
(u16)reg->reg, 1,
&data, 1);
reg->val = le32_to_cpu(data & 0xff);
break;
case 34: /* flatiron - read dword */
case 34: /* I2S Block - read dword */
ret =
cx231xx_read_i2c_data(dev, Flatrion_DEVICE_ADDRESS,
cx231xx_read_i2c_data(dev, I2S_BLK_DEVICE_ADDRESS,
(u16)reg->reg, 1, &data, 4);
reg->val = le32_to_cpu(data);
break;
......@@ -1503,43 +1503,43 @@ static int vidioc_s_register(struct file *file, void *priv,
(u16)reg->reg, data,
4);
break;
case 1: /* Colibri - read byte */
case 1: /* AFE - read byte */
ret = cx231xx_write_i2c_data(dev,
Colibri_DEVICE_ADDRESS,
AFE_DEVICE_ADDRESS,
(u16)reg->reg, 2,
value, 1);
break;
case 14: /* Colibri - read dword */
case 14: /* AFE - read dword */
ret = cx231xx_write_i2c_data(dev,
Colibri_DEVICE_ADDRESS,
AFE_DEVICE_ADDRESS,
(u16)reg->reg, 2,
value, 4);
break;
case 2: /* Hammerhead - read byte */
case 2: /* Video Block - read byte */
ret =
cx231xx_write_i2c_data(dev,
HAMMERHEAD_I2C_ADDRESS,
VID_BLK_I2C_ADDRESS,
(u16)reg->reg, 2,
value, 1);
break;
case 24: /* Hammerhead - read dword */
case 24: /* Video Block - read dword */
ret =
cx231xx_write_i2c_data(dev,
HAMMERHEAD_I2C_ADDRESS,
VID_BLK_I2C_ADDRESS,
(u16)reg->reg, 2,
value, 4);
break;
case 3: /* flatiron - read byte */
case 3: /* I2S block - read byte */
ret =
cx231xx_write_i2c_data(dev,
Flatrion_DEVICE_ADDRESS,
I2S_BLK_DEVICE_ADDRESS,
(u16)reg->reg, 1,
value, 1);
break;
case 34: /* flatiron - read dword */
case 34: /* I2S block - read dword */
ret =
cx231xx_write_i2c_data(dev,
Flatrion_DEVICE_ADDRESS,
I2S_BLK_DEVICE_ADDRESS,
(u16)reg->reg, 1,
value, 4);
break;
......
......@@ -46,9 +46,9 @@
#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 */
......@@ -540,9 +540,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;
......@@ -588,21 +588,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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册