All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Vinod Koul <vinod.koul@intel.com>,
	"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>,
	Mark Brown <broonie@kernel.org>
Cc: alsa-devel@alsa-project.org
Subject: Applied "ASoC: Intel: Skylake: Add i915 enabling in skl probe" to the asoc tree
Date: Sun, 21 Feb 2016 02:15:31 +0900	[thread overview]
Message-ID: <E1aXB7z-0008L7-VW@finisterre> (raw)
In-Reply-To: <1455725047-7303-9-git-send-email-subhransu.s.prusty@intel.com>

The patch

   ASoC: Intel: Skylake: Add i915 enabling in skl probe

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 6980c057ea1bca145e8fef39ddf541254f7c8747 Mon Sep 17 00:00:00 2001
From: Vinod Koul <vinod.koul@intel.com>
Date: Wed, 17 Feb 2016 21:34:06 +0530
Subject: [PATCH] ASoC: Intel: Skylake: Add i915 enabling in skl probe

The SKL also supports HDMI output so in probe we need to enable
the HDMI using common i915 APIs to ensure it gets probed on the
bus

After S3 during the controller resequencing the codec domain need
to be kept ON for successful reconfiguration of Codec. Once
configured it will be turned OFF in codec driver.

Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/Kconfig       |  1 +
 sound/soc/intel/skylake/skl.c | 51 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+)

diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig
index 803f95e..6e65085 100644
--- a/sound/soc/intel/Kconfig
+++ b/sound/soc/intel/Kconfig
@@ -154,6 +154,7 @@ config SND_SOC_INTEL_SKYLAKE
 	tristate
 	select SND_HDA_EXT_CORE
 	select SND_SOC_TOPOLOGY
+	select SND_HDA_I915
 	select SND_SOC_INTEL_SST
 
 config SND_SOC_INTEL_SKL_RT286_MACH
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index f89abb1..0d38bdb 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -28,6 +28,9 @@
 #include <linux/firmware.h>
 #include <sound/pcm.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-sst-dsp.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);
 	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
 	 * restore the device
@@ -481,6 +494,27 @@ static int skl_create(struct pci_dev *pci,
 	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)
 {
 	struct skl *skl = ebus_to_skl(ebus);
@@ -543,6 +577,12 @@ static int skl_first_init(struct hdac_ext_bus *ebus)
 	/* initialize chip */
 	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);
 
 	/* codec detection */
@@ -617,6 +657,14 @@ static int skl_probe(struct pci_dev *pci,
 	if (err < 0)
 		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 */
 	pm_runtime_put_noidle(bus->dev);
 	pm_runtime_allow(bus->dev);
@@ -671,6 +719,9 @@ static void skl_remove(struct pci_dev *pci)
 	if (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))
 		pm_runtime_get_noresume(&pci->dev);
 	pci_dev_put(pci);
-- 
2.7.0

  reply	other threads:[~2016-02-20 17:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-17 16:03 [PATCH v7 0/9] ASoC: hdac_hdmi: Update to HDMI driver Subhransu S. Prusty
2016-02-17 16:03 ` [PATCH v7 1/9] ASoC: hdac_hdmi: Fix possible memory leak in hw_params Subhransu S. Prusty
2016-02-20 17:15   ` Applied "ASoC: hdac_hdmi: Fix possible memory leak in hw_params" to the asoc tree Mark Brown
2016-02-17 16:04 ` [PATCH v7 2/9] ASoC: hdac_hdmi: Don't fail in dai startup to make userland happy Subhransu S. Prusty
2016-02-20 17:15   ` Applied "ASoC: hdac_hdmi: Don't fail in dai startup to make userland happy" to the asoc tree Mark Brown
2016-02-17 16:04 ` [PATCH v7 3/9] ASoC: hdac_hdmi: Fix to keep codec power active during enumeration Subhransu S. Prusty
2016-02-17 16:04 ` [PATCH v7 4/9] ASoC: hdac_hdmi: Fix to reconfigure registers in runtime resume Subhransu S. Prusty
2016-02-19 15:55   ` Mark Brown
2016-02-17 16:04 ` [PATCH v7 5/9] ASoC: hdac_hdmi: Fix to wait for D3 before powering off codec Subhransu S. Prusty
2016-02-19 15:56   ` Mark Brown
2016-02-17 16:04 ` [PATCH v7 6/9] ASoC: hdac_hdmi: Add PM support Subhransu S. Prusty
2016-02-17 16:04 ` [PATCH v7 7/9] ASoC: Intel: Skylake: Fix possible memory corruption in codec dai dma params Subhransu S. Prusty
2016-02-20 17:15   ` Applied "ASoC: Intel: Skylake: Fix possible memory corruption in codec dai dma params" to the asoc tree Mark Brown
2016-02-17 16:04 ` [PATCH v7 8/9] ASoC: Intel: Skylake: Add i915 enabling in skl probe Subhransu S. Prusty
2016-02-20 17:15   ` Mark Brown [this message]
2016-02-17 16:04 ` [PATCH v7 9/9] ASoC: Intel: Skylake: Add HDMI FE and BE cpu dais Subhransu S. Prusty
2016-02-20 17:15   ` Applied "ASoC: Intel: Skylake: Add HDMI FE and BE cpu dais" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1aXB7z-0008L7-VW@finisterre \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=subhransu.s.prusty@intel.com \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.