Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193160
b: refs/heads/master
c: 64561a3
h: refs/heads/master
v: v3
  • Loading branch information
Mauro Carvalho Chehab committed May 19, 2010
1 parent 5afba2e commit 68deb92
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 33 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e36309f54a6196792fce74100356ebdeaecabd56
refs/heads/master: 64561a38838c66de1af059e7f4c14bbaa7dd3d54
53 changes: 21 additions & 32 deletions trunk/drivers/staging/cx25821/cx25821-medusa-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,9 @@ int medusa_set_saturation(struct cx25821_dev *dev, int saturation, int decoder)

int medusa_video_init(struct cx25821_dev *dev)
{
u32 value = 0, tmp = 0;
int ret_val = 0;
int i = 0;
u32 value, tmp = 0;
int ret_val;
int i;

mutex_lock(&dev->lock);

Expand All @@ -790,18 +790,15 @@ int medusa_video_init(struct cx25821_dev *dev)
value = cx25821_i2c_read(&dev->i2c_bus[0], MON_A_CTRL, &tmp);
value &= 0xFFFFF0FF;
ret_val = cx25821_i2c_write(&dev->i2c_bus[0], MON_A_CTRL, value);
if (ret_val < 0)
goto error;

if (ret_val < 0) {
mutex_unlock(&dev->lock);
return -EINVAL;
}
/* Turn off Master source switch enable */
value = cx25821_i2c_read(&dev->i2c_bus[0], MON_A_CTRL, &tmp);
value &= 0xFFFFFFDF;
ret_val = cx25821_i2c_write(&dev->i2c_bus[0], MON_A_CTRL, value);

if (ret_val < 0)
return -EINVAL;
goto error;

mutex_unlock(&dev->lock);

Expand All @@ -815,31 +812,25 @@ int medusa_video_init(struct cx25821_dev *dev)
value &= 0xFF70FF70;
value |= 0x00090008; /* set en_active */
ret_val = cx25821_i2c_write(&dev->i2c_bus[0], DENC_AB_CTRL, value);
if (ret_val < 0)
goto error;

if (ret_val < 0) {
mutex_unlock(&dev->lock);
return -EINVAL;
}
/* enable input is VIP/656 */
value = cx25821_i2c_read(&dev->i2c_bus[0], BYP_AB_CTRL, &tmp);
value |= 0x00040100; /* enable VIP */
ret_val = cx25821_i2c_write(&dev->i2c_bus[0], BYP_AB_CTRL, value);

if (ret_val < 0) {
mutex_unlock(&dev->lock);
return -EINVAL;
}
if (ret_val < 0)
goto error;

/* select AFE clock to output mode */
value = cx25821_i2c_read(&dev->i2c_bus[0], AFE_AB_DIAG_CTRL, &tmp);
value &= 0x83FFFFFF;
ret_val =
cx25821_i2c_write(&dev->i2c_bus[0], AFE_AB_DIAG_CTRL,
value | 0x10000000);
ret_val = cx25821_i2c_write(&dev->i2c_bus[0], AFE_AB_DIAG_CTRL,
value | 0x10000000);
if (ret_val < 0)
goto error;

if (ret_val < 0) {
mutex_unlock(&dev->lock);
return -EINVAL;
}
/* Turn on all of the data out and control output pins. */
value = cx25821_i2c_read(&dev->i2c_bus[0], PIN_OE_CTRL, &tmp);
value &= 0xFEF0FE00;
Expand All @@ -858,17 +849,15 @@ int medusa_video_init(struct cx25821_dev *dev)

value |= 7;
ret_val = cx25821_i2c_write(&dev->i2c_bus[0], PIN_OE_CTRL, value);
if (ret_val < 0) {
mutex_unlock(&dev->lock);
return -EINVAL;
}
if (ret_val < 0)
goto error;

mutex_unlock(&dev->lock);

ret_val = medusa_set_videostandard(dev);
return ret_val;

if (ret_val < 0)
return -EINVAL;

return 1;
error:
mutex_unlock(&dev->lock);
return ret_val;
}

0 comments on commit 68deb92

Please sign in to comment.