diff options
| author | Frank Schaefer <fschaefer.oss@googlemail.com> | 2014-01-17 12:18:43 -0500 |
|---|---|---|
| committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-03-14 09:17:18 -0400 |
| commit | ba35ca07080268af1badeb47de0f9eff28126339 (patch) | |
| tree | 06e248461b91a1a09550c5963588b5e6b74466e8 | |
| parent | 22a5ea91df52392f98ff7ff66a1dce2c07e68568 (diff) | |
[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>
| -rw-r--r-- | drivers/media/usb/em28xx/em28xx-audio.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c index f75c0a5494d6..c1937ea1fca3 100644 --- a/drivers/media/usb/em28xx/em28xx-audio.c +++ b/drivers/media/usb/em28xx/em28xx-audio.c | |||
| @@ -273,26 +273,28 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) | |||
| 273 | mutex_lock(&dev->lock); | 273 | mutex_lock(&dev->lock); |
| 274 | 274 | ||
| 275 | runtime->hw = snd_em28xx_hw_capture; | 275 | runtime->hw = snd_em28xx_hw_capture; |
| 276 | if ((dev->alt == 0 || dev->is_audio_only) && dev->adev.users == 0) { | 276 | |
| 277 | if (dev->is_audio_only) | 277 | if (dev->adev.users == 0) { |
| 278 | /* vendor audio is on a separate interface */ | 278 | if (dev->alt == 0 || dev->is_audio_only) { |
| 279 | dev->alt = 1; | 279 | if (dev->is_audio_only) |
| 280 | else | 280 | /* audio is on a separate interface */ |
| 281 | /* vendor audio is on the same interface as video */ | 281 | dev->alt = 1; |
| 282 | dev->alt = 7; | 282 | else |
| 283 | /* | 283 | /* audio is on the same interface as video */ |
| 284 | * FIXME: The intention seems to be to select the alt | 284 | dev->alt = 7; |
| 285 | * setting with the largest wMaxPacketSize for the video | 285 | /* |
| 286 | * endpoint. | 286 | * FIXME: The intention seems to be to select |
| 287 | * At least dev->alt should be used instead, but we | 287 | * the alt setting with the largest |
| 288 | * should probably not touch it at all if it is | 288 | * wMaxPacketSize for the video endpoint. |
| 289 | * already >0, because wMaxPacketSize of the audio | 289 | * At least dev->alt should be used instead, but |
| 290 | * endpoints seems to be the same for all. | 290 | * we should probably not touch it at all if it |
| 291 | */ | 291 | * is already >0, because wMaxPacketSize of the |
| 292 | 292 | * audio endpoints seems to be the same for all. | |
| 293 | dprintk("changing alternate number on interface %d to %d\n", | 293 | */ |
| 294 | dev->ifnum, dev->alt); | 294 | dprintk("changing alternate number on interface %d to %d\n", |
| 295 | usb_set_interface(dev->udev, dev->ifnum, dev->alt); | 295 | dev->ifnum, dev->alt); |
| 296 | usb_set_interface(dev->udev, dev->ifnum, dev->alt); | ||
| 297 | } | ||
| 296 | 298 | ||
| 297 | /* Sets volume, mute, etc */ | 299 | /* Sets volume, mute, etc */ |
| 298 | dev->mute = 0; | 300 | dev->mute = 0; |
