diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-08-28 14:42:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-08-28 14:42:00 -0400 |
commit | b29083c5e52481e8ce6ce0007590f7a1f405018b (patch) | |
tree | 6b98c666171d37d2f1d959bff26ff064d1f05737 | |
parent | 4941b8f0c2b9d88e8a6dacebf8b7faf603b98368 (diff) | |
parent | c7cd0ef66aade29e37ee08821a0e195ee776c6e6 (diff) |
Merge tag 'sound-fix-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"Here are stable fixes that have been gathered since rc8: fixes for
HD-audio widget power control regressions since 4.1, a NULL fix for
HD-audio HDMI, a noise fix for Conexant codecs and a quirk addition
for USB-Audio DSD"
* tag 'sound-fix-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda - Fix path power activation
ALSA: hda - Check all inputs for is_active_nid_for_any()
ALSA: hda: fix possible NULL dereference
ALSA: hda - Shutdown CX20722 on reboot/free to avoid spurious noises
ALSA: usb: Add native DSD support for Gustard DAC-X20U
-rw-r--r-- | sound/pci/hda/hda_codec.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_generic.c | 11 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 23 | ||||
-rw-r--r-- | sound/usb/quirks.c | 1 |
4 files changed, 28 insertions, 9 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 5de3c5d8c2c0..d1a2cb65e27c 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -3172,7 +3172,7 @@ static int add_std_chmaps(struct hda_codec *codec) | |||
3172 | struct snd_pcm_chmap *chmap; | 3172 | struct snd_pcm_chmap *chmap; |
3173 | const struct snd_pcm_chmap_elem *elem; | 3173 | const struct snd_pcm_chmap_elem *elem; |
3174 | 3174 | ||
3175 | if (!pcm || pcm->own_chmap || | 3175 | if (!pcm || !pcm->pcm || pcm->own_chmap || |
3176 | !hinfo->substreams) | 3176 | !hinfo->substreams) |
3177 | continue; | 3177 | continue; |
3178 | elem = hinfo->chmap ? hinfo->chmap : snd_pcm_std_chmaps; | 3178 | elem = hinfo->chmap ? hinfo->chmap : snd_pcm_std_chmaps; |
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index b077bb644434..24f91114a32c 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
@@ -671,7 +671,8 @@ static bool is_active_nid(struct hda_codec *codec, hda_nid_t nid, | |||
671 | } | 671 | } |
672 | for (i = 0; i < path->depth; i++) { | 672 | for (i = 0; i < path->depth; i++) { |
673 | if (path->path[i] == nid) { | 673 | if (path->path[i] == nid) { |
674 | if (dir == HDA_OUTPUT || path->idx[i] == idx) | 674 | if (dir == HDA_OUTPUT || idx == -1 || |
675 | path->idx[i] == idx) | ||
675 | return true; | 676 | return true; |
676 | break; | 677 | break; |
677 | } | 678 | } |
@@ -682,7 +683,7 @@ static bool is_active_nid(struct hda_codec *codec, hda_nid_t nid, | |||
682 | 683 | ||
683 | /* check whether the NID is referred by any active paths */ | 684 | /* check whether the NID is referred by any active paths */ |
684 | #define is_active_nid_for_any(codec, nid) \ | 685 | #define is_active_nid_for_any(codec, nid) \ |
685 | is_active_nid(codec, nid, HDA_OUTPUT, 0) | 686 | is_active_nid(codec, nid, HDA_OUTPUT, -1) |
686 | 687 | ||
687 | /* get the default amp value for the target state */ | 688 | /* get the default amp value for the target state */ |
688 | static int get_amp_val_to_activate(struct hda_codec *codec, hda_nid_t nid, | 689 | static int get_amp_val_to_activate(struct hda_codec *codec, hda_nid_t nid, |
@@ -883,8 +884,7 @@ void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path, | |||
883 | struct hda_gen_spec *spec = codec->spec; | 884 | struct hda_gen_spec *spec = codec->spec; |
884 | int i; | 885 | int i; |
885 | 886 | ||
886 | if (!enable) | 887 | path->active = enable; |
887 | path->active = false; | ||
888 | 888 | ||
889 | /* make sure the widget is powered up */ | 889 | /* make sure the widget is powered up */ |
890 | if (enable && (spec->power_down_unused || codec->power_save_node)) | 890 | if (enable && (spec->power_down_unused || codec->power_save_node)) |
@@ -902,9 +902,6 @@ void snd_hda_activate_path(struct hda_codec *codec, struct nid_path *path, | |||
902 | if (has_amp_out(codec, path, i)) | 902 | if (has_amp_out(codec, path, i)) |
903 | activate_amp_out(codec, path, i, enable); | 903 | activate_amp_out(codec, path, i, enable); |
904 | } | 904 | } |
905 | |||
906 | if (enable) | ||
907 | path->active = true; | ||
908 | } | 905 | } |
909 | EXPORT_SYMBOL_GPL(snd_hda_activate_path); | 906 | EXPORT_SYMBOL_GPL(snd_hda_activate_path); |
910 | 907 | ||
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index f788a91b544a..ca03c40609fc 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -200,12 +200,33 @@ static int cx_auto_init(struct hda_codec *codec) | |||
200 | return 0; | 200 | return 0; |
201 | } | 201 | } |
202 | 202 | ||
203 | #define cx_auto_free snd_hda_gen_free | 203 | static void cx_auto_reboot_notify(struct hda_codec *codec) |
204 | { | ||
205 | struct conexant_spec *spec = codec->spec; | ||
206 | |||
207 | if (codec->core.vendor_id != 0x14f150f2) | ||
208 | return; | ||
209 | |||
210 | /* Turn the CX20722 codec into D3 to avoid spurious noises | ||
211 | from the internal speaker during (and after) reboot */ | ||
212 | cx_auto_turn_eapd(codec, spec->num_eapds, spec->eapds, false); | ||
213 | |||
214 | snd_hda_codec_set_power_to_all(codec, codec->core.afg, AC_PWRST_D3); | ||
215 | snd_hda_codec_write(codec, codec->core.afg, 0, | ||
216 | AC_VERB_SET_POWER_STATE, AC_PWRST_D3); | ||
217 | } | ||
218 | |||
219 | static void cx_auto_free(struct hda_codec *codec) | ||
220 | { | ||
221 | cx_auto_reboot_notify(codec); | ||
222 | snd_hda_gen_free(codec); | ||
223 | } | ||
204 | 224 | ||
205 | static const struct hda_codec_ops cx_auto_patch_ops = { | 225 | static const struct hda_codec_ops cx_auto_patch_ops = { |
206 | .build_controls = cx_auto_build_controls, | 226 | .build_controls = cx_auto_build_controls, |
207 | .build_pcms = snd_hda_gen_build_pcms, | 227 | .build_pcms = snd_hda_gen_build_pcms, |
208 | .init = cx_auto_init, | 228 | .init = cx_auto_init, |
229 | .reboot_notify = cx_auto_reboot_notify, | ||
209 | .free = cx_auto_free, | 230 | .free = cx_auto_free, |
210 | .unsol_event = snd_hda_jack_unsol_event, | 231 | .unsol_event = snd_hda_jack_unsol_event, |
211 | #ifdef CONFIG_PM | 232 | #ifdef CONFIG_PM |
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 754e689596a2..00ebc0ca008e 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c | |||
@@ -1268,6 +1268,7 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, | |||
1268 | return SNDRV_PCM_FMTBIT_DSD_U32_BE; | 1268 | return SNDRV_PCM_FMTBIT_DSD_U32_BE; |
1269 | break; | 1269 | break; |
1270 | 1270 | ||
1271 | case USB_ID(0x20b1, 0x000a): /* Gustard DAC-X20U */ | ||
1271 | case USB_ID(0x20b1, 0x2009): /* DIYINHK DSD DXD 384kHz USB to I2S/DSD */ | 1272 | case USB_ID(0x20b1, 0x2009): /* DIYINHK DSD DXD 384kHz USB to I2S/DSD */ |
1272 | case USB_ID(0x20b1, 0x2023): /* JLsounds I2SoverUSB */ | 1273 | case USB_ID(0x20b1, 0x2023): /* JLsounds I2SoverUSB */ |
1273 | if (fp->altsetting == 3) | 1274 | if (fp->altsetting == 3) |