Skip to content

Commit

Permalink
V4L/DVB (4005): Add support for the cx25836/7 video decoder.
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Alfter <salfter@ssai.us>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jun 25, 2006
1 parent 3eb7317 commit e2b8cf4
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 56 deletions.
24 changes: 22 additions & 2 deletions drivers/media/video/cx25840/cx25840-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
return -EINVAL;

/* assert soft reset */
cx25840_and_or(client, 0x810, ~0x1, 0x01);
if (!state->is_cx25836)
cx25840_and_or(client, 0x810, ~0x1, 0x01);

/* common for all inputs and rates */
/* SA_MCLK_SEL=1, SA_MCLK_DIV=0x10 */
Expand All @@ -46,6 +47,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
/* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0xee39bb01);

if (state->is_cx25836)
break;

/* src3/4/6_ctl = 0x0801f77f */
cx25840_write4(client, 0x900, 0x7ff70108);
cx25840_write4(client, 0x904, 0x7ff70108);
Expand All @@ -59,6 +63,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
/* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0xd66bec00);

if (state->is_cx25836)
break;

/* src3/4/6_ctl = 0x08016d59 */
cx25840_write4(client, 0x900, 0x596d0108);
cx25840_write4(client, 0x904, 0x596d0108);
Expand All @@ -72,6 +79,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
/* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0xe5d69800);

if (state->is_cx25836)
break;

/* src3/4/6_ctl = 0x08014faa */
cx25840_write4(client, 0x900, 0xaa4f0108);
cx25840_write4(client, 0x904, 0xaa4f0108);
Expand All @@ -87,6 +97,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
/* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0x69082a01);

if (state->is_cx25836)
break;

/* src1_ctl = 0x08010000 */
cx25840_write4(client, 0x8f8, 0x00000108);

Expand All @@ -106,6 +119,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
/* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0xd66bec00);

if (state->is_cx25836)
break;

/* src1_ctl = 0x08010000 */
cx25840_write4(client, 0x8f8, 0xcd600108);

Expand All @@ -122,6 +138,9 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
/* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0xe5d69800);

if (state->is_cx25836)
break;

/* src1_ctl = 0x08010000 */
cx25840_write4(client, 0x8f8, 0x00800108);

Expand All @@ -134,7 +153,8 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
}

/* deassert soft reset */
cx25840_and_or(client, 0x810, ~0x1, 0x00);
if (!state->is_cx25836)
cx25840_and_or(client, 0x810, ~0x1, 0x00);

state->audclk_freq = freq;

Expand Down
Loading

0 comments on commit e2b8cf4

Please sign in to comment.