Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] em28xx-audio: make sure audio is unmuted on open()

In all cases, when the first capture is called, we need to
call the code that unmutes the volume.

Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>

authored by

Frank Schaefer and committed by
Mauro Carvalho Chehab
ba35ca07 22a5ea91

+21 -19
+21 -19
drivers/media/usb/em28xx/em28xx-audio.c
··· 273 273 mutex_lock(&dev->lock); 274 274 275 275 runtime->hw = snd_em28xx_hw_capture; 276 - if ((dev->alt == 0 || dev->is_audio_only) && dev->adev.users == 0) { 277 - if (dev->is_audio_only) 278 - /* vendor audio is on a separate interface */ 279 - dev->alt = 1; 280 - else 281 - /* vendor audio is on the same interface as video */ 282 - dev->alt = 7; 283 - /* 284 - * FIXME: The intention seems to be to select the alt 285 - * setting with the largest wMaxPacketSize for the video 286 - * endpoint. 287 - * At least dev->alt should be used instead, but we 288 - * should probably not touch it at all if it is 289 - * already >0, because wMaxPacketSize of the audio 290 - * endpoints seems to be the same for all. 291 - */ 292 276 293 - dprintk("changing alternate number on interface %d to %d\n", 294 - dev->ifnum, dev->alt); 295 - usb_set_interface(dev->udev, dev->ifnum, dev->alt); 277 + if (dev->adev.users == 0) { 278 + if (dev->alt == 0 || dev->is_audio_only) { 279 + if (dev->is_audio_only) 280 + /* audio is on a separate interface */ 281 + dev->alt = 1; 282 + else 283 + /* audio is on the same interface as video */ 284 + dev->alt = 7; 285 + /* 286 + * FIXME: The intention seems to be to select 287 + * the alt setting with the largest 288 + * wMaxPacketSize for the video endpoint. 289 + * At least dev->alt should be used instead, but 290 + * we should probably not touch it at all if it 291 + * is already >0, because wMaxPacketSize of the 292 + * audio endpoints seems to be the same for all. 293 + */ 294 + dprintk("changing alternate number on interface %d to %d\n", 295 + dev->ifnum, dev->alt); 296 + usb_set_interface(dev->udev, dev->ifnum, dev->alt); 297 + } 296 298 297 299 /* Sets volume, mute, etc */ 298 300 dev->mute = 0;