Merge tag 'asoc-fix-v5.6-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / sound / hda / ext / hdac_ext_controller.c
index a684f05..4d060d5 100644 (file)
@@ -254,6 +254,7 @@ EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_link_power_down_all);
 int snd_hdac_ext_bus_link_get(struct hdac_bus *bus,
                                struct hdac_ext_link *link)
 {
+       unsigned long codec_mask;
        int ret = 0;
 
        mutex_lock(&bus->lock);
@@ -280,9 +281,11 @@ int snd_hdac_ext_bus_link_get(struct hdac_bus *bus,
                 *  HDA spec section 4.3 - Codec Discovery
                 */
                udelay(521);
-               bus->codec_mask = snd_hdac_chip_readw(bus, STATESTS);
-               dev_dbg(bus->dev, "codec_mask = 0x%lx\n", bus->codec_mask);
-               snd_hdac_chip_writew(bus, STATESTS, bus->codec_mask);
+               codec_mask = snd_hdac_chip_readw(bus, STATESTS);
+               dev_dbg(bus->dev, "codec_mask = 0x%lx\n", codec_mask);
+               snd_hdac_chip_writew(bus, STATESTS, codec_mask);
+               if (!bus->codec_mask)
+                       bus->codec_mask = codec_mask;
        }
 
        mutex_unlock(&bus->lock);