Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3651,6 +3651,13 @@ snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm,
case snd_soc_dapm_dac:
case snd_soc_dapm_aif_in:
case snd_soc_dapm_pga:
case snd_soc_dapm_buffer:
case snd_soc_dapm_scheduler:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about all the effects/src/asrc that were added at the same time as buffer/scheduler? Should they really be always on?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plbossart no, added them too now.

case snd_soc_dapm_effect:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh. this isn't the same order as definitions and it's missing asrc/encoder/decoder.

case snd_soc_dapm_src:
case snd_soc_dapm_asrc:
case snd_soc_dapm_encoder:
case snd_soc_dapm_decoder:
case snd_soc_dapm_out_drv:
case snd_soc_dapm_micbias:
case snd_soc_dapm_line:
Expand Down
21 changes: 21 additions & 0 deletions sound/soc/sof/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,27 @@ struct snd_sof_widget *snd_sof_find_swidget(struct snd_sof_dev *sdev,
return NULL;
}

/* find widget by stream name and direction */
struct snd_sof_widget *snd_sof_find_swidget_sname(struct snd_sof_dev *sdev,
char *pcm_name, int dir)
{
struct snd_sof_widget *swidget = NULL;
enum snd_soc_dapm_type type;

if (dir == SNDRV_PCM_STREAM_PLAYBACK)
type = snd_soc_dapm_aif_in;
else
type = snd_soc_dapm_aif_out;

list_for_each_entry(swidget, &sdev->widget_list, list) {
if (!strcmp(pcm_name, swidget->widget->sname) &&
swidget->id == type)
return swidget;
}

return NULL;
}

struct snd_sof_dai *snd_sof_find_dai(struct snd_sof_dev *sdev,
char *name)
{
Expand Down
11 changes: 0 additions & 11 deletions sound/soc/sof/intel/bdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,24 +640,13 @@ static int bdw_probe(struct snd_sof_dev *sdev)
return ret;
}

#define BDW_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these formats may not be used, but at the same time we currently have restrictions on what the topology can do (single format per DAI), and there will be no check that the topology settings are correct and supported by the firmware. We should probably have a layer that does check the topology is indeed supported, otherwise with a single error in a topology file we have a risk of reaching unsupported configurations. it's just too risky.
In short, I would really like the topology to support multiple DAI configs/formats, and a per-platform check in the driver.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@plbossart makes sense. I can add the check but looking at the formats defined for all platforms, I see no restrictions. All platforms seem to support 16/24/32 bit formats. Is that a mistake? If it is, could you please remind me what they should look like?

/* Broadwell DAIs */
static struct snd_soc_dai_driver bdw_dai[] = {
{
.name = "ssp0-port",
.playback = SOF_DAI_STREAM("ssp0 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BDW_FORMATS),
.capture = SOF_DAI_STREAM("ssp0 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BDW_FORMATS),
},
{
.name = "ssp1-port",
.playback = SOF_DAI_STREAM("ssp1 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BDW_FORMATS),
.capture = SOF_DAI_STREAM("ssp1 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BDW_FORMATS),
},
};

Expand Down
27 changes: 0 additions & 27 deletions sound/soc/sof/intel/byt.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,52 +485,25 @@ static int byt_reset(struct snd_sof_dev *sdev)
return 0;
}

#define BYT_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE)

/* Baytrail DAIs */
static struct snd_soc_dai_driver byt_dai[] = {
{
.name = "ssp0-port",
.playback = SOF_DAI_STREAM("ssp0 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
.capture = SOF_DAI_STREAM("ssp0 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
},
{
.name = "ssp1-port",
.playback = SOF_DAI_STREAM("ssp1 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
.capture = SOF_DAI_STREAM("ssp1 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
},
{
.name = "ssp2-port",
.playback = SOF_DAI_STREAM("ssp2 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
.capture = SOF_DAI_STREAM("ssp2 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
},
{
.name = "ssp3-port",
.playback = SOF_DAI_STREAM("ssp3 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
.capture = SOF_DAI_STREAM("ssp3 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
},
{
.name = "ssp4-port",
.playback = SOF_DAI_STREAM("ssp4 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
.capture = SOF_DAI_STREAM("ssp4 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
},
{
.name = "ssp5-port",
.playback = SOF_DAI_STREAM("ssp5 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
.capture = SOF_DAI_STREAM("ssp5 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, BYT_FORMATS),
},
};

Expand Down
49 changes: 0 additions & 49 deletions sound/soc/sof/intel/hda-dai.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
#include "../sof-priv.h"
#include "hda.h"

#define SKL_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE)

#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)

struct hda_pipe_params {
Expand Down Expand Up @@ -265,98 +262,52 @@ static const struct snd_soc_dai_ops hda_link_dai_ops = {
struct snd_soc_dai_driver skl_dai[] = {
{
.name = "SSP0 Pin",
.playback = SOF_DAI_STREAM("ssp0 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
.capture = SOF_DAI_STREAM("ssp0 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
},
{
.name = "SSP1 Pin",
.playback = SOF_DAI_STREAM("ssp1 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
.capture = SOF_DAI_STREAM("ssp1 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
},
{
.name = "SSP2 Pin",
.playback = SOF_DAI_STREAM("ssp2 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
.capture = SOF_DAI_STREAM("ssp2 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
},
{
.name = "SSP3 Pin",
.playback = SOF_DAI_STREAM("ssp3 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
.capture = SOF_DAI_STREAM("ssp3 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
},
{
.name = "SSP4 Pin",
.playback = SOF_DAI_STREAM("ssp4 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
.capture = SOF_DAI_STREAM("ssp4 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
},
{
.name = "SSP5 Pin",
.playback = SOF_DAI_STREAM("ssp5 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
.capture = SOF_DAI_STREAM("ssp5 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
},
{
.name = "DMIC01 Pin",
.capture = SOF_DAI_STREAM("DMIC01 Rx", 1, 4,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
},
{
.name = "DMIC16k Pin",
.capture = SOF_DAI_STREAM("DMIC16k Rx", 1, 4,
SNDRV_PCM_RATE_16000, SKL_FORMATS),
},
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
{
.name = "iDisp1 Pin",
.ops = &hda_link_dai_ops,
.playback = SOF_DAI_STREAM("iDisp1 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
},
{
.name = "iDisp2 Pin",
.ops = &hda_link_dai_ops,
.playback = SOF_DAI_STREAM("iDisp2 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
},
{
.name = "iDisp3 Pin",
.ops = &hda_link_dai_ops,
.playback = SOF_DAI_STREAM("iDisp3 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
},
{
.name = "Analog CPU DAI",
.ops = &hda_link_dai_ops,
.playback = SOF_DAI_STREAM("Analog CPU Playback", 1, 16,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
.capture = SOF_DAI_STREAM("Analog CPU Capture", 1, 16,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
},
{
.name = "Digital CPU DAI",
.ops = &hda_link_dai_ops,
.playback = SOF_DAI_STREAM("Digital CPU Playback", 1, 16,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
.capture = SOF_DAI_STREAM("Digital CPU Capture", 1, 16,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
},
{
.name = "Alt Analog CPU DAI",
.ops = &hda_link_dai_ops,
.playback = SOF_DAI_STREAM("Alt Analog CPU Playback", 1, 16,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
.capture = SOF_DAI_STREAM("Alt Analog CPU Capture", 1, 16,
SNDRV_PCM_RATE_8000_192000, SKL_FORMATS),
},
#endif
};
11 changes: 0 additions & 11 deletions sound/soc/sof/intel/hsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,24 +640,13 @@ static int hsw_probe(struct snd_sof_dev *sdev)
return ret;
}

#define HSW_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE | \
SNDRV_PCM_FMTBIT_S32_LE)

/* Haswell DAIs */
static struct snd_soc_dai_driver hsw_dai[] = {
{
.name = "ssp0-port",
.playback = SOF_DAI_STREAM("ssp0 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, HSW_FORMATS),
.capture = SOF_DAI_STREAM("ssp0 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, HSW_FORMATS),
},
{
.name = "ssp1-port",
.playback = SOF_DAI_STREAM("ssp1 Tx", 1, 8,
SNDRV_PCM_RATE_8000_192000, HSW_FORMATS),
.capture = SOF_DAI_STREAM("ssp1 Rx", 1, 8,
SNDRV_PCM_RATE_8000_192000, HSW_FORMATS),
},
};

Expand Down
2 changes: 2 additions & 0 deletions sound/soc/sof/sof-priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ int sof_ipc_tx_message(struct snd_sof_ipc *ipc, u32 header,
size_t reply_bytes);
struct snd_sof_widget *snd_sof_find_swidget(struct snd_sof_dev *sdev,
char *name);
struct snd_sof_widget *snd_sof_find_swidget_sname(struct snd_sof_dev *sdev,
char *pcm_name, int dir);
struct snd_sof_dai *snd_sof_find_dai(struct snd_sof_dev *sdev,
char *name);
struct snd_sof_pcm *snd_sof_find_spcm_dai(struct snd_sof_dev *sdev,
Expand Down
Loading