|
@@ -229,7 +229,12 @@ static int skl_suspend(struct device *dev)
|
|
* running, we need to save the state for these and continue
|
|
* running, we need to save the state for these and continue
|
|
*/
|
|
*/
|
|
if (skl->supend_active) {
|
|
if (skl->supend_active) {
|
|
|
|
+ /* turn off the links and stop the CORB/RIRB DMA if it is On */
|
|
snd_hdac_ext_bus_link_power_down_all(ebus);
|
|
snd_hdac_ext_bus_link_power_down_all(ebus);
|
|
|
|
+
|
|
|
|
+ if (ebus->cmd_dma_state)
|
|
|
|
+ snd_hdac_bus_stop_cmd_io(&ebus->bus);
|
|
|
|
+
|
|
enable_irq_wake(bus->irq);
|
|
enable_irq_wake(bus->irq);
|
|
pci_save_state(pci);
|
|
pci_save_state(pci);
|
|
pci_disable_device(pci);
|
|
pci_disable_device(pci);
|
|
@@ -255,6 +260,7 @@ static int skl_resume(struct device *dev)
|
|
struct hdac_ext_bus *ebus = pci_get_drvdata(pci);
|
|
struct hdac_ext_bus *ebus = pci_get_drvdata(pci);
|
|
struct skl *skl = ebus_to_skl(ebus);
|
|
struct skl *skl = ebus_to_skl(ebus);
|
|
struct hdac_bus *bus = ebus_to_hbus(ebus);
|
|
struct hdac_bus *bus = ebus_to_hbus(ebus);
|
|
|
|
+ struct hdac_ext_link *hlink = NULL;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
/* Turned OFF in HDMI codec driver after codec reconfiguration */
|
|
/* Turned OFF in HDMI codec driver after codec reconfiguration */
|
|
@@ -276,8 +282,29 @@ static int skl_resume(struct device *dev)
|
|
ret = pci_enable_device(pci);
|
|
ret = pci_enable_device(pci);
|
|
snd_hdac_ext_bus_link_power_up_all(ebus);
|
|
snd_hdac_ext_bus_link_power_up_all(ebus);
|
|
disable_irq_wake(bus->irq);
|
|
disable_irq_wake(bus->irq);
|
|
|
|
+ /*
|
|
|
|
+ * turn On the links which are On before active suspend
|
|
|
|
+ * and start the CORB/RIRB DMA if On before
|
|
|
|
+ * active suspend.
|
|
|
|
+ */
|
|
|
|
+ list_for_each_entry(hlink, &ebus->hlink_list, list) {
|
|
|
|
+ if (hlink->ref_count)
|
|
|
|
+ snd_hdac_ext_bus_link_power_up(hlink);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (ebus->cmd_dma_state)
|
|
|
|
+ snd_hdac_bus_init_cmd_io(&ebus->bus);
|
|
} else {
|
|
} else {
|
|
ret = _skl_resume(ebus);
|
|
ret = _skl_resume(ebus);
|
|
|
|
+
|
|
|
|
+ /* turn off the links which are off before suspend */
|
|
|
|
+ list_for_each_entry(hlink, &ebus->hlink_list, list) {
|
|
|
|
+ if (!hlink->ref_count)
|
|
|
|
+ snd_hdac_ext_bus_link_power_down(hlink);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!ebus->cmd_dma_state)
|
|
|
|
+ snd_hdac_bus_stop_cmd_io(&ebus->bus);
|
|
}
|
|
}
|
|
|
|
|
|
return ret;
|
|
return ret;
|
|
@@ -613,6 +640,7 @@ static int skl_probe(struct pci_dev *pci,
|
|
struct skl *skl;
|
|
struct skl *skl;
|
|
struct hdac_ext_bus *ebus = NULL;
|
|
struct hdac_ext_bus *ebus = NULL;
|
|
struct hdac_bus *bus = NULL;
|
|
struct hdac_bus *bus = NULL;
|
|
|
|
+ struct hdac_ext_link *hlink = NULL;
|
|
int err;
|
|
int err;
|
|
|
|
|
|
/* we use ext core ops, so provide NULL for ops here */
|
|
/* we use ext core ops, so provide NULL for ops here */
|
|
@@ -679,6 +707,12 @@ static int skl_probe(struct pci_dev *pci,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /*
|
|
|
|
+ * we are done probling so decrement link counts
|
|
|
|
+ */
|
|
|
|
+ list_for_each_entry(hlink, &ebus->hlink_list, list)
|
|
|
|
+ snd_hdac_ext_bus_link_put(ebus, hlink);
|
|
|
|
+
|
|
/*configure PM */
|
|
/*configure PM */
|
|
pm_runtime_put_noidle(bus->dev);
|
|
pm_runtime_put_noidle(bus->dev);
|
|
pm_runtime_allow(bus->dev);
|
|
pm_runtime_allow(bus->dev);
|