aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/compress_driver.h6
-rw-r--r--include/sound/hda_codec.h1
-rw-r--r--sound/pci/hda/hda_bind.c3
-rw-r--r--sound/pci/hda/hda_intel.c2
-rw-r--r--sound/pci/hda/patch_ca0132.c4
-rw-r--r--sound/pci/hda/patch_realtek.c62
-rw-r--r--sound/usb/quirks.c1
7 files changed, 49 insertions, 30 deletions
diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h
index 0cdc3999ecfa..c5188ff724d1 100644
--- a/include/sound/compress_driver.h
+++ b/include/sound/compress_driver.h
@@ -173,7 +173,11 @@ static inline void snd_compr_drain_notify(struct snd_compr_stream *stream)
173 if (snd_BUG_ON(!stream)) 173 if (snd_BUG_ON(!stream))
174 return; 174 return;
175 175
176 stream->runtime->state = SNDRV_PCM_STATE_SETUP; 176 if (stream->direction == SND_COMPRESS_PLAYBACK)
177 stream->runtime->state = SNDRV_PCM_STATE_SETUP;
178 else
179 stream->runtime->state = SNDRV_PCM_STATE_PREPARED;
180
177 wake_up(&stream->runtime->sleep); 181 wake_up(&stream->runtime->sleep);
178} 182}
179 183
diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h
index 7fa48b100936..cc7c8d42d4fd 100644
--- a/include/sound/hda_codec.h
+++ b/include/sound/hda_codec.h
@@ -68,6 +68,7 @@ struct hda_bus {
68 unsigned int response_reset:1; /* controller was reset */ 68 unsigned int response_reset:1; /* controller was reset */
69 unsigned int in_reset:1; /* during reset operation */ 69 unsigned int in_reset:1; /* during reset operation */
70 unsigned int no_response_fallback:1; /* don't fallback at RIRB error */ 70 unsigned int no_response_fallback:1; /* don't fallback at RIRB error */
71 unsigned int bus_probing :1; /* during probing process */
71 72
72 int primary_dig_out_type; /* primary digital out PCM type */ 73 int primary_dig_out_type; /* primary digital out PCM type */
73 unsigned int mixer_assigned; /* codec addr for mixer name */ 74 unsigned int mixer_assigned; /* codec addr for mixer name */
diff --git a/sound/pci/hda/hda_bind.c b/sound/pci/hda/hda_bind.c
index 9174f1b3a987..1ec706ced75c 100644
--- a/sound/pci/hda/hda_bind.c
+++ b/sound/pci/hda/hda_bind.c
@@ -115,7 +115,8 @@ static int hda_codec_driver_probe(struct device *dev)
115 err = snd_hda_codec_build_controls(codec); 115 err = snd_hda_codec_build_controls(codec);
116 if (err < 0) 116 if (err < 0)
117 goto error_module; 117 goto error_module;
118 if (codec->card->registered) { 118 /* only register after the bus probe finished; otherwise it's racy */
119 if (!codec->bus->bus_probing && codec->card->registered) {
119 err = snd_card_register(codec->card); 120 err = snd_card_register(codec->card);
120 if (err < 0) 121 if (err < 0)
121 goto error_module; 122 goto error_module;
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index e784130ea4e0..e5c49003e75f 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2185,6 +2185,7 @@ static int azx_probe_continue(struct azx *chip)
2185 int dev = chip->dev_index; 2185 int dev = chip->dev_index;
2186 int err; 2186 int err;
2187 2187
2188 to_hda_bus(bus)->bus_probing = 1;
2188 hda->probe_continued = 1; 2189 hda->probe_continued = 1;
2189 2190
2190 /* bind with i915 if needed */ 2191 /* bind with i915 if needed */
@@ -2269,6 +2270,7 @@ out_free:
2269 if (err < 0) 2270 if (err < 0)
2270 hda->init_failed = 1; 2271 hda->init_failed = 1;
2271 complete_all(&hda->probe_wait); 2272 complete_all(&hda->probe_wait);
2273 to_hda_bus(bus)->bus_probing = 0;
2272 return err; 2274 return err;
2273} 2275}
2274 2276
diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index e5bdbc245682..29882bda7632 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -8451,8 +8451,10 @@ static void ca0132_free(struct hda_codec *codec)
8451 ca0132_exit_chip(codec); 8451 ca0132_exit_chip(codec);
8452 8452
8453 snd_hda_power_down(codec); 8453 snd_hda_power_down(codec);
8454 if (IS_ENABLED(CONFIG_PCI) && spec->mem_base) 8454#ifdef CONFIG_PCI
8455 if (spec->mem_base)
8455 pci_iounmap(codec->bus->pci, spec->mem_base); 8456 pci_iounmap(codec->bus->pci, spec->mem_base);
8457#endif
8456 kfree(spec->spec_init_verbs); 8458 kfree(spec->spec_init_verbs);
8457 kfree(codec->spec); 8459 kfree(codec->spec);
8458} 8460}
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 4139aced63f8..6df758adff84 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -515,6 +515,15 @@ static void alc_auto_init_amp(struct hda_codec *codec, int type)
515 } 515 }
516} 516}
517 517
518/* get a primary headphone pin if available */
519static hda_nid_t alc_get_hp_pin(struct alc_spec *spec)
520{
521 if (spec->gen.autocfg.hp_pins[0])
522 return spec->gen.autocfg.hp_pins[0];
523 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
524 return spec->gen.autocfg.line_out_pins[0];
525 return 0;
526}
518 527
519/* 528/*
520 * Realtek SSID verification 529 * Realtek SSID verification
@@ -725,9 +734,7 @@ do_sku:
725 * 15 : 1 --> enable the function "Mute internal speaker 734 * 15 : 1 --> enable the function "Mute internal speaker
726 * when the external headphone out jack is plugged" 735 * when the external headphone out jack is plugged"
727 */ 736 */
728 if (!spec->gen.autocfg.hp_pins[0] && 737 if (!alc_get_hp_pin(spec)) {
729 !(spec->gen.autocfg.line_out_pins[0] &&
730 spec->gen.autocfg.line_out_type == AUTO_PIN_HP_OUT)) {
731 hda_nid_t nid; 738 hda_nid_t nid;
732 tmp = (ass >> 11) & 0x3; /* HP to chassis */ 739 tmp = (ass >> 11) & 0x3; /* HP to chassis */
733 nid = ports[tmp]; 740 nid = ports[tmp];
@@ -2959,7 +2966,7 @@ static void alc282_restore_default_value(struct hda_codec *codec)
2959static void alc282_init(struct hda_codec *codec) 2966static void alc282_init(struct hda_codec *codec)
2960{ 2967{
2961 struct alc_spec *spec = codec->spec; 2968 struct alc_spec *spec = codec->spec;
2962 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; 2969 hda_nid_t hp_pin = alc_get_hp_pin(spec);
2963 bool hp_pin_sense; 2970 bool hp_pin_sense;
2964 int coef78; 2971 int coef78;
2965 2972
@@ -2996,7 +3003,7 @@ static void alc282_init(struct hda_codec *codec)
2996static void alc282_shutup(struct hda_codec *codec) 3003static void alc282_shutup(struct hda_codec *codec)
2997{ 3004{
2998 struct alc_spec *spec = codec->spec; 3005 struct alc_spec *spec = codec->spec;
2999 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; 3006 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3000 bool hp_pin_sense; 3007 bool hp_pin_sense;
3001 int coef78; 3008 int coef78;
3002 3009
@@ -3074,14 +3081,9 @@ static void alc283_restore_default_value(struct hda_codec *codec)
3074static void alc283_init(struct hda_codec *codec) 3081static void alc283_init(struct hda_codec *codec)
3075{ 3082{
3076 struct alc_spec *spec = codec->spec; 3083 struct alc_spec *spec = codec->spec;
3077 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; 3084 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3078 bool hp_pin_sense; 3085 bool hp_pin_sense;
3079 3086
3080 if (!spec->gen.autocfg.hp_outs) {
3081 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
3082 hp_pin = spec->gen.autocfg.line_out_pins[0];
3083 }
3084
3085 alc283_restore_default_value(codec); 3087 alc283_restore_default_value(codec);
3086 3088
3087 if (!hp_pin) 3089 if (!hp_pin)
@@ -3115,14 +3117,9 @@ static void alc283_init(struct hda_codec *codec)
3115static void alc283_shutup(struct hda_codec *codec) 3117static void alc283_shutup(struct hda_codec *codec)
3116{ 3118{
3117 struct alc_spec *spec = codec->spec; 3119 struct alc_spec *spec = codec->spec;
3118 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; 3120 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3119 bool hp_pin_sense; 3121 bool hp_pin_sense;
3120 3122
3121 if (!spec->gen.autocfg.hp_outs) {
3122 if (spec->gen.autocfg.line_out_type == AC_JACK_HP_OUT)
3123 hp_pin = spec->gen.autocfg.line_out_pins[0];
3124 }
3125
3126 if (!hp_pin) { 3123 if (!hp_pin) {
3127 alc269_shutup(codec); 3124 alc269_shutup(codec);
3128 return; 3125 return;
@@ -3156,7 +3153,7 @@ static void alc283_shutup(struct hda_codec *codec)
3156static void alc256_init(struct hda_codec *codec) 3153static void alc256_init(struct hda_codec *codec)
3157{ 3154{
3158 struct alc_spec *spec = codec->spec; 3155 struct alc_spec *spec = codec->spec;
3159 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; 3156 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3160 bool hp_pin_sense; 3157 bool hp_pin_sense;
3161 3158
3162 if (!hp_pin) 3159 if (!hp_pin)
@@ -3192,7 +3189,7 @@ static void alc256_init(struct hda_codec *codec)
3192static void alc256_shutup(struct hda_codec *codec) 3189static void alc256_shutup(struct hda_codec *codec)
3193{ 3190{
3194 struct alc_spec *spec = codec->spec; 3191 struct alc_spec *spec = codec->spec;
3195 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; 3192 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3196 bool hp_pin_sense; 3193 bool hp_pin_sense;
3197 3194
3198 if (!hp_pin) { 3195 if (!hp_pin) {
@@ -3228,7 +3225,7 @@ static void alc256_shutup(struct hda_codec *codec)
3228static void alc225_init(struct hda_codec *codec) 3225static void alc225_init(struct hda_codec *codec)
3229{ 3226{
3230 struct alc_spec *spec = codec->spec; 3227 struct alc_spec *spec = codec->spec;
3231 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; 3228 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3232 bool hp1_pin_sense, hp2_pin_sense; 3229 bool hp1_pin_sense, hp2_pin_sense;
3233 3230
3234 if (!hp_pin) 3231 if (!hp_pin)
@@ -3271,7 +3268,7 @@ static void alc225_init(struct hda_codec *codec)
3271static void alc225_shutup(struct hda_codec *codec) 3268static void alc225_shutup(struct hda_codec *codec)
3272{ 3269{
3273 struct alc_spec *spec = codec->spec; 3270 struct alc_spec *spec = codec->spec;
3274 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; 3271 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3275 bool hp1_pin_sense, hp2_pin_sense; 3272 bool hp1_pin_sense, hp2_pin_sense;
3276 3273
3277 if (!hp_pin) { 3274 if (!hp_pin) {
@@ -3315,7 +3312,7 @@ static void alc225_shutup(struct hda_codec *codec)
3315static void alc_default_init(struct hda_codec *codec) 3312static void alc_default_init(struct hda_codec *codec)
3316{ 3313{
3317 struct alc_spec *spec = codec->spec; 3314 struct alc_spec *spec = codec->spec;
3318 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; 3315 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3319 bool hp_pin_sense; 3316 bool hp_pin_sense;
3320 3317
3321 if (!hp_pin) 3318 if (!hp_pin)
@@ -3344,7 +3341,7 @@ static void alc_default_init(struct hda_codec *codec)
3344static void alc_default_shutup(struct hda_codec *codec) 3341static void alc_default_shutup(struct hda_codec *codec)
3345{ 3342{
3346 struct alc_spec *spec = codec->spec; 3343 struct alc_spec *spec = codec->spec;
3347 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; 3344 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3348 bool hp_pin_sense; 3345 bool hp_pin_sense;
3349 3346
3350 if (!hp_pin) { 3347 if (!hp_pin) {
@@ -3376,7 +3373,7 @@ static void alc_default_shutup(struct hda_codec *codec)
3376static void alc294_hp_init(struct hda_codec *codec) 3373static void alc294_hp_init(struct hda_codec *codec)
3377{ 3374{
3378 struct alc_spec *spec = codec->spec; 3375 struct alc_spec *spec = codec->spec;
3379 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; 3376 hda_nid_t hp_pin = alc_get_hp_pin(spec);
3380 int i, val; 3377 int i, val;
3381 3378
3382 if (!hp_pin) 3379 if (!hp_pin)
@@ -4780,7 +4777,7 @@ static void alc_update_headset_mode(struct hda_codec *codec)
4780 struct alc_spec *spec = codec->spec; 4777 struct alc_spec *spec = codec->spec;
4781 4778
4782 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; 4779 hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]];
4783 hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0]; 4780 hda_nid_t hp_pin = alc_get_hp_pin(spec);
4784 4781
4785 int new_headset_mode; 4782 int new_headset_mode;
4786 4783
@@ -5059,7 +5056,7 @@ static void alc_fixup_tpt470_dock(struct hda_codec *codec,
5059static void alc_shutup_dell_xps13(struct hda_codec *codec) 5056static void alc_shutup_dell_xps13(struct hda_codec *codec)
5060{ 5057{
5061 struct alc_spec *spec = codec->spec; 5058 struct alc_spec *spec = codec->spec;
5062 int hp_pin = spec->gen.autocfg.hp_pins[0]; 5059 int hp_pin = alc_get_hp_pin(spec);
5063 5060
5064 /* Prevent pop noises when headphones are plugged in */ 5061 /* Prevent pop noises when headphones are plugged in */
5065 snd_hda_codec_write(codec, hp_pin, 0, 5062 snd_hda_codec_write(codec, hp_pin, 0,
@@ -5152,7 +5149,7 @@ static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
5152 5149
5153 if (action == HDA_FIXUP_ACT_PROBE) { 5150 if (action == HDA_FIXUP_ACT_PROBE) {
5154 int mic_pin = find_ext_mic_pin(codec); 5151 int mic_pin = find_ext_mic_pin(codec);
5155 int hp_pin = spec->gen.autocfg.hp_pins[0]; 5152 int hp_pin = alc_get_hp_pin(spec);
5156 5153
5157 if (snd_BUG_ON(!mic_pin || !hp_pin)) 5154 if (snd_BUG_ON(!mic_pin || !hp_pin))
5158 return; 5155 return;
@@ -5634,6 +5631,7 @@ enum {
5634 ALC294_FIXUP_ASUS_HEADSET_MIC, 5631 ALC294_FIXUP_ASUS_HEADSET_MIC,
5635 ALC294_FIXUP_ASUS_SPK, 5632 ALC294_FIXUP_ASUS_SPK,
5636 ALC225_FIXUP_HEADSET_JACK, 5633 ALC225_FIXUP_HEADSET_JACK,
5634 ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE,
5637}; 5635};
5638 5636
5639static const struct hda_fixup alc269_fixups[] = { 5637static const struct hda_fixup alc269_fixups[] = {
@@ -6580,6 +6578,15 @@ static const struct hda_fixup alc269_fixups[] = {
6580 .type = HDA_FIXUP_FUNC, 6578 .type = HDA_FIXUP_FUNC,
6581 .v.func = alc_fixup_headset_jack, 6579 .v.func = alc_fixup_headset_jack,
6582 }, 6580 },
6581 [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = {
6582 .type = HDA_FIXUP_PINS,
6583 .v.pins = (const struct hda_pintbl[]) {
6584 { 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
6585 { }
6586 },
6587 .chained = true,
6588 .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC
6589 },
6583}; 6590};
6584 6591
6585static const struct snd_pci_quirk alc269_fixup_tbl[] = { 6592static const struct snd_pci_quirk alc269_fixup_tbl[] = {
@@ -6758,6 +6765,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6758 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), 6765 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC),
6759 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), 6766 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC),
6760 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), 6767 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC),
6768 SND_PCI_QUIRK(0x1558, 0x1325, "System76 Darter Pro (darp5)", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE),
6761 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS), 6769 SND_PCI_QUIRK(0x17aa, 0x1036, "Lenovo P520", ALC233_FIXUP_LENOVO_MULTI_CODECS),
6762 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE), 6770 SND_PCI_QUIRK(0x17aa, 0x20f2, "Thinkpad SL410/510", ALC269_FIXUP_SKU_IGNORE),
6763 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE), 6771 SND_PCI_QUIRK(0x17aa, 0x215e, "Thinkpad L512", ALC269_FIXUP_SKU_IGNORE),
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index bb8372833fc2..7e65fe853ee3 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -1567,6 +1567,7 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip,
1567 case 0x20b1: /* XMOS based devices */ 1567 case 0x20b1: /* XMOS based devices */
1568 case 0x152a: /* Thesycon devices */ 1568 case 0x152a: /* Thesycon devices */
1569 case 0x25ce: /* Mytek devices */ 1569 case 0x25ce: /* Mytek devices */
1570 case 0x2ab6: /* T+A devices */
1570 if (fp->dsd_raw) 1571 if (fp->dsd_raw)
1571 return SNDRV_PCM_FMTBIT_DSD_U32_BE; 1572 return SNDRV_PCM_FMTBIT_DSD_U32_BE;
1572 break; 1573 break;