提交 5af79f86 编写于 作者: S Sven Barth 提交者: Mauro Carvalho Chehab

[media] Add support for AUX_PLL on cx2583x chips

This adds support for the AUX_PLL in cx2583x chips which is available in
those although the audio part of the chip is not.
The AUX_PLL is used at least by Terratec in their Grabster AV400 device.
Signed-off-by: NSven Barth <pascaldragon@googlemail.com>
Acked-by: NMike Isely <isely@pobox.com>
Reviewed-by: NAndy Walls <awalls@md.metrocast.net>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 94399431
...@@ -437,6 +437,7 @@ void cx25840_audio_set_path(struct i2c_client *client) ...@@ -437,6 +437,7 @@ void cx25840_audio_set_path(struct i2c_client *client)
{ {
struct cx25840_state *state = to_state(i2c_get_clientdata(client)); struct cx25840_state *state = to_state(i2c_get_clientdata(client));
if (!is_cx2583x(state)) {
/* assert soft reset */ /* assert soft reset */
cx25840_and_or(client, 0x810, ~0x1, 0x01); cx25840_and_or(client, 0x810, ~0x1, 0x01);
...@@ -457,9 +458,11 @@ void cx25840_audio_set_path(struct i2c_client *client) ...@@ -457,9 +458,11 @@ void cx25840_audio_set_path(struct i2c_client *client)
/* Set Path1 to Analog Demod Main Channel */ /* Set Path1 to Analog Demod Main Channel */
cx25840_write4(client, 0x8d0, 0x1f063870); cx25840_write4(client, 0x8d0, 0x1f063870);
} }
}
set_audclk_freq(client, state->audclk_freq); set_audclk_freq(client, state->audclk_freq);
if (!is_cx2583x(state)) {
if (state->aud_input != CX25840_AUDIO_SERIAL) { if (state->aud_input != CX25840_AUDIO_SERIAL) {
/* When the microcontroller detects the /* When the microcontroller detects the
* audio format, it will unmute the lines */ * audio format, it will unmute the lines */
...@@ -472,6 +475,7 @@ void cx25840_audio_set_path(struct i2c_client *client) ...@@ -472,6 +475,7 @@ void cx25840_audio_set_path(struct i2c_client *client)
/* Ensure the controller is running when we exit */ /* Ensure the controller is running when we exit */
if (is_cx2388x(state) || is_cx231xx(state)) if (is_cx2388x(state) || is_cx231xx(state))
cx25840_and_or(client, 0x803, ~0x10, 0x10); cx25840_and_or(client, 0x803, ~0x10, 0x10);
}
} }
static void set_volume(struct i2c_client *client, int volume) static void set_volume(struct i2c_client *client, int volume)
......
...@@ -870,6 +870,11 @@ static void input_change(struct i2c_client *client) ...@@ -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, 0);
cx25840_and_or(client, 0x401, ~0x60, 0x60); 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); cx25840_and_or(client, 0x810, ~0x01, 1);
if (state->radio) { if (state->radio) {
...@@ -1028,10 +1033,8 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp ...@@ -1028,10 +1033,8 @@ static int set_input(struct i2c_client *client, enum cx25840_video_input vid_inp
state->vid_input = vid_input; state->vid_input = vid_input;
state->aud_input = aud_input; state->aud_input = aud_input;
if (!is_cx2583x(state)) {
cx25840_audio_set_path(client); cx25840_audio_set_path(client);
input_change(client); input_change(client);
}
if (is_cx2388x(state)) { if (is_cx2388x(state)) {
/* Audio channel 1 src : Parallel 1 */ /* Audio channel 1 src : Parallel 1 */
...@@ -1552,8 +1555,6 @@ static int cx25840_s_audio_routing(struct v4l2_subdev *sd, ...@@ -1552,8 +1555,6 @@ static int cx25840_s_audio_routing(struct v4l2_subdev *sd,
struct cx25840_state *state = to_state(sd); struct cx25840_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd); struct i2c_client *client = v4l2_get_subdevdata(sd);
if (is_cx2583x(state))
return -EINVAL;
return set_input(client, state->vid_input, input); return set_input(client, state->vid_input, input);
} }
...@@ -1562,7 +1563,6 @@ static int cx25840_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *fr ...@@ -1562,7 +1563,6 @@ static int cx25840_s_frequency(struct v4l2_subdev *sd, struct v4l2_frequency *fr
struct cx25840_state *state = to_state(sd); struct cx25840_state *state = to_state(sd);
struct i2c_client *client = v4l2_get_subdevdata(sd); struct i2c_client *client = v4l2_get_subdevdata(sd);
if (!is_cx2583x(state))
input_change(client); input_change(client);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册