From 73c499c09797be5167c33e9612f340676b234bc7 Mon Sep 17 00:00:00 2001 From: Rander Wang Date: Tue, 25 Jun 2019 14:28:10 +0800 Subject: [PATCH] ALSA: hda: fix headphone detection failed In ASoC, cmd io is diabled when there is no user on the bus and is enabled when a user is active. But unsolicated event is diabled in snd_hdac_bus_stop_cmd_io and not enabled in snd_hdac_bus_init_cmd_io. This makes headphone detection failed. This patch Enable unsolicated event when cmd io is enabled. Tested on whiskylake with legacy hda driver and SOF driver Signed-off-by: Rander Wang --- sound/hda/hdac_controller.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/hda/hdac_controller.c b/sound/hda/hdac_controller.c index d6a91429c058cd..03725118f867ee 100644 --- a/sound/hda/hdac_controller.c +++ b/sound/hda/hdac_controller.c @@ -78,6 +78,9 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus) snd_hdac_chip_writew(bus, RINTCNT, 1); /* enable rirb dma and response irq */ snd_hdac_chip_writeb(bus, RIRBCTL, AZX_RBCTL_DMA_EN | AZX_RBCTL_IRQ_EN); + + /* Accept unsolicited responses */ + snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL); spin_unlock_irq(&bus->reg_lock); } EXPORT_SYMBOL_GPL(snd_hdac_bus_init_cmd_io); @@ -416,9 +419,6 @@ int snd_hdac_bus_reset_link(struct hdac_bus *bus, bool full_reset) return -EBUSY; } - /* Accept unsolicited responses */ - snd_hdac_chip_updatel(bus, GCTL, AZX_GCTL_UNSOL, AZX_GCTL_UNSOL); - /* detect codecs */ if (!bus->codec_mask) { bus->codec_mask = snd_hdac_chip_readw(bus, STATESTS);