Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173909
b: refs/heads/master
c: 2a03f03
h: refs/heads/master
i:
  173907: 0633b5b
v: v3
  • Loading branch information
Andy Walls authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent d1e30b3 commit 5473992
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 61 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: c7dd1ecdc0112b9700ed6ad20a6e4e07d125044b
refs/heads/master: 2a03f03471d3232037e656570ccaf3ff2ffd01e8
44 changes: 22 additions & 22 deletions trunk/drivers/media/video/cx25840/cx25840-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,27 @@ 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 */
if (!state->is_cx23885 && !state->is_cx231xx)
if (!is_cx2388x(state) && !is_cx231xx(state))
cx25840_write(client, 0x127, 0x50);

if (state->aud_input != CX25840_AUDIO_SERIAL) {
switch (freq) {
case 32000:
if (state->is_cx23885) {
if (is_cx2388x(state)) {
/* We don't have register values
* so avoid destroying registers. */
break;
}

if (!state->is_cx231xx) {
if (!is_cx231xx(state)) {
/* VID_PLL and AUX_PLL */
cx25840_write4(client, 0x108, 0x1006040f);

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

if (state->is_cx25836)
if (is_cx2583x(state))
break;

/* src3/4/6_ctl = 0x0801f77f */
Expand All @@ -62,21 +62,21 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
break;

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

if (!state->is_cx231xx) {
if (!is_cx231xx(state)) {
/* VID_PLL and AUX_PLL */
cx25840_write4(client, 0x108, 0x1009040f);

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

if (state->is_cx25836)
if (is_cx2583x(state))
break;

/* src3/4/6_ctl = 0x08016d59 */
Expand All @@ -86,21 +86,21 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
break;

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

if (!state->is_cx231xx) {
if (!is_cx231xx(state)) {
/* VID_PLL and AUX_PLL */
cx25840_write4(client, 0x108, 0x100a040f);

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

if (state->is_cx25836)
if (is_cx2583x(state))
break;

/* src3/4/6_ctl = 0x08014faa */
Expand All @@ -112,21 +112,21 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
} else {
switch (freq) {
case 32000:
if (state->is_cx23885) {
if (is_cx2388x(state)) {
/* We don't have register values
* so avoid destroying registers. */
break;
}

if (!state->is_cx231xx) {
if (!is_cx231xx(state)) {
/* VID_PLL and AUX_PLL */
cx25840_write4(client, 0x108, 0x1e08040f);

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

if (state->is_cx25836)
if (is_cx2583x(state))
break;

/* src1_ctl = 0x08010000 */
Expand All @@ -142,22 +142,22 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
break;

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


if (!state->is_cx231xx) {
if (!is_cx231xx(state)) {
/* VID_PLL and AUX_PLL */
cx25840_write4(client, 0x108, 0x1809040f);

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

if (state->is_cx25836)
if (is_cx2583x(state))
break;

/* src1_ctl = 0x08010000 */
Expand All @@ -170,18 +170,18 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
break;

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

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

if (state->is_cx25836)
if (is_cx2583x(state))
break;

if (!state->is_cx23885 && !state->is_cx231xx) {
if (!is_cx2388x(state) && !is_cx231xx(state)) {
/* src1_ctl */
cx25840_write4(client, 0x8f8, 0x08018000);

Expand Down Expand Up @@ -243,7 +243,7 @@ void cx25840_audio_set_path(struct i2c_client *client)
cx25840_and_or(client, 0x810, ~0x1, 0x00);

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

Expand Down Expand Up @@ -383,7 +383,7 @@ int cx25840_s_clock_freq(struct v4l2_subdev *sd, u32 freq)
struct cx25840_state *state = to_state(sd);
int retval;

if (!state->is_cx25836)
if (!is_cx2583x(state))
cx25840_and_or(client, 0x810, ~0x1, 1);
if (state->aud_input != CX25840_AUDIO_SERIAL) {
cx25840_and_or(client, 0x803, ~0x10, 0);
Expand All @@ -392,7 +392,7 @@ int cx25840_s_clock_freq(struct v4l2_subdev *sd, u32 freq)
retval = set_audclk_freq(client, freq);
if (state->aud_input != CX25840_AUDIO_SERIAL)
cx25840_and_or(client, 0x803, ~0x10, 0x10);
if (!state->is_cx25836)
if (!is_cx2583x(state))
cx25840_and_or(client, 0x810, ~0x1, 0);
return retval;
}
Expand Down
Loading

0 comments on commit 5473992

Please sign in to comment.