Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219443
b: refs/heads/master
c: 5af79f8
h: refs/heads/master
i:
  219441: 921cff4
  219439: ffa076d
v: v3
  • Loading branch information
Sven Barth authored and Mauro Carvalho Chehab committed Oct 21, 2010
1 parent 88845cf commit 42705ba
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 34 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: 94399431379dfc77565c9861013f41ab0078c18b
refs/heads/master: 5af79f86db6a29a158510b5dc255d8844d95c4e9
54 changes: 29 additions & 25 deletions trunk/drivers/media/video/cx25840/cx25840-audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,41 +437,45 @@ void cx25840_audio_set_path(struct i2c_client *client)
{
struct cx25840_state *state = to_state(i2c_get_clientdata(client));

/* assert soft reset */
cx25840_and_or(client, 0x810, ~0x1, 0x01);
if (!is_cx2583x(state)) {
/* assert soft reset */
cx25840_and_or(client, 0x810, ~0x1, 0x01);

/* stop microcontroller */
cx25840_and_or(client, 0x803, ~0x10, 0);
/* stop microcontroller */
cx25840_and_or(client, 0x803, ~0x10, 0);

/* Mute everything to prevent the PFFT! */
cx25840_write(client, 0x8d3, 0x1f);
/* Mute everything to prevent the PFFT! */
cx25840_write(client, 0x8d3, 0x1f);

if (state->aud_input == CX25840_AUDIO_SERIAL) {
/* Set Path1 to Serial Audio Input */
cx25840_write4(client, 0x8d0, 0x01011012);
if (state->aud_input == CX25840_AUDIO_SERIAL) {
/* Set Path1 to Serial Audio Input */
cx25840_write4(client, 0x8d0, 0x01011012);

/* The microcontroller should not be started for the
* non-tuner inputs: autodetection is specific for
* TV audio. */
} else {
/* Set Path1 to Analog Demod Main Channel */
cx25840_write4(client, 0x8d0, 0x1f063870);
/* The microcontroller should not be started for the
* non-tuner inputs: autodetection is specific for
* TV audio. */
} else {
/* Set Path1 to Analog Demod Main Channel */
cx25840_write4(client, 0x8d0, 0x1f063870);
}
}

set_audclk_freq(client, state->audclk_freq);

if (state->aud_input != CX25840_AUDIO_SERIAL) {
/* When the microcontroller detects the
* audio format, it will unmute the lines */
cx25840_and_or(client, 0x803, ~0x10, 0x10);
}
if (!is_cx2583x(state)) {
if (state->aud_input != CX25840_AUDIO_SERIAL) {
/* When the microcontroller detects the
* audio format, it will unmute the lines */
cx25840_and_or(client, 0x803, ~0x10, 0x10);
}

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

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

static void set_volume(struct i2c_client *client, int volume)
Expand Down
16 changes: 8 additions & 8 deletions trunk/drivers/media/video/cx25840/cx25840-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,11 @@ static void input_change(struct i2c_client *client)
}
cx25840_and_or(client, 0x401, ~0x60, 0);
cx25840_and_or(client, 0x401, ~0x60, 0x60);

/* Don't write into audio registers on cx2583x chips */
if (is_cx2583x(state))
return;

cx25840_and_or(client, 0x810, ~0x01, 1);

if (state->radio) {
Expand Down Expand Up @@ -1028,10 +1033,8 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp

state->vid_input = vid_input;
state->aud_input = aud_input;
if (!is_cx2583x(state)) {
cx25840_audio_set_path(client);
input_change(client);
}
cx25840_audio_set_path(client);
input_change(client);

if (is_cx2388x(state)) {
/* Audio channel 1 src : Parallel 1 */
Expand Down Expand Up @@ -1552,8 +1555,6 @@ static int cx25840_s_audio_routing(struct v4l2_subdev *sd,
struct cx25840_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);

if (is_cx2583x(state))
return -EINVAL;
return set_input(client, state->vid_input, input);
}

Expand All @@ -1562,8 +1563,7 @@ static int cx25840_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *fr
struct cx25840_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd);

if (!is_cx2583x(state))
input_change(client);
input_change(client);
return 0;
}

Expand Down

0 comments on commit 42705ba

Please sign in to comment.