Skip to content
Prev Previous commit
Next Next commit
ASoC: SOF: Intel BYT platform DAIs
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
  • Loading branch information
lrgirdwo authored and keyonjie committed Jul 2, 2018
commit d124438f3ff944a5dfa6ce262a6b968031123628
66 changes: 66 additions & 0 deletions sound/soc/sof/intel/byt.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,66 @@ static int byt_remove(struct snd_sof_dev *sdev)
return byt_acpi_remove(sdev);
}

#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[] = {
Copy link
Member

Choose a reason for hiding this comment

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

CHT has 6 SSPs, best to add them and include a comment.

Copy link
Author

Choose a reason for hiding this comment

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

are you sure CHT has 6 SSPs? I see from your previous patch series that it is set and commented as 3/

Copy link
Author

Choose a reason for hiding this comment

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

and 3 is same with sst-mfld-platform-pcm.c also.

/* BE CPU Dais */
{
.name = "ssp0-port",
.ops = &sst_be_dai_ops,
.playback = {
.stream_name = "ssp0 Tx",
.channels_min = SST_STEREO,
.channels_max = SST_STEREO,
.rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
.capture = {
.stream_name = "ssp0 Rx",
.channels_min = SST_STEREO,
.channels_max = SST_STEREO,
.rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
},
{
.name = "ssp1-port",
.ops = &sst_be_dai_ops,
.playback = {
.stream_name = "ssp1 Tx",
.channels_min = SST_STEREO,
.channels_max = SST_STEREO,
.rates = SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_16000|SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
.capture = {
.stream_name = "ssp1 Rx",
.channels_min = SST_STEREO,
.channels_max = SST_STEREO,
.rates = SNDRV_PCM_RATE_8000|SNDRV_PCM_RATE_16000|SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
},
{
.name = "ssp2-port",
.ops = &sst_be_dai_ops,
.playback = {
.stream_name = "ssp2 Tx",
.channels_min = SST_STEREO,
.channels_max = SST_STEREO,
.rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
.capture = {
.stream_name = "ssp2 Rx",
.channels_min = SST_STEREO,
.channels_max = SST_STEREO,
.rates = SNDRV_PCM_RATE_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
},
};

Copy link
Member

Choose a reason for hiding this comment

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

yes

{
.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),
},
};

struct snd_sof_dai_drv byt_dai_drv = {
.drv = byt_dai,
.num_drv = 3, /* we have only 3 SSPs on byt*/
};

struct snd_sof_dai_drv cht_dai_drv = {
.drv = byt_dai,
/* all 6 SSPs may be available for cherrytrail */
.num_drv = ARRAY_SIZE(byt_dai),
};

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

/*Firmware loading */
.load_firmware = snd_sof_load_firmware_memcpy,

/* DAI drivers */
.dai_drv = &byt_dai_drv,
};
EXPORT_SYMBOL(sof_byt_ops);

Expand Down Expand Up @@ -843,6 +906,9 @@ struct snd_sof_dsp_ops sof_cht_ops = {

/*Firmware loading */
.load_firmware = snd_sof_load_firmware_memcpy,

/* DAI drivers */
.dai_drv = &cht_dai_drv,
};
EXPORT_SYMBOL(sof_cht_ops);

Expand Down