Merge branch 'for-linus' into for-next

This commit is contained in:
Takashi Iwai
2016-09-29 18:20:14 +02:00
4 changed files with 32 additions and 6 deletions

View File

@@ -1831,6 +1831,7 @@ void snd_usb_mixer_rc_memory_change(struct usb_mixer_interface *mixer,
}
static void snd_dragonfly_quirk_db_scale(struct usb_mixer_interface *mixer,
struct usb_mixer_elem_info *cval,
struct snd_kcontrol *kctl)
{
/* 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,
41, 50, TLV_DB_MINMAX_ITEM(-441, 0),
);
usb_audio_info(mixer->chip, "applying DragonFly dB scale quirk\n");
kctl->tlv.p = scale;
kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ;
kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
if (cval->min == 0 && cval->max == 50) {
usb_audio_info(mixer->chip, "applying DragonFly dB scale quirk (0-50 variant)\n");
kctl->tlv.p = scale;
kctl->vd[0].access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ;
kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
} else if (cval->min == 0 && cval->max <= 1000) {
/* Some other clearly broken DragonFly variant.
* At least a 0..53 variant (hw v1.0) exists.
*/
usb_audio_info(mixer->chip, "ignoring too narrow dB range on a DragonFly device");
kctl->vd[0].access &= ~SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK;
}
}
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,
{
switch (mixer->chip->usb_id) {
case USB_ID(0x21b4, 0x0081): /* AudioQuest DragonFly */
if (unitid == 7 && cval->min == 0 && cval->max == 50)
snd_dragonfly_quirk_db_scale(mixer, kctl);
if (unitid == 7 && cval->control == UAC_FU_VOLUME)
snd_dragonfly_quirk_db_scale(mixer, cval, kctl);
break;
}
}