aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-01-05 07:53:54 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:04:30 -0500
commit539c96d0fd86bfdcfac75c88b74aa5798439293d (patch)
treefb72c663b71fb2e9eef6eeaf859e774c8bb027a8 /drivers/media/video/em28xx/em28xx-video.c
parent6596a4f6032f13f1bef47550fcf1d4134cd978a4 (diff)
V4L/DVB (6947): Improve audio setup handling
It is possible to select audio inputs via em28xx or via ac97 functions. This patch allows configuring a board to use either one way. It also do some cleanups at audio setup configurations. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-video.c')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index c2901f13eb25..1a284cb18c24 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -122,11 +122,13 @@ static int em28xx_config(struct em28xx *dev)
122/* em28xx_write_regs_req(dev,0x00,0x0f,"\x80",1); clk register */ 122/* em28xx_write_regs_req(dev,0x00,0x0f,"\x80",1); clk register */
123 em28xx_write_regs_req(dev,0x00,0x11,"\x51",1); 123 em28xx_write_regs_req(dev,0x00,0x11,"\x51",1);
124 124
125 em28xx_audio_usb_mute(dev, 1);
126 dev->mute = 1; /* maybe not the right place... */ 125 dev->mute = 1; /* maybe not the right place... */
127 dev->volume = 0x1f; 126 dev->volume = 0x1f;
127
128 /* Init XCLK_REG, audio muted */
129 dev->em28xx_write_regs(dev, XCLK_REG, "\x87", 1);
130
128 em28xx_audio_analog_set(dev); 131 em28xx_audio_analog_set(dev);
129 em28xx_audio_analog_setup(dev);
130 em28xx_outfmt_set_yuv422(dev); 132 em28xx_outfmt_set_yuv422(dev);
131 em28xx_colorlevels_set_default(dev); 133 em28xx_colorlevels_set_default(dev);
132 em28xx_compression_disable(dev); 134 em28xx_compression_disable(dev);
@@ -168,7 +170,6 @@ static void em28xx_empty_framequeues(struct em28xx *dev)
168 170
169static void video_mux(struct em28xx *dev, int index) 171static void video_mux(struct em28xx *dev, int index)
170{ 172{
171 int ainput;
172 struct v4l2_routing route; 173 struct v4l2_routing route;
173 174
174 route.input = INPUT(index)->vmux; 175 route.input = INPUT(index)->vmux;
@@ -185,18 +186,9 @@ static void video_mux(struct em28xx *dev, int index)
185 route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); 186 route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1);
186 /* Note: this is msp3400 specific */ 187 /* Note: this is msp3400 specific */
187 em28xx_i2c_call_clients(dev, VIDIOC_INT_S_AUDIO_ROUTING, &route); 188 em28xx_i2c_call_clients(dev, VIDIOC_INT_S_AUDIO_ROUTING, &route);
188 ainput = EM28XX_AUDIO_SRC_TUNER;
189 em28xx_audio_source(dev, ainput);
190 } else {
191 switch (dev->ctl_ainput) {
192 case 0:
193 ainput = EM28XX_AUDIO_SRC_TUNER;
194 break;
195 default:
196 ainput = EM28XX_AUDIO_SRC_LINE;
197 }
198 em28xx_audio_source(dev, ainput);
199 } 189 }
190
191 em28xx_set_audio_source(dev);
200} 192}
201 193
202/* Usage lock check functions */ 194/* Usage lock check functions */
@@ -292,7 +284,6 @@ static int em28xx_set_ctrl(struct em28xx *dev, const struct v4l2_control *ctrl)
292 case V4L2_CID_AUDIO_MUTE: 284 case V4L2_CID_AUDIO_MUTE:
293 if (ctrl->value != dev->mute) { 285 if (ctrl->value != dev->mute) {
294 dev->mute = ctrl->value; 286 dev->mute = ctrl->value;
295 em28xx_audio_usb_mute(dev, ctrl->value);
296 return em28xx_audio_analog_set(dev); 287 return em28xx_audio_analog_set(dev);
297 } 288 }
298 return 0; 289 return 0;