android_kernel_google_msm/sound/usb
Anssi Hannula d359d1d221 ALSA: usb-audio: Add a more accurate volume quirk for AudioQuest DragonFly
commit 42e3121d90f42e57f6dbd6083dff2f57b3ec7daa upstream.

AudioQuest DragonFly DAC reports a volume control range of 0..50
(0x0000..0x0032) which in USB Audio means a range of 0 .. 0.2dB, which
is obviously incorrect and would cause software using the dB information
in e.g. volume sliders to have a massive volume difference in 100..102%
range.

Commit 2d1cb7f658fb ("ALSA: usb-audio: add dB range mapping for some
devices") added a dB range mapping for it with range 0..50 dB.

However, the actual volume mapping seems to be neither linear volume nor
linear dB scale, but instead quite close to the cubic mapping e.g.
alsamixer uses, with a range of approx. -53...0 dB.

Replace the previous quirk with a custom dB mapping based on some basic
output measurements, using a 10-item range TLV (which will still fit in
alsa-lib MAX_TLV_RANGE_SIZE).

Tested on AudioQuest DragonFly HW v1.2. The quirk is only applied if the
range is 0..50, so if this gets fixed/changed in later HW revisions it
will no longer be applied.

v2: incorporated Takashi Iwai's suggestion for the quirk application
method

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
[lizf: Backoported to 3.4: use dev_info() instead of usb_audio_info()]
Signed-off-by: Zefan Li <lizefan@huawei.com>
2016-03-21 09:17:58 +08:00
..
6fire ALSA: 6fire: make buffers DMA-able (midi) 2014-04-14 06:44:30 -07:00
caiaq
misc ALSA: ua101: Fix unlocked snd_pcm_stop() call 2014-03-11 16:10:08 -07:00
usx2y ALSA: usx2y: Fix unlocked snd_pcm_stop() call 2014-03-11 16:10:08 -07:00
card.c ALSA: usb-audio: Fix device_del() sysfs warnings at disconnect 2015-02-02 17:05:14 +08:00
card.h ALSA: usb: Add quirk for 192KHz recording on E-Mu devices 2014-04-14 06:44:22 -07:00
clock.c
clock.h
debug.h
endpoint.c ALSA: usb: Add quirk for 192KHz recording on E-Mu devices 2014-04-14 06:44:22 -07:00
endpoint.h
format.c
format.h
helper.c
helper.h
Kconfig
Makefile
midi.c ALSA: usb-audio: Don't resubmit pending URBs at MIDI error recovery 2015-04-14 17:33:45 +08:00
midi.h
mixer.c ALSA: usb-audio: Add a more accurate volume quirk for AudioQuest DragonFly 2016-03-21 09:17:58 +08:00
mixer.h
mixer_maps.c ALSA: usb-audio: Add a more accurate volume quirk for AudioQuest DragonFly 2016-03-21 09:17:58 +08:00
mixer_quirks.c ALSA: usb-audio: Add a more accurate volume quirk for AudioQuest DragonFly 2016-03-21 09:17:58 +08:00
mixer_quirks.h ALSA: usb-audio: Add a more accurate volume quirk for AudioQuest DragonFly 2016-03-21 09:17:58 +08:00
pcm.c
pcm.h
power.h
proc.c
proc.h
quirks-table.h ALSA: usb-audio: Add MIDI support for Steinberg MI2/MI4 2016-03-21 09:17:41 +08:00
quirks.c ALSA: usb: Add quirk for 192KHz recording on E-Mu devices 2014-04-14 06:44:22 -07:00
quirks.h
stream.c ALSA: snd-usb: try harder to find USB_DT_CS_ENDPOINT 2013-05-07 19:51:55 -07:00
stream.h
usbaudio.h