goto cleanup;
        }
 
+       /*
+        * When a SoundWire link is in clock stop state, a Slave
+        * device may trigger in-band wakes for events such as jack
+        * insertion or acoustic event detection. This event will lead
+        * to a WAKEEN interrupt, handled by the PCI device and routed
+        * to PME if the PCI device is in D3. The resume function in
+        * audio PCI driver will be invoked by ACPI for PME event and
+        * initialize the device and process WAKEEN interrupt.
+        *
+        * The WAKEEN interrupt should be processed ASAP to prevent an
+        * interrupt flood, otherwise other interrupts, such IPC,
+        * cannot work normally.  The WAKEEN is handled after the ROM
+        * is initialized successfully, which ensures power rails are
+        * enabled before accessing the SoundWire SHIM registers
+        */
+       if (!sdev->first_boot)
+               hda_sdw_process_wakeen(sdev);
+
        /*
         * at this point DSP ROM has been initialized and
         * should be ready for code loading and firmware boot
 
        return sdw_intel_thread(irq, context);
 }
 
+void hda_sdw_process_wakeen(struct snd_sof_dev *sdev)
+{
+       struct sof_intel_hda_dev *hdev;
+
+       hdev = sdev->pdata->hw_pdata;
+       if (!hdev->sdw)
+               return;
+
+       sdw_intel_process_wakeen_event(hdev->sdw);
+}
+
 #endif
 
 /*
 
 
 int hda_sdw_startup(struct snd_sof_dev *sdev);
 void hda_sdw_int_enable(struct snd_sof_dev *sdev, bool enable);
+void hda_sdw_process_wakeen(struct snd_sof_dev *sdev);
 
 #else
 
 {
        return IRQ_HANDLED;
 }
+
+static inline void hda_sdw_process_wakeen(struct snd_sof_dev *sdev)
+{
+}
 #endif
 
 /* common dai driver */