summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel
diff options
context:
space:
mode:
authorPaweł Harłoziński <pawel.harlozinski@intel.com>2019-06-13 21:04:31 +0200
committerMark Brown <broonie@kernel.org>2019-06-25 16:32:36 +0200
commitd5fcaaba54ce729a018e50938aa6d355cffc7ef4 (patch)
tree7dc0d24716aed2b77ace175391921c81d8a4242a /sound/soc/intel
parentASoC: rt5677: depop stereo dac (diff)
downloadlinux-d5fcaaba54ce729a018e50938aa6d355cffc7ef4.tar.xz
linux-d5fcaaba54ce729a018e50938aa6d355cffc7ef4.zip
ASoC: Intel: Skylake: Use recommended SDxFMT programming sequence
For BXT platforms, the recommended sequence to program the SDxFMT is to first couple the stream, write the format and decouple again. For all other platforms said sequence remains unchanged. To prevent code duplication, IS_BXT (and consequently IS_CFL) macro is relocated to hda_codec.h file so it can be accessed by SKL driver. Signed-off-by: Paweł Harłoziński <pawel.harlozinski@intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel')
-rw-r--r--sound/soc/intel/skylake/skl-pcm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index b00ee2730908..4fc78be2f751 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -141,6 +141,7 @@ static void skl_set_suspend_active(struct snd_pcm_substream *substream,
int skl_pcm_host_dma_prepare(struct device *dev, struct skl_pipe_params *params)
{
struct hdac_bus *bus = dev_get_drvdata(dev);
+ struct skl *skl = bus_to_skl(bus);
unsigned int format_val;
struct hdac_stream *hstream;
struct hdac_ext_stream *stream;
@@ -165,7 +166,18 @@ int skl_pcm_host_dma_prepare(struct device *dev, struct skl_pipe_params *params)
if (err < 0)
return err;
- err = snd_hdac_stream_setup(hdac_stream(stream));
+ /*
+ * The recommended SDxFMT programming sequence for BXT
+ * platforms is to couple the stream before writing the format
+ */
+ if (IS_BXT(skl->pci)) {
+ snd_hdac_ext_stream_decouple(bus, stream, false);
+ err = snd_hdac_stream_setup(hdac_stream(stream));
+ snd_hdac_ext_stream_decouple(bus, stream, true);
+ } else {
+ err = snd_hdac_stream_setup(hdac_stream(stream));
+ }
+
if (err < 0)
return err;