diff options
author | Takashi Iwai <tiwai@suse.de> | 2021-11-17 16:30:40 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2021-11-17 16:41:16 +0300 |
commit | 37c4fd0db7c961145d9d1909ecab386fdf703c26 (patch) | |
tree | c721e50b664854d0caef586d37ae174bd64ef706 /sound/pci/hda/hda_jack.c | |
parent | 2c95b92ecd92e784785b1db8cccc4f0f2bfa850c (diff) | |
download | linux-37c4fd0db7c961145d9d1909ecab386fdf703c26.tar.xz |
ALSA: hda: Do disconnect jacks at codec unbind
The HD-audio codec driver remove may happen also at dynamically
unbinding during operation, hence it needs manual triggers of
snd_device_disconnect() calls, while it's missing for the jack objects
that are associated with the codec.
This patch adds the manual disconnection call for jacks when the
remove happens without card->shutdown (i.e. not under the full
removal).
Link: https://lore.kernel.org/r/20211117133040.20272-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_jack.c')
-rw-r--r-- | sound/pci/hda/hda_jack.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_jack.c b/sound/pci/hda/hda_jack.c index f29975e3e98d..7d7786df60ea 100644 --- a/sound/pci/hda/hda_jack.c +++ b/sound/pci/hda/hda_jack.c @@ -158,6 +158,17 @@ snd_hda_jack_tbl_new(struct hda_codec *codec, hda_nid_t nid, int dev_id) return jack; } +void snd_hda_jack_tbl_disconnect(struct hda_codec *codec) +{ + struct hda_jack_tbl *jack = codec->jacktbl.list; + int i; + + for (i = 0; i < codec->jacktbl.used; i++, jack++) { + if (!codec->bus->shutdown && jack->jack) + snd_device_disconnect(codec->card, jack->jack); + } +} + void snd_hda_jack_tbl_clear(struct hda_codec *codec) { struct hda_jack_tbl *jack = codec->jacktbl.list; |