Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple ssp and icelake support #1

Closed
wants to merge 11 commits into from
1 change: 1 addition & 0 deletions include/sound/soc-acpi-intel-match.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_intel_kbl_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_bxt_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_glk_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[];
extern struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_machines[];

#endif
3 changes: 2 additions & 1 deletion include/sound/sof.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct sof_dev_desc {
int sof_nocodec_setup(struct device *dev,
struct snd_sof_pdata *sof_pdata,
struct snd_soc_acpi_mach *mach,
const struct sof_dev_desc *desc);
const struct sof_dev_desc *desc,
struct snd_sof_dsp_ops *ops);

#endif
4 changes: 4 additions & 0 deletions sound/soc/intel/boards/bxt_tdf8532.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ static struct snd_soc_dai_link broxton_tdf8532_dais[] = {
.platform_name = "0000:00:0e.0",
.init = NULL,
.nonatomic = 1,
.dynamic = 1,
},
{
.name = "Bxt Compress Probe capture",
Expand All @@ -276,6 +277,7 @@ static struct snd_soc_dai_link broxton_tdf8532_dais[] = {
.platform_name = "0000:00:0e.0",
.init = NULL,
.nonatomic = 1,
.dynamic = 1,
},
/* Trace Buffer DAI links */
{
Expand All @@ -287,6 +289,7 @@ static struct snd_soc_dai_link broxton_tdf8532_dais[] = {
.platform_name = "0000:00:0e.0",
.capture_only = true,
.ignore_suspend = 1,
.dynamic = 1,
},
{
.name = "Bxt Trace Buffer1",
Expand All @@ -297,6 +300,7 @@ static struct snd_soc_dai_link broxton_tdf8532_dais[] = {
.platform_name = "0000:00:0e.0",
.capture_only = true,
.ignore_suspend = 1,
.dynamic = 1,
},
/* Back End DAI links */
{
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/intel/common/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ snd-soc-acpi-intel-match-objs := soc-acpi-intel-byt-match.o soc-acpi-intel-cht-m
soc-acpi-intel-hsw-bdw-match.o \
soc-acpi-intel-skl-match.o soc-acpi-intel-kbl-match.o \
soc-acpi-intel-bxt-match.o soc-acpi-intel-glk-match.o \
soc-acpi-intel-cnl-match.o
soc-acpi-intel-cnl-match.o soc-acpi-intel-icl-match.o

obj-$(CONFIG_SND_SOC_INTEL_SST) += snd-soc-sst-dsp.o snd-soc-sst-ipc.o
obj-$(CONFIG_SND_SOC_INTEL_SST_ACPI) += snd-soc-sst-acpi.o
Expand Down
32 changes: 32 additions & 0 deletions sound/soc/intel/common/soc-acpi-intel-icl-match.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// SPDX-License-Identifier: GPL-2.0
/*
* soc-apci-intel-icl-match.c - tables and support for ICL ACPI enumeration.
*
* Copyright (c) 2018, Intel Corporation.
*
*/

#include <sound/soc-acpi.h>
#include <sound/soc-acpi-intel-match.h>
#include "../skylake/skl.h"

static struct skl_machine_pdata icl_pdata = {
.use_tplg_pcm = true,
};

struct snd_soc_acpi_mach snd_soc_acpi_intel_icl_machines[] = {
{
.id = "INT34C2",
.drv_name = "sof-nocodec",
.fw_filename = "intel/dsp_fw_icl.bin",
.pdata = &icl_pdata,
.sof_fw_filename = "intel/sof-icl.ri",
.sof_tplg_filename = "intel/sof-icl.tplg",
.asoc_plat_name = "0000:00:0e.0",
},
{},
};
EXPORT_SYMBOL_GPL(snd_soc_acpi_intel_icl_machines);

MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("Intel Common ACPI Match module");
1 change: 0 additions & 1 deletion sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,6 @@ static void soc_check_tplg_fes(struct snd_soc_card *card)

/* override platform */
dai_link->platform_name = platform->component.name;
dai_link->cpu_dai_name = platform->component.name;

/* convert non BE into BE */
dai_link->no_pcm = 1;
Expand Down
8 changes: 5 additions & 3 deletions sound/soc/sof/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static int sof_probe(struct platform_device *pdev)
spin_lock_init(&sdev->ipc_lock);
spin_lock_init(&sdev->hw_lock);

/* set up platform and component drivers */
/* set up platform component driver */
snd_sof_new_platform_drv(sdev);
snd_sof_new_dai_drv(sdev);

Expand Down Expand Up @@ -271,14 +271,16 @@ static int sof_probe(struct platform_device *pdev)
goto fw_run_err;
}

ret = snd_soc_register_component(&pdev->dev, sdev->cmpnt_drv,
&sdev->dai_drv, sdev->num_dai);
ret = snd_soc_register_component(&pdev->dev, sdev->cmpnt_drv,
sdev->ops->drv,
sdev->ops->num_drv);
if (ret < 0) {
dev_err(sdev->dev,
"error: failed to register DSP DAI driver %d\n", ret);
goto comp_err;
}

/* init DMA trace */
ret = snd_sof_init_trace(sdev);
if (ret < 0) {
dev_warn(sdev->dev,
Expand Down
9 changes: 9 additions & 0 deletions sound/soc/sof/intel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ config SND_SOC_SOF_SKYLAKE
Say Y if you have such a device.
If unsure select "N".

config SND_SOC_SOF_ICELAKE
tristate "SOF support for Icelake"
select SND_SOC_SOF_HDA_COMMON
help
This adds support for Sound Open Firmware for Intel(R) platforms
using the Icelake processors.
Say Y if you have such a device.
If unsure select "N".

config SND_SOC_SOF_HDA_COMMON
tristate
select SND_SOC_SOF_PCI
Expand Down
108 changes: 108 additions & 0 deletions sound/soc/sof/intel/apl.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,110 @@ static const struct snd_sof_debugfs_map apl_dsp_debugfs[] = {
{"dsp", HDA_DSP_BAR, 0, 0x10000},
};

static const struct snd_soc_dai_ops apl_dai_ops = {
};

#define APL_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_FLOAT)

/* Apollolake DAIs */
static struct snd_soc_dai_driver apl_dai[] = {
{
.name = "SSP0 Pin",
.ops = &apl_dai_ops,
.playback = SOF_DAI_STREAM("ssp0 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
.capture = SOF_DAI_STREAM("ssp0 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
},
{
.name = "SSP1 Pin",
.ops = &apl_dai_ops,
.playback = SOF_DAI_STREAM("ssp1 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
.capture = SOF_DAI_STREAM("ssp1 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
},
{
.name = "SSP2 Pin",
.ops = &apl_dai_ops,
.playback = SOF_DAI_STREAM("ssp2 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
.capture = SOF_DAI_STREAM("ssp2 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
},
{
.name = "SSP3 Pin",
.ops = &apl_dai_ops,
.playback = SOF_DAI_STREAM("ssp3 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
.capture = SOF_DAI_STREAM("ssp3 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
},
{
.name = "SSP4 Pin",
.ops = &apl_dai_ops,
.playback = SOF_DAI_STREAM("ssp4 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
.capture = SOF_DAI_STREAM("ssp4 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
},
{
.name = "SSP5 Pin",
.ops = &apl_dai_ops,
.playback = SOF_DAI_STREAM("ssp5 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
.capture = SOF_DAI_STREAM("ssp5 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
},
{
.name = "DMIC01 Pin",
.ops = &apl_dai_ops,
.capture = SOF_DAI_STREAM("DMIC01 Rx", 1, 4,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
},
{
.name = "DMIC16k Pin",
.ops = &apl_dai_ops,
.capture = SOF_DAI_STREAM("DMIC16k Rx", 1, 4,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
},
{
.name = "iDisp1 Pin",
.ops = &apl_dai_ops,
.playback = SOF_DAI_STREAM("iDisp1 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
},
{
.name = "iDisp2 Pin",
.ops = &apl_dai_ops,
.playback = SOF_DAI_STREAM("iDisp2 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
},
{
.name = "iDisp3 Pin",
.ops = &apl_dai_ops,
.playback = SOF_DAI_STREAM("iDisp3 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
},
{
.name = "HD-Codec Pin",
.ops = &apl_dai_ops,
.playback = SOF_DAI_STREAM("HD-Codec Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
.capture = SOF_DAI_STREAM("HD-Codec Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, APL_FORMATS),
},
{
.name = "sof-nocodec-dai",
.ops = &apl_dai_ops,
.playback = SOF_DAI_STREAM("DAI0 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, SOF_FORMATS),
.capture = SOF_DAI_STREAM("DAI0 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, SOF_FORMATS),
},
};

/* apollolake ops */
struct snd_sof_dsp_ops sof_apl_ops = {
/* probe and remove */
Expand Down Expand Up @@ -92,5 +196,9 @@ struct snd_sof_dsp_ops sof_apl_ops = {
.trace_init = hda_dsp_trace_init,
.trace_release = hda_dsp_trace_release,
.trace_trigger = hda_dsp_trace_trigger,

/* DAI drivers */
.drv = apl_dai,
.num_drv = ARRAY_SIZE(apl_dai),
};
EXPORT_SYMBOL(sof_apl_ops);
38 changes: 38 additions & 0 deletions sound/soc/sof/intel/bdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,40 @@ static int bdw_remove(struct snd_sof_dev *sdev)
return 0;
}

static const struct snd_soc_dai_ops bdw_dai_ops = {
};

#define BDW_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_FLOAT)

/* Broadwell DAIs */
static struct snd_soc_dai_driver bdw_dai[] = {
{
.name = "ssp0-port",
.ops = &bdw_dai_ops,
.playback = SOF_DAI_STREAM("ssp0 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, BDW_FORMATS),
.capture = SOF_DAI_STREAM("ssp0 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, BDW_FORMATS),
},
{
.name = "ssp1-port",
.ops = &bdw_dai_ops,
.playback = SOF_DAI_STREAM("ssp1 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, BDW_FORMATS),
.capture = SOF_DAI_STREAM("ssp1 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, BDW_FORMATS),
},
{
.name = "sof-nocodec-dai",
.ops = &bdw_dai_ops,
.playback = SOF_DAI_STREAM("DAI0 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, SOF_FORMATS),
.capture = SOF_DAI_STREAM("DAI0 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, SOF_FORMATS),
},
};

/* broadwell ops */
struct snd_sof_dsp_ops sof_bdw_ops = {
/*Device init */
Expand Down Expand Up @@ -750,6 +784,10 @@ struct snd_sof_dsp_ops sof_bdw_ops = {

/*Firmware loading */
.load_firmware = snd_sof_load_firmware_memcpy,

/* DAI drivers */
.drv = bdw_dai,
.num_drv = ARRAY_SIZE(bdw_dai),
};
EXPORT_SYMBOL(sof_bdw_ops);

Expand Down
50 changes: 50 additions & 0 deletions sound/soc/sof/intel/byt.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,48 @@ static int byt_remove(struct snd_sof_dev *sdev)
return byt_acpi_remove(sdev);
}

static const struct snd_soc_dai_ops byt_dai_ops = {
};

#define BYT_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_FLOAT)

/* Baytrail DAIs */
static struct snd_soc_dai_driver byt_dai[] = {
{
.name = "ssp0-port",
.ops = &byt_dai_ops,
.playback = SOF_DAI_STREAM("ssp0 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
.capture = SOF_DAI_STREAM("ssp0 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
},
{
.name = "ssp1-port",
.ops = &byt_dai_ops,
.playback = SOF_DAI_STREAM("ssp1 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
.capture = SOF_DAI_STREAM("ssp1 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
},
{
.name = "ssp2-port",
.ops = &byt_dai_ops,
.playback = SOF_DAI_STREAM("ssp2 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
.capture = SOF_DAI_STREAM("ssp2 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
},
{
.name = "sof-nocodec-dai",
.ops = &byt_dai_ops,
.playback = SOF_DAI_STREAM("DAI0 Tx", 1, 16,
SNDRV_PCM_RATE_8000_192000, SOF_FORMATS),
.capture = SOF_DAI_STREAM("DAI0 Rx", 1, 16,
SNDRV_PCM_RATE_8000_192000, SOF_FORMATS),
},
};

/* baytrail ops */
struct snd_sof_dsp_ops sof_byt_ops = {
/* device init */
Expand Down Expand Up @@ -795,6 +837,10 @@ struct snd_sof_dsp_ops sof_byt_ops = {

/*Firmware loading */
.load_firmware = snd_sof_load_firmware_memcpy,

/* DAI drivers */
.drv = byt_dai,
.num_drv = 3, /* BYT only has 3 SSPs */
};
EXPORT_SYMBOL(sof_byt_ops);

Expand Down Expand Up @@ -843,6 +889,10 @@ struct snd_sof_dsp_ops sof_cht_ops = {

/*Firmware loading */
.load_firmware = snd_sof_load_firmware_memcpy,

/* DAI drivers */
.drv = byt_dai,
.num_drv = ARRAY_SIZE(byt_dai),
};
EXPORT_SYMBOL(sof_cht_ops);

Expand Down
Loading