Skip to content

Commit b29083c

Browse files
committed
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
2 parents 4941b8f + c7cd0ef commit b29083c

File tree

4 files changed

+28
-9
lines changed

4 files changed

+28
-9
lines changed

sound/pci/hda/hda_codec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3172,7 +3172,7 @@ static int add_std_chmaps(struct hda_codec *codec)
31723172
struct snd_pcm_chmap *chmap;
31733173
const struct snd_pcm_chmap_elem *elem;
31743174

3175-
if (!pcm || pcm->own_chmap ||
3175+
if (!pcm || !pcm->pcm || pcm->own_chmap ||
31763176
!hinfo->substreams)
31773177
continue;
31783178
elem = hinfo->chmap ? hinfo->chmap : snd_pcm_std_chmaps;

sound/pci/hda/hda_generic.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,8 @@ static bool is_active_nid(struct hda_codec *codec, hda_nid_t nid,
671671
}
672672
for (i = 0; i < path->depth; i++) {
673673
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)
675676
return true;
676677
break;
677678
}
@@ -682,7 +683,7 @@ static bool is_active_nid(struct hda_codec *codec, hda_nid_t nid,
682683

683684
/* check whether the NID is referred by any active paths */
684685
#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)
686687

687688
/* get the default amp value for the target state */
688689
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,
883884
struct hda_gen_spec *spec = codec->spec;
884885
int i;
885886

886-
if (!enable)
887-
path->active = false;
887+
path->active = enable;
888888

889889
/* make sure the widget is powered up */
890890
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,
902902
if (has_amp_out(codec, path, i))
903903
activate_amp_out(codec, path, i, enable);
904904
}
905-
906-
if (enable)
907-
path->active = true;
908905
}
909906
EXPORT_SYMBOL_GPL(snd_hda_activate_path);
910907

sound/pci/hda/patch_conexant.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,33 @@ static int cx_auto_init(struct hda_codec *codec)
200200
return 0;
201201
}
202202

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+
}
204224

205225
static const struct hda_codec_ops cx_auto_patch_ops = {
206226
.build_controls = cx_auto_build_controls,
207227
.build_pcms = snd_hda_gen_build_pcms,
208228
.init = cx_auto_init,
229+
.reboot_notify = cx_auto_reboot_notify,
209230
.free = cx_auto_free,
210231
.unsol_event = snd_hda_jack_unsol_event,
211232
#ifdef CONFIG_PM

sound/usb/quirks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,7 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
12681268
return SNDRV_PCM_FMTBIT_DSD_U32_BE;
12691269
break;
12701270

1271+
case USB_ID(0x20b1, 0x000a): /* Gustard DAC-X20U */
12711272
case USB_ID(0x20b1, 0x2009): /* DIYINHK DSD DXD 384kHz USB to I2S/DSD */
12721273
case USB_ID(0x20b1, 0x2023): /* JLsounds I2SoverUSB */
12731274
if (fp->altsetting == 3)

0 commit comments

Comments
 (0)