Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76721
b: refs/heads/master
c: f234081
h: refs/heads/master
i:
  76719: 4af0acd
v: v3
  • Loading branch information
Steven Toth authored and Mauro Carvalho Chehab committed Jan 25, 2008
1 parent 38a1406 commit ddadbc5
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 38 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: d05051c82e0e8ff748e9c9a06a061bda3ad656e5
refs/heads/master: f234081bc564c69eb0e2cd4e957ad1cbae4a6144
65 changes: 54 additions & 11 deletions trunk/drivers/media/video/cx25840/cx25840-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)

/* common for all inputs and rates */
/* SA_MCLK_SEL=1, SA_MCLK_DIV=0x10 */
cx25840_write(client, 0x127, 0x50);
if (!state->is_cx23885)
cx25840_write(client, 0x127, 0x50);

if (state->aud_input != CX25840_AUDIO_SERIAL) {
switch (freq) {
case 32000:
if (state->is_cx23885) {
/* We don't have register values
* so avoid destroying registers. */
break;
}
/* VID_PLL and AUX_PLL */
cx25840_write4(client, 0x108, 0x1006040f);

Expand All @@ -53,6 +59,11 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
break;

case 44100:
if (state->is_cx23885) {
/* We don't have register values
* so avoid destroying registers. */
break;
}
/* VID_PLL and AUX_PLL */
cx25840_write4(client, 0x108, 0x1009040f);

Expand All @@ -69,6 +80,11 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
break;

case 48000:
if (state->is_cx23885) {
/* We don't have register values
* so avoid destroying registers. */
break;
}
/* VID_PLL and AUX_PLL */
cx25840_write4(client, 0x108, 0x100a040f);

Expand All @@ -87,6 +103,11 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
} else {
switch (freq) {
case 32000:
if (state->is_cx23885) {
/* We don't have register values
* so avoid destroying registers. */
break;
}
/* VID_PLL and AUX_PLL */
cx25840_write4(client, 0x108, 0x1e08040f);

Expand All @@ -109,6 +130,12 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
break;

case 44100:
if (state->is_cx23885) {
/* We don't have register values
* so avoid destroying registers. */
break;
}

/* VID_PLL and AUX_PLL */
cx25840_write4(client, 0x108, 0x1809040f);

Expand All @@ -128,22 +155,33 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
break;

case 48000:
/* VID_PLL and AUX_PLL */
cx25840_write4(client, 0x108, 0x180a040f);
if (!state->is_cx23885) {
/* VID_PLL and AUX_PLL */
cx25840_write4(client, 0x108, 0x180a040f);

/* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0x0098d6e5);
/* AUX_PLL_FRAC */
cx25840_write4(client, 0x110, 0x0098d6e5);
}

if (state->is_cx25836)
break;

/* src1_ctl = 0x08010000 */
cx25840_write4(client, 0x8f8, 0x08018000);
if (!state->is_cx23885) {
/* src1_ctl */
cx25840_write4(client, 0x8f8, 0x08018000);

/* src3/4/6_ctl = 0x08020000 */
cx25840_write4(client, 0x900, 0x08015555);
cx25840_write4(client, 0x904, 0x08015555);
cx25840_write4(client, 0x90c, 0x08015555);
/* src3/4/6_ctl */
cx25840_write4(client, 0x900, 0x08015555);
cx25840_write4(client, 0x904, 0x08015555);
cx25840_write4(client, 0x90c, 0x08015555);
} else {

cx25840_write4(client, 0x8f8, 0x0801867c);

cx25840_write4(client, 0x900, 0x08014faa);
cx25840_write4(client, 0x904, 0x08014faa);
cx25840_write4(client, 0x90c, 0x08014faa);
}
break;
}
}
Expand Down Expand Up @@ -188,6 +226,11 @@ void cx25840_audio_set_path(struct i2c_client *client)

/* deassert soft reset */
cx25840_and_or(client, 0x810, ~0x1, 0x00);

if (state->is_cx23885) {
/* Ensure the controller is running when we exit */
cx25840_and_or(client, 0x803, ~0x10, 0x10);
}
}

static int get_volume(struct i2c_client *client)
Expand Down
Loading

0 comments on commit ddadbc5

Please sign in to comment.