diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-06-28 11:49:20 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-20 06:15:19 -0400 |
commit | 81cb727d29eda7692a03be035b7228b4c3f6b610 (patch) | |
tree | f67766fa933419d80015624fc475448795733679 /drivers/media/video/cx18/cx18-audio.c | |
parent | f313da113fe083bfb1eb43377f551db4bbe702a6 (diff) |
V4L/DVB (8167): cx18: set correct audio inputs for tuner and line-in 2.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx18/cx18-audio.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-audio.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/media/video/cx18/cx18-audio.c b/drivers/media/video/cx18/cx18-audio.c index 1adc404d955e..6d5b94fc7087 100644 --- a/drivers/media/video/cx18/cx18-audio.c +++ b/drivers/media/video/cx18/cx18-audio.c | |||
@@ -26,13 +26,17 @@ | |||
26 | #include "cx18-cards.h" | 26 | #include "cx18-cards.h" |
27 | #include "cx18-audio.h" | 27 | #include "cx18-audio.h" |
28 | 28 | ||
29 | #define CX18_AUDIO_ENABLE 0xc72014 | ||
30 | |||
29 | /* Selects the audio input and output according to the current | 31 | /* Selects the audio input and output according to the current |
30 | settings. */ | 32 | settings. */ |
31 | int cx18_audio_set_io(struct cx18 *cx) | 33 | int cx18_audio_set_io(struct cx18 *cx) |
32 | { | 34 | { |
33 | struct v4l2_routing route; | 35 | struct v4l2_routing route; |
34 | u32 audio_input; | 36 | u32 audio_input; |
37 | u32 val; | ||
35 | int mux_input; | 38 | int mux_input; |
39 | int err; | ||
36 | 40 | ||
37 | /* Determine which input to use */ | 41 | /* Determine which input to use */ |
38 | if (test_bit(CX18_F_I_RADIO_USER, &cx->i_flags)) { | 42 | if (test_bit(CX18_F_I_RADIO_USER, &cx->i_flags)) { |
@@ -51,8 +55,17 @@ int cx18_audio_set_io(struct cx18 *cx) | |||
51 | cx18_i2c_hw(cx, cx->card->hw_muxer, VIDIOC_INT_S_AUDIO_ROUTING, &route); | 55 | cx18_i2c_hw(cx, cx->card->hw_muxer, VIDIOC_INT_S_AUDIO_ROUTING, &route); |
52 | 56 | ||
53 | route.input = audio_input; | 57 | route.input = audio_input; |
54 | return cx18_i2c_hw(cx, cx->card->hw_audio_ctrl, | 58 | err = cx18_i2c_hw(cx, cx->card->hw_audio_ctrl, |
55 | VIDIOC_INT_S_AUDIO_ROUTING, &route); | 59 | VIDIOC_INT_S_AUDIO_ROUTING, &route); |
60 | if (err) | ||
61 | return err; | ||
62 | |||
63 | val = read_reg(CX18_AUDIO_ENABLE) & ~0x30; | ||
64 | val |= (audio_input > CX18_AV_AUDIO_SERIAL2) ? 0x20 : | ||
65 | (audio_input << 4); | ||
66 | write_reg(val | 0xb00, CX18_AUDIO_ENABLE); | ||
67 | cx18_vapi(cx, CX18_APU_RESETAI, 1, 0); | ||
68 | return 0; | ||
56 | } | 69 | } |
57 | 70 | ||
58 | void cx18_audio_set_route(struct cx18 *cx, struct v4l2_routing *route) | 71 | void cx18_audio_set_route(struct cx18 *cx, struct v4l2_routing *route) |