From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84258C43441 for ; Wed, 21 Nov 2018 22:20:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F786206BA for ; Wed, 21 Nov 2018 22:20:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F786206BA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390039AbeKVI5J (ORCPT ); Thu, 22 Nov 2018 03:57:09 -0500 Received: from mx2.suse.de ([195.135.220.15]:56978 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731864AbeKVI5I (ORCPT ); Thu, 22 Nov 2018 03:57:08 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8541EAE14; Wed, 21 Nov 2018 22:20:50 +0000 (UTC) Date: Wed, 21 Nov 2018 23:20:50 +0100 Message-ID: From: Takashi Iwai To: Andy Shevchenko Cc: Pierre-Louis Bossart , alsa-devel@alsa-project.org, broonie@kernel.org, vkoul@kernel.org, liam.r.girdwood@linux.intel.com, arnd@arndb.de, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 6/6] ALSA: hda: add fallback capabilities for SKL+ platforms In-Reply-To: <20181121143939.GQ10650@smile.fi.intel.com> References: <20181120213644.19103-1-pierre-louis.bossart@linux.intel.com> <20181120213644.19103-7-pierre-louis.bossart@linux.intel.com> <20181121143939.GQ10650@smile.fi.intel.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/26 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 21 Nov 2018 15:39:39 +0100, Andy Shevchenko wrote: > > On Tue, Nov 20, 2018 at 03:36:44PM -0600, Pierre-Louis Bossart wrote: > > Enable fallback for select PCI IDs > > > > Signed-off-by: Pierre-Louis Bossart > > --- > > sound/pci/hda/Kconfig | 40 +++++++++++++++++++++++++++++++++++++++ > > sound/pci/hda/hda_intel.c | 19 +++++++++++++------ > > sound/soc/intel/Kconfig | 6 ++++++ > > 3 files changed, 59 insertions(+), 6 deletions(-) > > > > diff --git a/sound/pci/hda/Kconfig b/sound/pci/hda/Kconfig > > index 4235907b7858..9bb317fb3507 100644 > > --- a/sound/pci/hda/Kconfig > > +++ b/sound/pci/hda/Kconfig > > @@ -228,4 +228,44 @@ config SND_HDA_POWER_SAVE_DEFAULT > > > > endif > > > > +if SND_HDA_INTEL > > + > > +config SND_HDA_INTEL_LEGACY_FALLBACK_SKL > > + bool > > + help > > + This option enables HD-audio legacy fallback for > > + Skylake machines > > + > > +config SND_HDA_INTEL_LEGACY_FALLBACK_APL > > + bool > > + help > > + This option enables HD-audio legacy fallback for > > + Broxton/ApolloLake machines > > + > > +config SND_HDA_INTEL_LEGACY_FALLBACK_KBL > > + bool > > + help > > + This option enables HD-audio legacy fallback for > > + KabyLake machines > > + > > +config SND_HDA_INTEL_LEGACY_FALLBACK_GLK > > + bool > > + help > > + This option enables HD-audio legacy fallback for > > + GeminiLake machines > > + > > +config SND_HDA_INTEL_LEGACY_FALLBACK_CNL > > + bool > > + help > > + This option enables HD-audio legacy fallback for > > + CannonLake machines > > + > > +config SND_HDA_INTEL_LEGACY_FALLBACK_CFL > > + bool > > + help > > + This option enables HD-audio legacy fallback for > > + CoffeeLake machines > > + > > +endif ## SND_HDA_INTEL > > + > > endmenu > > diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c > > index eb00e37c1c27..569419242da3 100644 > > --- a/sound/pci/hda/hda_intel.c > > +++ b/sound/pci/hda/hda_intel.c > > @@ -360,6 +360,7 @@ enum { > > AZX_DCAPS_NO_64BIT |\ > > AZX_DCAPS_4K_BDLE_BOUNDARY | AZX_DCAPS_SNOOP_OFF) > > > > +#define AZX_DCAPS_INTEL_LEGACY_FALLBACK(conf) (IS_ENABLED(conf) ? AZX_DCAPS_INTEL_SHARED : 0) > > /* > > * vga_switcheroo support > > */ > > @@ -2416,34 +2417,40 @@ static const struct pci_device_id azx_ids[] = { > > .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, > > /* Sunrise Point-LP */ > > { PCI_DEVICE(0x8086, 0x9d70), > > - .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, > > + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE | > > + AZX_DCAPS_INTEL_LEGACY_FALLBACK(CONFIG_SND_HDA_INTEL_LEGACY_FALLBACK_SKL) }, > > Preprocessor may concatenate the same prefix for you. > I expect to see something like ..._FALLBACK(SKL) and so on. It' look shorter and better readable, but OTOH, keeping CONFIG_XYZ allows to search the kconfig more easily over the code. Again, we need to consider some drawback. thanks, Takashi > > Moreover, you can go further and create a macro that would consolidate all bits together. > > > > /* Kabylake */ > > { PCI_DEVICE(0x8086, 0xa171), > > .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, > > /* Kabylake-LP */ > > { PCI_DEVICE(0x8086, 0x9d71), > > - .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, > > + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE | > > + AZX_DCAPS_INTEL_LEGACY_FALLBACK(CONFIG_SND_HDA_INTEL_LEGACY_FALLBACK_KBL) }, > > /* Kabylake-H */ > > { PCI_DEVICE(0x8086, 0xa2f0), > > .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE }, > > /* Coffelake */ > > { PCI_DEVICE(0x8086, 0xa348), > > - .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, > > + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE | > > + AZX_DCAPS_INTEL_LEGACY_FALLBACK(CONFIG_SND_HDA_INTEL_LEGACY_FALLBACK_CFL) }, > > /* Cannonlake */ > > { PCI_DEVICE(0x8086, 0x9dc8), > > - .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, > > + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE | > > + AZX_DCAPS_INTEL_LEGACY_FALLBACK(CONFIG_SND_HDA_INTEL_LEGACY_FALLBACK_CNL) }, > > /* Icelake */ > > { PCI_DEVICE(0x8086, 0x34c8), > > .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_SKYLAKE}, > > /* Broxton-P(Apollolake) */ > > { PCI_DEVICE(0x8086, 0x5a98), > > - .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON }, > > + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON | > > + AZX_DCAPS_INTEL_LEGACY_FALLBACK(CONFIG_SND_HDA_INTEL_LEGACY_FALLBACK_APL) }, > > /* Broxton-T */ > > { PCI_DEVICE(0x8086, 0x1a98), > > .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON }, > > /* Gemini-Lake */ > > { PCI_DEVICE(0x8086, 0x3198), > > - .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON }, > > + .driver_data = AZX_DRIVER_SKL | AZX_DCAPS_INTEL_BROXTON | > > + AZX_DCAPS_INTEL_LEGACY_FALLBACK(CONFIG_SND_HDA_INTEL_LEGACY_FALLBACK_GLK) }, > > /* Haswell */ > > { PCI_DEVICE(0x8086, 0x0a0c), > > .driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL }, > > diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig > > index c02d08d31d0d..4c6abdbb0b90 100644 > > --- a/sound/soc/intel/Kconfig > > +++ b/sound/soc/intel/Kconfig > > @@ -197,6 +197,12 @@ config SND_SOC_INTEL_SKYLAKE_COMMON > > config SND_SOC_INTEL_SKL_LEGACY_SUPPORT > > bool "Fallback legacy HD-audio binding" > > depends on SND_HDA_INTEL=y || SND_SOC_INTEL_SKYLAKE_FAMILY=SND_HDA_INTEL > > + select SND_HDA_INTEL_LEGACY_FALLBACK_SKL if SND_SOC_INTEL_SKL > > + select SND_HDA_INTEL_LEGACY_FALLBACK_APL if SND_SOC_INTEL_APL > > + select SND_HDA_INTEL_LEGACY_FALLBACK_KBL if SND_SOC_INTEL_KBL > > + select SND_HDA_INTEL_LEGACY_FALLBACK_GLK if SND_SOC_INTEL_GLK > > + select SND_HDA_INTEL_LEGACY_FALLBACK_CNL if SND_SOC_INTEL_CNL > > + select SND_HDA_INTEL_LEGACY_FALLBACK_CFL if SND_SOC_INTEL_CFL > > help > > Fallback binding with the legacy HD-audio driver when no DSP is > > found > > -- > > 2.17.1 > > > > -- > With Best Regards, > Andy Shevchenko > >