|
@@ -28,6 +28,9 @@
|
|
#include <linux/firmware.h>
|
|
#include <linux/firmware.h>
|
|
#include <sound/pcm.h>
|
|
#include <sound/pcm.h>
|
|
#include "../common/sst-acpi.h"
|
|
#include "../common/sst-acpi.h"
|
|
|
|
+#include <sound/hda_register.h>
|
|
|
|
+#include <sound/hdaudio.h>
|
|
|
|
+#include <sound/hda_i915.h>
|
|
#include "skl.h"
|
|
#include "skl.h"
|
|
#include "skl-sst-dsp.h"
|
|
#include "skl-sst-dsp.h"
|
|
#include "skl-sst-ipc.h"
|
|
#include "skl-sst-ipc.h"
|
|
@@ -243,6 +246,16 @@ static int skl_resume(struct device *dev)
|
|
struct hdac_bus *bus = ebus_to_hbus(ebus);
|
|
struct hdac_bus *bus = ebus_to_hbus(ebus);
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
+ /* Turned OFF in HDMI codec driver after codec reconfiguration */
|
|
|
|
+ if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {
|
|
|
|
+ ret = snd_hdac_display_power(bus, true);
|
|
|
|
+ if (ret < 0) {
|
|
|
|
+ dev_err(bus->dev,
|
|
|
|
+ "Cannot turn on display power on i915\n");
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* resume only when we are not in suspend active, otherwise need to
|
|
* resume only when we are not in suspend active, otherwise need to
|
|
* restore the device
|
|
* restore the device
|
|
@@ -481,6 +494,27 @@ static int skl_create(struct pci_dev *pci,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int skl_i915_init(struct hdac_bus *bus)
|
|
|
|
+{
|
|
|
|
+ int err;
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * The HDMI codec is in GPU so we need to ensure that it is powered
|
|
|
|
+ * up and ready for probe
|
|
|
|
+ */
|
|
|
|
+ err = snd_hdac_i915_init(bus);
|
|
|
|
+ if (err < 0)
|
|
|
|
+ return err;
|
|
|
|
+
|
|
|
|
+ err = snd_hdac_display_power(bus, true);
|
|
|
|
+ if (err < 0) {
|
|
|
|
+ dev_err(bus->dev, "Cannot turn on display power on i915\n");
|
|
|
|
+ return err;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return err;
|
|
|
|
+}
|
|
|
|
+
|
|
static int skl_first_init(struct hdac_ext_bus *ebus)
|
|
static int skl_first_init(struct hdac_ext_bus *ebus)
|
|
{
|
|
{
|
|
struct skl *skl = ebus_to_skl(ebus);
|
|
struct skl *skl = ebus_to_skl(ebus);
|
|
@@ -543,6 +577,12 @@ static int skl_first_init(struct hdac_ext_bus *ebus)
|
|
/* initialize chip */
|
|
/* initialize chip */
|
|
skl_init_pci(skl);
|
|
skl_init_pci(skl);
|
|
|
|
|
|
|
|
+ if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {
|
|
|
|
+ err = skl_i915_init(bus);
|
|
|
|
+ if (err < 0)
|
|
|
|
+ return err;
|
|
|
|
+ }
|
|
|
|
+
|
|
skl_init_chip(bus, true);
|
|
skl_init_chip(bus, true);
|
|
|
|
|
|
/* codec detection */
|
|
/* codec detection */
|
|
@@ -617,6 +657,14 @@ static int skl_probe(struct pci_dev *pci,
|
|
if (err < 0)
|
|
if (err < 0)
|
|
goto out_unregister;
|
|
goto out_unregister;
|
|
|
|
|
|
|
|
+ if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI)) {
|
|
|
|
+ err = snd_hdac_display_power(bus, false);
|
|
|
|
+ if (err < 0) {
|
|
|
|
+ dev_err(bus->dev, "Cannot turn off display power on i915\n");
|
|
|
|
+ return err;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/*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);
|
|
@@ -671,6 +719,9 @@ static void skl_remove(struct pci_dev *pci)
|
|
if (skl->tplg)
|
|
if (skl->tplg)
|
|
release_firmware(skl->tplg);
|
|
release_firmware(skl->tplg);
|
|
|
|
|
|
|
|
+ if (IS_ENABLED(CONFIG_SND_SOC_HDAC_HDMI))
|
|
|
|
+ snd_hdac_i915_exit(&ebus->bus);
|
|
|
|
+
|
|
if (pci_dev_run_wake(pci))
|
|
if (pci_dev_run_wake(pci))
|
|
pm_runtime_get_noresume(&pci->dev);
|
|
pm_runtime_get_noresume(&pci->dev);
|
|
pci_dev_put(pci);
|
|
pci_dev_put(pci);
|