diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-09-29 12:20:14 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-09-29 12:20:14 -0400 |
commit | 3383c5c395386ac8e258b1a324c72ce850b84a9e (patch) | |
tree | 4b017990c3496f3928852b4a047e00c8e410033f /sound/usb | |
parent | 8da08ca03b73593d5299893bf29fc08569c3fb5f (diff) | |
parent | 0eec880966e77bdbee0112989a2be67d92e39929 (diff) |
Merge branch 'for-linus' into for-next
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/mixer_quirks.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index f6c3bf79af9a..04991b009132 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c | |||
@@ -1831,6 +1831,7 @@ void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer, | |||
1831 | } | 1831 | } |
1832 | 1832 | ||
1833 | static void snd_dragonfly_quirk_db_scale(struct usb_mixer_interface *mixer, | 1833 | static void snd_dragonfly_quirk_db_scale(struct usb_mixer_interface *mixer, |
1834 | struct usb_mixer_elem_info *cval, | ||
1834 | struct snd_kcontrol *kctl) | 1835 | struct snd_kcontrol *kctl) |
1835 | { | 1836 | { |
1836 | /* Approximation using 10 ranges based on output measurement on hw v1.2. | 1837 | /* Approximation using 10 ranges based on output measurement on hw v1.2. |
@@ -1848,10 +1849,19 @@ static void snd_dragonfly_quirk_db_scale(struct usb_mixer_interface *mixer, | |||
1848 | 41, 50, TLV_DB_MINMAX_ITEM(-441, 0), | 1849 | 41, 50, TLV_DB_MINMAX_ITEM(-441, 0), |
1849 | ); | 1850 | ); |
1850 | 1851 | ||
1851 | usb_audio_info(mixer->chip, "applying DragonFly dB scale quirk\n"); | 1852 | if (cval->min == 0 && cval->max == 50) { |
1852 | kctl->tlv.p = scale; | 1853 | usb_audio_info(mixer->chip, "applying DragonFly dB scale quirk (0-50 variant)\n"); |
1853 | kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ; | 1854 | kctl->tlv.p = scale; |
1854 | kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK; | 1855 | kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ; |
1856 | kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK; | ||
1857 | |||
1858 | } else if (cval->min == 0 && cval->max <= 1000) { | ||
1859 | /* Some other clearly broken DragonFly variant. | ||
1860 | * At least a 0..53 variant (hw v1.0) exists. | ||
1861 | */ | ||
1862 | usb_audio_info(mixer->chip, "ignoring too narrow dB range on a DragonFly device"); | ||
1863 | kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK; | ||
1864 | } | ||
1855 | } | 1865 | } |
1856 | 1866 | ||
1857 | void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer, | 1867 | void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer, |
@@ -1860,8 +1870,8 @@ void snd_usb_mixer_fu_apply_quirk(struct usb_mixer_interface *mixer, | |||
1860 | { | 1870 | { |
1861 | switch (mixer->chip->usb_id) { | 1871 | switch (mixer->chip->usb_id) { |
1862 | case USB_ID(0x21b4, 0x0081): /* AudioQuest DragonFly */ | 1872 | case USB_ID(0x21b4, 0x0081): /* AudioQuest DragonFly */ |
1863 | if (unitid == 7 && cval->min == 0 && cval->max == 50) | 1873 | if (unitid == 7 && cval->control == UAC_FU_VOLUME) |
1864 | snd_dragonfly_quirk_db_scale(mixer, kctl); | 1874 | snd_dragonfly_quirk_db_scale(mixer, cval, kctl); |
1865 | break; | 1875 | break; |
1866 | } | 1876 | } |
1867 | } | 1877 | } |