Commit 8d4ba1be authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Takashi Iwai
Browse files

ASoC: SOF: pci: split PCI into different drivers



Move PCI IDs and device-specific definitions out of common code. No
functionality change for now, just code split and removal of
IF_ENABLED() which made the configurations too complicated in case of
reuse of IP across generations.

Additional changes to address the DSP_CONFIG case and SoundWire
depends/select confusions are provided in follow-up patches.

Suggested-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Reviewed-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: default avatarBard Liao <bard.liao@intel.com>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Acked-by: default avatarVinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/r/20210302003125.1178419-4-pierre-louis.bossart@linux.intel.com


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8a49cd11
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -9,14 +9,17 @@ config SND_SOC_SOF_TOPLEVEL

if SND_SOC_SOF_TOPLEVEL

config SND_SOC_SOF_PCI_DEV
	tristate

config SND_SOC_SOF_PCI
	tristate "SOF PCI enumeration support"
	depends on PCI
	select SND_SOC_SOF
	select SND_SOC_ACPI if ACPI
	help
	  This adds support for PCI enumeration. This option is
	  required to enable Intel Skylake+ devices.
	  For backwards-compatibility with previous configurations the selection will
	  be used as default for platform-specific drivers.
	  Say Y if you need this option.
	  If unsure select "N".

+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ obj-$(CONFIG_SND_SOC_SOF_NOCODEC) += snd-sof-nocodec.o

obj-$(CONFIG_SND_SOC_SOF_ACPI_DEV) += snd-sof-acpi.o
obj-$(CONFIG_SND_SOC_SOF_OF) += snd-sof-of.o
obj-$(CONFIG_SND_SOC_SOF_PCI) += snd-sof-pci.o
obj-$(CONFIG_SND_SOC_SOF_PCI_DEV) += snd-sof-pci.o

obj-$(CONFIG_SND_SOC_SOF_INTEL_TOPLEVEL) += intel/
obj-$(CONFIG_SND_SOC_SOF_IMX_TOPLEVEL) += imx/
+58 −121
Original line number Diff line number Diff line
@@ -9,23 +9,6 @@ config SND_SOC_SOF_INTEL_TOPLEVEL

if SND_SOC_SOF_INTEL_TOPLEVEL

config SND_SOC_SOF_INTEL_PCI
	def_tristate SND_SOC_SOF_PCI
	select SND_SOC_SOF_MERRIFIELD  if SND_SOC_SOF_MERRIFIELD_SUPPORT
	select SND_SOC_SOF_APOLLOLAKE  if SND_SOC_SOF_APOLLOLAKE_SUPPORT
	select SND_SOC_SOF_GEMINILAKE  if SND_SOC_SOF_GEMINILAKE_SUPPORT
	select SND_SOC_SOF_CANNONLAKE  if SND_SOC_SOF_CANNONLAKE_SUPPORT
	select SND_SOC_SOF_COFFEELAKE  if SND_SOC_SOF_COFFEELAKE_SUPPORT
	select SND_SOC_SOF_ICELAKE     if SND_SOC_SOF_ICELAKE_SUPPORT
	select SND_SOC_SOF_COMETLAKE   if SND_SOC_SOF_COMETLAKE_SUPPORT
	select SND_SOC_SOF_TIGERLAKE   if SND_SOC_SOF_TIGERLAKE_SUPPORT
	select SND_SOC_SOF_ELKHARTLAKE if SND_SOC_SOF_ELKHARTLAKE_SUPPORT
	select SND_SOC_SOF_JASPERLAKE  if SND_SOC_SOF_JASPERLAKE_SUPPORT
	select SND_SOC_SOF_ALDERLAKE   if SND_SOC_SOF_ALDERLAKE_SUPPORT
	help
	  This option is not user-selectable but automagically handled by
	  'select' statements at a higher level.

config SND_SOC_SOF_INTEL_HIFI_EP_IPC
	tristate
	help
@@ -96,187 +79,141 @@ config SND_SOC_SOF_BROADWELL

endif ## SND_SOC_SOF_ACPI

if SND_SOC_SOF_INTEL_PCI
if SND_SOC_SOF_PCI

config SND_SOC_SOF_MERRIFIELD_SUPPORT
	bool "SOF support for Tangier/Merrifield"
config SND_SOC_SOF_MERRIFIELD
	tristate "SOF support for Tangier/Merrifield"
	default SND_SOC_SOF_PCI
	select SND_SOC_SOF_INTEL_ATOM_HIFI_EP
	help
	  This adds support for Sound Open Firmware for Intel(R) platforms
	  using the Tangier/Merrifield processors.
	  Say Y if you have such a device.
	  If unsure select "N".

config SND_SOC_SOF_MERRIFIELD
config SND_SOC_SOF_INTEL_APL
	tristate
	select SND_SOC_SOF_INTEL_ATOM_HIFI_EP
	help
	  This option is not user-selectable but automagically handled by
	  'select' statements at a higher level.
	select SND_SOC_SOF_HDA_COMMON

config SND_SOC_SOF_APOLLOLAKE_SUPPORT
	bool "SOF support for Apollolake"
config SND_SOC_SOF_APOLLOLAKE
	tristate "SOF support for Apollolake"
	default SND_SOC_SOF_PCI
	select SND_SOC_SOF_INTEL_APL
	help
	  This adds support for Sound Open Firmware for Intel(R) platforms
	  using the Apollolake processors.
	  Say Y if you have such a device.
	  If unsure select "N".

config SND_SOC_SOF_APOLLOLAKE
	tristate
	select SND_SOC_SOF_HDA_COMMON
	help
	  This option is not user-selectable but automagically handled by
	  'select' statements at a higher level.

config SND_SOC_SOF_GEMINILAKE_SUPPORT
	bool "SOF support for GeminiLake"
config SND_SOC_SOF_GEMINILAKE
	tristate "SOF support for GeminiLake"
	default SND_SOC_SOF_PCI
	select SND_SOC_SOF_INTEL_APL
	help
	  This adds support for Sound Open Firmware for Intel(R) platforms
	  using the Geminilake processors.
	  Say Y if you have such a device.
	  If unsure select "N".

config SND_SOC_SOF_GEMINILAKE
config SND_SOC_SOF_INTEL_CNL
	tristate
	select SND_SOC_SOF_HDA_COMMON
	help
	  This option is not user-selectable but automagically handled by
	  'select' statements at a higher level.
	select SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE

config SND_SOC_SOF_CANNONLAKE_SUPPORT
	bool "SOF support for Cannonlake"
config SND_SOC_SOF_CANNONLAKE
	tristate "SOF support for Cannonlake"
	default SND_SOC_SOF_PCI
	select SND_SOC_SOF_INTEL_CNL
	help
	  This adds support for Sound Open Firmware for Intel(R) platforms
	  using the Cannonlake processors.
	  Say Y if you have such a device.
	  If unsure select "N".

config SND_SOC_SOF_CANNONLAKE
	tristate
	select SND_SOC_SOF_HDA_COMMON
	select SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE
	help
	  This option is not user-selectable but automagically handled by
	  'select' statements at a higher level.

config SND_SOC_SOF_COFFEELAKE_SUPPORT
	bool "SOF support for CoffeeLake"
config SND_SOC_SOF_COFFEELAKE
	tristate "SOF support for CoffeeLake"
	default SND_SOC_SOF_PCI
	select SND_SOC_SOF_INTEL_CNL
	help
	  This adds support for Sound Open Firmware for Intel(R) platforms
	  using the Coffeelake processors.
	  Say Y if you have such a device.
	  If unsure select "N".

config SND_SOC_SOF_COFFEELAKE
	tristate
	select SND_SOC_SOF_HDA_COMMON
	select SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE
	help
	  This option is not user-selectable but automagically handled by
	  'select' statements at a higher level.

config SND_SOC_SOF_ICELAKE_SUPPORT
	bool "SOF support for Icelake"
config SND_SOC_SOF_COMETLAKE
	tristate "SOF support for CometLake"
	default SND_SOC_SOF_PCI
	select SND_SOC_SOF_INTEL_CNL
	help
	  This adds support for Sound Open Firmware for Intel(R) platforms
	  using the Icelake processors.
	  Say Y if you have such a device.
	  using the Cometlake processors.
	  If unsure select "N".

config SND_SOC_SOF_ICELAKE
config SND_SOC_SOF_INTEL_ICL
	tristate
	select SND_SOC_SOF_HDA_COMMON
	select SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE
	help
	  This option is not user-selectable but automagically handled by
	  'select' statements at a higher level.

config SND_SOC_SOF_COMETLAKE
	tristate
	select SND_SOC_SOF_HDA_COMMON
	select SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE
	help
	  This option is not user-selectable but automagically handled by
	  'select' statements at a higher level.

config SND_SOC_SOF_COMETLAKE_SUPPORT
	bool

config SND_SOC_SOF_COMETLAKE_LP_SUPPORT
	bool "SOF support for CometLake"
	select SND_SOC_SOF_COMETLAKE_SUPPORT
config SND_SOC_SOF_ICELAKE
	tristate "SOF support for Icelake"
	default SND_SOC_SOF_PCI
	select SND_SOC_SOF_INTEL_ICL
	help
	  This adds support for Sound Open Firmware for Intel(R) platforms
	  using the Cometlake processors.
	  using the Icelake processors.
	  Say Y if you have such a device.
	  If unsure select "N".

config SND_SOC_SOF_TIGERLAKE_SUPPORT
	bool "SOF support for Tigerlake"
config SND_SOC_SOF_JASPERLAKE
	tristate "SOF support for JasperLake"
	default SND_SOC_SOF_PCI
	select SND_SOC_SOF_INTEL_ICL
	help
	  This adds support for Sound Open Firmware for Intel(R) platforms
	  using the Tigerlake processors.
	  using the JasperLake processors.
	  Say Y if you have such a device.
	  If unsure select "N".

config SND_SOC_SOF_TIGERLAKE
config SND_SOC_SOF_INTEL_TGL
	tristate
	select SND_SOC_SOF_HDA_COMMON
	select SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE
	help
	  This option is not user-selectable but automagically handled by
	  'select' statements at a higher level.

config SND_SOC_SOF_ELKHARTLAKE_SUPPORT
	bool "SOF support for ElkhartLake"
config SND_SOC_SOF_TIGERLAKE
	tristate "SOF support for Tigerlake"
	default SND_SOC_SOF_PCI
	select SND_SOC_SOF_INTEL_TGL
	help
	  This adds support for Sound Open Firmware for Intel(R) platforms
	  using the ElkhartLake processors.
	  using the Tigerlake processors.
	  Say Y if you have such a device.
	  If unsure select "N".

config SND_SOC_SOF_ELKHARTLAKE
	tristate
	select SND_SOC_SOF_HDA_COMMON
	select SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE
	help
	  This option is not user-selectable but automagically handled by
	  'select' statements at a higher level.

config SND_SOC_SOF_JASPERLAKE_SUPPORT
	bool "SOF support for JasperLake"
	tristate "SOF support for ElkhartLake"
	default SND_SOC_SOF_PCI
	select SND_SOC_SOF_INTEL_TGL
	help
	  This adds support for Sound Open Firmware for Intel(R) platforms
	  using the JasperLake processors.
	  using the ElkhartLake processors.
	  Say Y if you have such a device.
	  If unsure select "N".

config SND_SOC_SOF_JASPERLAKE
	tristate
	select SND_SOC_SOF_HDA_COMMON
	help
	  This option is not user-selectable but automagically handled by
	  'select' statements at a higher level.

config SND_SOC_SOF_ALDERLAKE_SUPPORT
	bool "SOF support for Alderlake"
config SND_SOC_SOF_ALDERLAKE
	tristate "SOF support for Alderlake"
	default SND_SOC_SOF_PCI
	select SND_SOC_SOF_INTEL_TGL
	help
	  This adds support for Sound Open Firmware for Intel(R) platforms
	  using the Alderlake processors.
	  Say Y if you have such a device.
	  If unsure select "N".

config SND_SOC_SOF_ALDERLAKE
	tristate
	select SND_SOC_SOF_HDA_COMMON
	select SND_SOC_SOF_INTEL_SOUNDWIRE_LINK_BASELINE
	help
	  This option is not user-selectable but automagically handled by
	  'select' statements at a higher level

config SND_SOC_SOF_HDA_COMMON
	tristate
	select SND_INTEL_DSP_CONFIG
	select SND_SOC_SOF_INTEL_COMMON
	select SND_SOC_SOF_PCI_DEV
	select SND_INTEL_DSP_CONFIG
	select SND_SOC_SOF_HDA_LINK_BASELINE
	help
	  This option is not user-selectable but automagically handled by
+12 −0
Original line number Diff line number Diff line
@@ -18,3 +18,15 @@ obj-$(CONFIG_SND_SOC_SOF_BROADWELL) += snd-sof-acpi-intel-bdw.o
obj-$(CONFIG_SND_SOC_SOF_INTEL_HIFI_EP_IPC) += snd-sof-intel-ipc.o
obj-$(CONFIG_SND_SOC_SOF_HDA_COMMON) += snd-sof-intel-hda-common.o
obj-$(CONFIG_SND_SOC_SOF_HDA) += snd-sof-intel-hda.o

snd-sof-pci-intel-tng-objs := pci-tng.o
snd-sof-pci-intel-apl-objs := pci-apl.o
snd-sof-pci-intel-cnl-objs := pci-cnl.o
snd-sof-pci-intel-icl-objs := pci-icl.o
snd-sof-pci-intel-tgl-objs := pci-tgl.o

obj-$(CONFIG_SND_SOC_SOF_MERRIFIELD) += snd-sof-pci-intel-tng.o
obj-$(CONFIG_SND_SOC_SOF_INTEL_APL) += snd-sof-pci-intel-apl.o
obj-$(CONFIG_SND_SOC_SOF_INTEL_CNL) += snd-sof-pci-intel-cnl.o
obj-$(CONFIG_SND_SOC_SOF_INTEL_ICL) += snd-sof-pci-intel-icl.o
obj-$(CONFIG_SND_SOC_SOF_INTEL_TGL) += snd-sof-pci-intel-tgl.o
+81 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
//
// This file is provided under a dual BSD/GPLv2 license.  When using or
// redistributing this file, you may do so under either license.
//
// Copyright(c) 2018-2021 Intel Corporation. All rights reserved.
//
// Author: Liam Girdwood <liam.r.girdwood@linux.intel.com>
//

#include <linux/module.h>
#include <linux/pci.h>
#include <sound/soc-acpi.h>
#include <sound/soc-acpi-intel-match.h>
#include <sound/sof.h>
#include "../ops.h"
#include "../sof-pci-dev.h"

/* platform specific devices */
#include "hda.h"

static const struct sof_dev_desc bxt_desc = {
	.machines		= snd_soc_acpi_intel_bxt_machines,
	.use_acpi_target_states	= true,
	.resindex_lpe_base	= 0,
	.resindex_pcicfg_base	= -1,
	.resindex_imr_base	= -1,
	.irqindex_host_ipc	= -1,
	.resindex_dma_base	= -1,
	.chip_info = &apl_chip_info,
	.default_fw_path = "intel/sof",
	.default_tplg_path = "intel/sof-tplg",
	.default_fw_filename = "sof-apl.ri",
	.nocodec_tplg_filename = "sof-apl-nocodec.tplg",
	.ops = &sof_apl_ops,
};

static const struct sof_dev_desc glk_desc = {
	.machines		= snd_soc_acpi_intel_glk_machines,
	.use_acpi_target_states	= true,
	.resindex_lpe_base	= 0,
	.resindex_pcicfg_base	= -1,
	.resindex_imr_base	= -1,
	.irqindex_host_ipc	= -1,
	.resindex_dma_base	= -1,
	.chip_info = &apl_chip_info,
	.default_fw_path = "intel/sof",
	.default_tplg_path = "intel/sof-tplg",
	.default_fw_filename = "sof-glk.ri",
	.nocodec_tplg_filename = "sof-glk-nocodec.tplg",
	.ops = &sof_apl_ops,
};

/* PCI IDs */
static const struct pci_device_id sof_pci_ids[] = {
	{ PCI_DEVICE(0x8086, 0x5a98), /* BXT-P (ApolloLake) */
		.driver_data = (unsigned long)&bxt_desc},
	{ PCI_DEVICE(0x8086, 0x1a98),/* BXT-T */
		.driver_data = (unsigned long)&bxt_desc},
	{ PCI_DEVICE(0x8086, 0x3198), /* GeminiLake */
		.driver_data = (unsigned long)&glk_desc},
	{ 0, }
};
MODULE_DEVICE_TABLE(pci, sof_pci_ids);

/* pci_driver definition */
static struct pci_driver snd_sof_pci_intel_apl_driver = {
	.name = "sof-audio-pci-intel-apl",
	.id_table = sof_pci_ids,
	.probe = sof_pci_probe,
	.remove = sof_pci_remove,
	.shutdown = sof_pci_shutdown,
	.driver = {
		.pm = &sof_pci_pm,
	},
};
module_pci_driver(snd_sof_pci_intel_apl_driver);

MODULE_LICENSE("Dual BSD/GPL");
MODULE_IMPORT_NS(SND_SOC_SOF_INTEL_HDA_COMMON);
MODULE_IMPORT_NS(SND_SOC_SOF_PCI_DEV);
Loading