From: Takashi Iwai Subject: Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file Date: Thu, 30 Oct 2014 16:27:09 +0100 Message-ID: References: <1414666312-4657-1-git-send-email-vinod.koul@intel.com> <1414666312-4657-8-git-send-email-vinod.koul@intel.com> <20141030143444.GA28745@intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 42A5C2605AF for ; Thu, 30 Oct 2014 16:27:10 +0100 (CET) In-Reply-To: <20141030143444.GA28745@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Vinod Koul Cc: alsa-devel@alsa-project.org, broonie@kernel.org, subhransu.s.prusty@intel.com, lgirdwood@gmail.com List-Id: alsa-devel@alsa-project.org At Thu, 30 Oct 2014 20:04:44 +0530, Vinod Koul wrote: > > On Thu, Oct 30, 2014 at 04:03:59PM +0100, Takashi Iwai wrote: > > At Thu, 30 Oct 2014 16:21:50 +0530, > > Vinod Koul wrote: > > > > > > From: Subhransu S. Prusty > > > > > > This allow the sst.c to be common across PCI and APCI usages > > > > > > Signed-off-by: Subhransu S. Prusty > > > Signed-off-by: Vinod Koul > > > > > > Author: Subhransu S. Prusty > > > --- > > > sound/soc/intel/Kconfig | 4 + > > > sound/soc/intel/sst/Makefile | 4 + > > > sound/soc/intel/sst/sst.c | 200 +------------------------------------ > > > sound/soc/intel/sst/sst.h | 6 + > > > sound/soc/intel/sst/sst_pci.c | 225 +++++++++++++++++++++++++++++++++++++++++ > > > 5 files changed, 240 insertions(+), 199 deletions(-) > > > create mode 100644 sound/soc/intel/sst/sst_pci.c > > > > > > diff --git a/sound/soc/intel/Kconfig b/sound/soc/intel/Kconfig > > > index 2a3af88..cbc987e 100644 > > > --- a/sound/soc/intel/Kconfig > > > +++ b/sound/soc/intel/Kconfig > > > @@ -4,6 +4,7 @@ config SND_MFLD_MACHINE > > > select SND_SOC_SN95031 > > > select SND_SST_MFLD_PLATFORM > > > select SND_SST_IPC > > > + select SND_SST_IPC_PCI > > > help > > > This adds support for ASoC machine driver for Intel(R) MID Medfield platform > > > used as alsa device in audio substem in Intel(R) MID devices > > > @@ -16,6 +17,9 @@ config SND_SST_MFLD_PLATFORM > > > config SND_SST_IPC > > > tristate > > > > > > +config SND_SST_IPC_PCI > > > + bool > > > + > > > config SND_SOC_INTEL_SST > > > tristate "ASoC support for Intel(R) Smart Sound Technology" > > > select SND_SOC_INTEL_SST_ACPI if ACPI > > > diff --git a/sound/soc/intel/sst/Makefile b/sound/soc/intel/sst/Makefile > > > index 4d0e79b..b3fbccd 100644 > > > --- a/sound/soc/intel/sst/Makefile > > > +++ b/sound/soc/intel/sst/Makefile > > > @@ -1,3 +1,7 @@ > > > snd-intel-sst-objs := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o > > > > > > +ifneq ($(CONFIG_SND_SST_IPC_PCI),) > > > +snd-intel-sst-objs += sst_pci.o > > > +endif > > > > The standard way is something like > > > > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o > > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o > > > > But, when looking at the later patch, you try to build ACPI stuff into > > snd-intel-sst, too, and both are implemented as exclusive. This > > doesn't work well in general. > The hardware, firmware so the driver is pretty same. So either it gets probed > as PCI device is SFI platforms and as APCI device on ACPI ones. > Since the probe method is the only one differing, the machine will select > either PCI or ACPI. That one would get compiled in. ... and this exclusion mechanism is missing in your patches. Your current code doesn't allow to mix them. > Am okay to change if we have better method which works for both In general, it's better to provide individual modules for different interfaces and a common module that is referred by them. The selective build makes the build tests more difficult and is rather error-prone. Takashi