From 1a59d1b8e05ea6ab45f7e18897de1ef0e6bc3da6 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Mon, 27 May 2019 08:55:05 +0200 Subject: treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not write to the free software foundation inc 59 temple place suite 330 boston ma 02111 1307 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1334 file(s). Signed-off-by: Thomas Gleixner Reviewed-by: Allison Randal Reviewed-by: Richard Fontana Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de Signed-off-by: Greg Kroah-Hartman --- include/sound/hda_codec.h | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'include/sound/hda_codec.h') diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h index cc7c8d42d4fd..a7c602576b68 100644 --- a/include/sound/hda_codec.h +++ b/include/sound/hda_codec.h @@ -1,21 +1,8 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Universal Interface for Intel High Definition Audio Codec * * Copyright (c) 2004 Takashi Iwai - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the Free - * Software Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 59 - * Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __SOUND_HDA_CODEC_H -- cgit v1.2.3 From d5fcaaba54ce729a018e50938aa6d355cffc7ef4 Mon Sep 17 00:00:00 2001 From: Paweł Harłoziński Date: Thu, 13 Jun 2019 21:04:31 +0200 Subject: ASoC: Intel: Skylake: Use recommended SDxFMT programming sequence MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Cezary Rojewski Reviewed-by: Pierre-Louis Bossart Signed-off-by: Mark Brown --- include/sound/hda_codec.h | 3 +++ sound/pci/hda/hda_intel.c | 3 --- sound/soc/intel/skylake/skl-pcm.c | 14 +++++++++++++- 3 files changed, 16 insertions(+), 4 deletions(-) (limited to 'include/sound/hda_codec.h') diff --git a/include/sound/hda_codec.h b/include/sound/hda_codec.h index cc7c8d42d4fd..ad46a082b00f 100644 --- a/include/sound/hda_codec.h +++ b/include/sound/hda_codec.h @@ -31,6 +31,9 @@ #include #include +#define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98) +#define IS_CFL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa348) + /* * Structures */ diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 0741eae23f10..07144bcc7059 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -373,9 +373,6 @@ enum { ((pci)->device == 0x0d0c) || \ ((pci)->device == 0x160c)) -#define IS_BXT(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0x5a98) -#define IS_CFL(pci) ((pci)->vendor == 0x8086 && (pci)->device == 0xa348) - static char *driver_short_names[] = { [AZX_DRIVER_ICH] = "HDA Intel", [AZX_DRIVER_PCH] = "HDA Intel PCH", 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; -- cgit v1.2.3