upstream: [media] em28xx-audio: don't wait for lock in non-block mode
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Sun, 12 Jan 2014 12:22:29 +0000 (09:22 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:54:28 +0000 (11:54 +0900)
commit1d456811ce4643889c9d6ad581bfe7e1c6ddd08e
tree45acb11cf443a58b1b0bfe0a34878aae233f0ecf
parent3742dd15aca9b4f681d37a33540ac61c3bf87704
upstream: [media] em28xx-audio: don't wait for lock in non-block mode

Pulseaudio has the bad habit of stopping a streaming audio if
a device, opened in non-block mode, waits.

It is impossible to avoid em28xx to wait, as it will send commands
via I2C, and other I2C operations may be happening (firmware
transfers, Remote Controller polling, etc). Yet, as each em28xx
subdriver locks em28xx-dev to protect the access to the hardware,
it is possible to minimize the audio glitches by returning -EAGAIN
to pulseaudio, if the lock is already taken by another subdriver.

Reported-by: Antti Palosaari <crope@iki.fi>
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/usb/em28xx/em28xx-audio.c