summaryrefslogtreecommitdiff
path: root/sound/soc/intel
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2023-08-08 13:28:53 +0100
committerMark Brown <broonie@kernel.org>2023-08-08 13:28:53 +0100
commit442ece6b3473157a5680aa156be7bd776ff7e378 (patch)
tree515c7bff7d50fefb0dcc7fd3b386f65e8af2ba1c /sound/soc/intel
parent93fd2be6eb80fe37570fbd87652ec07a4f7c5b5a (diff)
parent02c7f8729a5a1e78412177482372c3124edd4d62 (diff)
ASoC: SOF: Intel: add LunarLake support
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>: This patchset first fixes a number of errors made in the hda-mlink support, then adds Lunar Lake definitions. The main contribution is the hda-dai changes where the HDaudio DMA is now used for SSP, DMIC and SoundWire. In previous hardware the GPDMA (aka DesignWare) was used and controlled by the audio firmware. The volume of code is minimized with the abstraction added in previous kernel cycles. Due to cross-dependencies between ASoC and SoundWire trees, the full support for jack detection will be deferred to the next kernel cycle. There's not much point to ask for a sync of the two trees to support one patch for each tree - we are at -rc5 already.
Diffstat (limited to 'sound/soc/intel')
-rw-r--r--sound/soc/intel/atom/sst/sst.c14
-rw-r--r--sound/soc/intel/atom/sst/sst.h7
-rw-r--r--sound/soc/intel/atom/sst/sst_pci.c4
-rw-r--r--sound/soc/intel/avs/board_selection.c10
-rw-r--r--sound/soc/intel/avs/core.c16
-rw-r--r--sound/soc/intel/skylake/skl-messages.c16
-rw-r--r--sound/soc/intel/skylake/skl-pcm.c3
-rw-r--r--sound/soc/intel/skylake/skl.c36
8 files changed, 47 insertions, 59 deletions
diff --git a/sound/soc/intel/atom/sst/sst.c b/sound/soc/intel/atom/sst/sst.c
index a0d29510d2bc..e0357d257c6c 100644
--- a/sound/soc/intel/atom/sst/sst.c
+++ b/sound/soc/intel/atom/sst/sst.c
@@ -16,6 +16,7 @@
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/firmware.h>
+#include <linux/pci.h>
#include <linux/pm_runtime.h>
#include <linux/pm_qos.h>
#include <linux/async.h>
@@ -174,9 +175,9 @@ int sst_driver_ops(struct intel_sst_drv *sst)
{
switch (sst->dev_id) {
- case SST_MRFLD_PCI_ID:
- case SST_BYT_ACPI_ID:
- case SST_CHV_ACPI_ID:
+ case PCI_DEVICE_ID_INTEL_SST_TNG:
+ case PCI_DEVICE_ID_INTEL_SST_BYT:
+ case PCI_DEVICE_ID_INTEL_SST_BSW:
sst->tstamp = SST_TIME_STAMP_MRFLD;
sst->ops = &mrfld_ops;
return 0;
@@ -221,8 +222,13 @@ static void sst_init_locks(struct intel_sst_drv *ctx)
spin_lock_init(&ctx->block_lock);
}
+/*
+ * Driver handles PCI IDs in ACPI - sst_acpi_probe() - and we are using only
+ * device ID part. If real ACPI ID appears, the kstrtouint() returns error, so
+ * we are fine with using unsigned short as dev_id type.
+ */
int sst_alloc_drv_context(struct intel_sst_drv **ctx,
- struct device *dev, unsigned int dev_id)
+ struct device *dev, unsigned short dev_id)
{
*ctx = devm_kzalloc(dev, sizeof(struct intel_sst_drv), GFP_KERNEL);
if (!(*ctx))
diff --git a/sound/soc/intel/atom/sst/sst.h b/sound/soc/intel/atom/sst/sst.h
index 4d37d39fd8f4..126903e126e4 100644
--- a/sound/soc/intel/atom/sst/sst.h
+++ b/sound/soc/intel/atom/sst/sst.h
@@ -20,9 +20,6 @@
/* driver names */
#define SST_DRV_NAME "intel_sst_driver"
-#define SST_MRFLD_PCI_ID 0x119A
-#define SST_BYT_ACPI_ID 0x80860F28
-#define SST_CHV_ACPI_ID 0x808622A8
#define SST_SUSPEND_DELAY 2000
#define FW_CONTEXT_MEM (64*1024)
@@ -358,7 +355,7 @@ struct sst_fw_save {
struct intel_sst_drv {
int sst_state;
int irq_num;
- unsigned int dev_id;
+ unsigned short dev_id;
void __iomem *ddr;
void __iomem *shim;
void __iomem *mailbox;
@@ -523,7 +520,7 @@ int sst_register(struct device *);
int sst_unregister(struct device *);
int sst_alloc_drv_context(struct intel_sst_drv **ctx,
- struct device *dev, unsigned int dev_id);
+ struct device *dev, unsigned short dev_id);
int sst_context_init(struct intel_sst_drv *ctx);
void sst_context_cleanup(struct intel_sst_drv *ctx);
void sst_configure_runtime_pm(struct intel_sst_drv *ctx);
diff --git a/sound/soc/intel/atom/sst/sst_pci.c b/sound/soc/intel/atom/sst/sst_pci.c
index 4058b4f80a0c..d1e64c3500be 100644
--- a/sound/soc/intel/atom/sst/sst_pci.c
+++ b/sound/soc/intel/atom/sst/sst_pci.c
@@ -32,7 +32,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
/* map registers */
/* DDR base */
- if (ctx->dev_id == SST_MRFLD_PCI_ID) {
+ if (ctx->dev_id == PCI_DEVICE_ID_INTEL_SST_TNG) {
ctx->ddr_base = pci_resource_start(pci, 0);
/* check that the relocated IMR base matches with FW Binary */
ddr_base = relocate_imr_addr_mrfld(ctx->ddr_base);
@@ -173,7 +173,7 @@ static void intel_sst_remove(struct pci_dev *pci)
/* PCI Routines */
static const struct pci_device_id intel_sst_ids[] = {
- { PCI_VDEVICE(INTEL, SST_MRFLD_PCI_ID), 0},
+ { PCI_DEVICE_DATA(INTEL, SST_TNG, 0) },
{ 0, }
};
diff --git a/sound/soc/intel/avs/board_selection.c b/sound/soc/intel/avs/board_selection.c
index f91ef6c9612f..59a13feec57b 100644
--- a/sound/soc/intel/avs/board_selection.c
+++ b/sound/soc/intel/avs/board_selection.c
@@ -279,14 +279,14 @@ struct avs_acpi_boards {
};
#define AVS_MACH_ENTRY(_id, _mach) \
- { .id = (_id), .machs = (_mach), }
+ { .id = PCI_DEVICE_ID_INTEL_##_id, .machs = (_mach), }
/* supported I2S boards per platform */
static const struct avs_acpi_boards i2s_boards[] = {
- AVS_MACH_ENTRY(0x9d70, avs_skl_i2s_machines), /* SKL */
- AVS_MACH_ENTRY(0x9d71, avs_kbl_i2s_machines), /* KBL */
- AVS_MACH_ENTRY(0x5a98, avs_apl_i2s_machines), /* APL */
- AVS_MACH_ENTRY(0x3198, avs_gml_i2s_machines), /* GML */
+ AVS_MACH_ENTRY(HDA_SKL_LP, avs_skl_i2s_machines),
+ AVS_MACH_ENTRY(HDA_KBL_LP, avs_kbl_i2s_machines),
+ AVS_MACH_ENTRY(HDA_APL, avs_apl_i2s_machines),
+ AVS_MACH_ENTRY(HDA_GML, avs_gml_i2s_machines),
{},
};
diff --git a/sound/soc/intel/avs/core.c b/sound/soc/intel/avs/core.c
index 637501850728..859b217fc761 100644
--- a/sound/soc/intel/avs/core.c
+++ b/sound/soc/intel/avs/core.c
@@ -745,14 +745,14 @@ static const struct avs_spec apl_desc = {
};
static const struct pci_device_id avs_ids[] = {
- { PCI_VDEVICE(INTEL, 0x9d70), (unsigned long)&skl_desc }, /* SKL */
- { PCI_VDEVICE(INTEL, 0xa170), (unsigned long)&skl_desc }, /* SKL-H */
- { PCI_VDEVICE(INTEL, 0x9d71), (unsigned long)&skl_desc }, /* KBL */
- { PCI_VDEVICE(INTEL, 0xa171), (unsigned long)&skl_desc }, /* KBL-H */
- { PCI_VDEVICE(INTEL, 0xa2f0), (unsigned long)&skl_desc }, /* KBL-S */
- { PCI_VDEVICE(INTEL, 0xa3f0), (unsigned long)&skl_desc }, /* CML-V */
- { PCI_VDEVICE(INTEL, 0x5a98), (unsigned long)&apl_desc }, /* APL */
- { PCI_VDEVICE(INTEL, 0x3198), (unsigned long)&apl_desc }, /* GML */
+ { PCI_DEVICE_DATA(INTEL, HDA_SKL_LP, &skl_desc) },
+ { PCI_DEVICE_DATA(INTEL, HDA_SKL, &skl_desc) },
+ { PCI_DEVICE_DATA(INTEL, HDA_KBL_LP, &skl_desc) },
+ { PCI_DEVICE_DATA(INTEL, HDA_KBL, &skl_desc) },
+ { PCI_DEVICE_DATA(INTEL, HDA_KBL_H, &skl_desc) },
+ { PCI_DEVICE_DATA(INTEL, HDA_CML_S, &skl_desc) },
+ { PCI_DEVICE_DATA(INTEL, HDA_APL, &apl_desc) },
+ { PCI_DEVICE_DATA(INTEL, HDA_GML, &apl_desc) },
{ 0 }
};
MODULE_DEVICE_TABLE(pci, avs_ids);
diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index d31509298a0a..fc2eb04da172 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -169,7 +169,7 @@ static struct skl_dsp_loader_ops bxt_get_loader_ops(void)
static const struct skl_dsp_ops dsp_ops[] = {
{
- .id = 0x9d70,
+ .id = PCI_DEVICE_ID_INTEL_HDA_SKL_LP,
.num_cores = 2,
.loader_ops = skl_get_loader_ops,
.init = skl_sst_dsp_init,
@@ -177,7 +177,7 @@ static const struct skl_dsp_ops dsp_ops[] = {
.cleanup = skl_sst_dsp_cleanup
},
{
- .id = 0x9d71,
+ .id = PCI_DEVICE_ID_INTEL_HDA_KBL_LP,
.num_cores = 2,
.loader_ops = skl_get_loader_ops,
.init = skl_sst_dsp_init,
@@ -185,7 +185,7 @@ static const struct skl_dsp_ops dsp_ops[] = {
.cleanup = skl_sst_dsp_cleanup
},
{
- .id = 0x5a98,
+ .id = PCI_DEVICE_ID_INTEL_HDA_APL,
.num_cores = 2,
.loader_ops = bxt_get_loader_ops,
.init = bxt_sst_dsp_init,
@@ -193,7 +193,7 @@ static const struct skl_dsp_ops dsp_ops[] = {
.cleanup = bxt_sst_dsp_cleanup
},
{
- .id = 0x3198,
+ .id = PCI_DEVICE_ID_INTEL_HDA_GML,
.num_cores = 2,
.loader_ops = bxt_get_loader_ops,
.init = bxt_sst_dsp_init,
@@ -201,7 +201,7 @@ static const struct skl_dsp_ops dsp_ops[] = {
.cleanup = bxt_sst_dsp_cleanup
},
{
- .id = 0x9dc8,
+ .id = PCI_DEVICE_ID_INTEL_HDA_CNL_LP,
.num_cores = 4,
.loader_ops = bxt_get_loader_ops,
.init = cnl_sst_dsp_init,
@@ -209,7 +209,7 @@ static const struct skl_dsp_ops dsp_ops[] = {
.cleanup = cnl_sst_dsp_cleanup
},
{
- .id = 0xa348,
+ .id = PCI_DEVICE_ID_INTEL_HDA_CNL_H,
.num_cores = 4,
.loader_ops = bxt_get_loader_ops,
.init = cnl_sst_dsp_init,
@@ -217,7 +217,7 @@ static const struct skl_dsp_ops dsp_ops[] = {
.cleanup = cnl_sst_dsp_cleanup
},
{
- .id = 0x02c8,
+ .id = PCI_DEVICE_ID_INTEL_HDA_CML_LP,
.num_cores = 4,
.loader_ops = bxt_get_loader_ops,
.init = cnl_sst_dsp_init,
@@ -225,7 +225,7 @@ static const struct skl_dsp_ops dsp_ops[] = {
.cleanup = cnl_sst_dsp_cleanup
},
{
- .id = 0x06c8,
+ .id = PCI_DEVICE_ID_INTEL_HDA_CML_H,
.num_cores = 4,
.loader_ops = bxt_get_loader_ops,
.init = cnl_sst_dsp_init,
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index a4209d88b0c6..ac3dc8c63c26 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -13,6 +13,7 @@
#include <linux/pci.h>
#include <linux/pm_runtime.h>
#include <linux/delay.h>
+#include <sound/hdaudio.h>
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include "skl.h"
@@ -152,7 +153,7 @@ int skl_pcm_host_dma_prepare(struct device *dev, struct skl_pipe_params *params)
* The recommended SDxFMT programming sequence for BXT
* platforms is to couple the stream before writing the format
*/
- if (IS_BXT(skl->pci)) {
+ if (HDA_CONTROLLER_IS_APL(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);
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index 998bd0232cf1..77408a981b97 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -608,8 +608,8 @@ struct skl_clk_parent_src *skl_get_parent_clk(u8 clk_id)
static void init_skl_xtal_rate(int pci_id)
{
switch (pci_id) {
- case 0x9d70:
- case 0x9d71:
+ case PCI_DEVICE_ID_INTEL_HDA_SKL_LP:
+ case PCI_DEVICE_ID_INTEL_HDA_KBL_LP:
skl_clk_src[0].rate = 24000000;
return;
@@ -1145,44 +1145,28 @@ static void skl_remove(struct pci_dev *pci)
/* PCI IDs */
static const struct pci_device_id skl_ids[] = {
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_SKL)
- /* Sunrise Point-LP */
- { PCI_DEVICE(0x8086, 0x9d70),
- .driver_data = (unsigned long)&snd_soc_acpi_intel_skl_machines},
+ { PCI_DEVICE_DATA(INTEL, HDA_SKL_LP, &snd_soc_acpi_intel_skl_machines) },
#endif
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_APL)
- /* BXT-P */
- { PCI_DEVICE(0x8086, 0x5a98),
- .driver_data = (unsigned long)&snd_soc_acpi_intel_bxt_machines},
+ { PCI_DEVICE_DATA(INTEL, HDA_APL, &snd_soc_acpi_intel_bxt_machines) },
#endif
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_KBL)
- /* KBL */
- { PCI_DEVICE(0x8086, 0x9D71),
- .driver_data = (unsigned long)&snd_soc_acpi_intel_kbl_machines},
+ { PCI_DEVICE_DATA(INTEL, HDA_KBL_LP, &snd_soc_acpi_intel_kbl_machines) },
#endif
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_GLK)
- /* GLK */
- { PCI_DEVICE(0x8086, 0x3198),
- .driver_data = (unsigned long)&snd_soc_acpi_intel_glk_machines},
+ { PCI_DEVICE_DATA(INTEL, HDA_GML, &snd_soc_acpi_intel_glk_machines) },
#endif
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_CNL)
- /* CNL */
- { PCI_DEVICE(0x8086, 0x9dc8),
- .driver_data = (unsigned long)&snd_soc_acpi_intel_cnl_machines},
+ { PCI_DEVICE_DATA(INTEL, HDA_CNL_LP, &snd_soc_acpi_intel_cnl_machines) },
#endif
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_CFL)
- /* CFL */
- { PCI_DEVICE(0x8086, 0xa348),
- .driver_data = (unsigned long)&snd_soc_acpi_intel_cnl_machines},
+ { PCI_DEVICE_DATA(INTEL, HDA_CNL_H, &snd_soc_acpi_intel_cnl_machines) },
#endif
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_CML_LP)
- /* CML-LP */
- { PCI_DEVICE(0x8086, 0x02c8),
- .driver_data = (unsigned long)&snd_soc_acpi_intel_cnl_machines},
+ { PCI_DEVICE_DATA(INTEL, HDA_CML_LP, &snd_soc_acpi_intel_cnl_machines) },
#endif
#if IS_ENABLED(CONFIG_SND_SOC_INTEL_CML_H)
- /* CML-H */
- { PCI_DEVICE(0x8086, 0x06c8),
- .driver_data = (unsigned long)&snd_soc_acpi_intel_cnl_machines},
+ { PCI_DEVICE_DATA(INTEL, HDA_CML_H, &snd_soc_acpi_intel_cnl_machines) },
#endif
{ 0, }
};