[Sound-open-firmware] [RFC PATCH 2/2] topology: add sof-apl-da7219 support

Pierre-Louis Bossart pierre-louis.bossart at linux.intel.com
Thu Jul 12 00:52:58 CEST 2018



On 07/11/2018 04:43 PM, Ranjani Sridharan wrote:
> On Wed, 2018-07-11 at 11:55 -0500, Pierre-Louis Bossart wrote:
>> On 07/11/2018 01:23 AM, Ranjani Sridharan wrote:
>>> On Tue, 2018-07-10 at 18:15 -0500, Pierre-Louis Bossart wrote:
>>>> Add based on sof-glk-codec. In theory this is the same topology
>>>> with only a swap of SSPs
>>>>
>>>> FIXME: this is a mess between pipeline ID, PCM ID, DAI ID, DAI #.
>>>> I could use additional eyes to proof-read this...
>>> Looks good to me. I couldnt spot any mistakes.
>>> Keyon, Could you please also check?
>>>> FIXME: not sure why we would need
>>>> PCM_CAPTURE_ADD/PCM_PLAYBACK_DAI,
>>>> this seems to be already done by DAI_ADD?
>>> DAI_ADD only adds the BE DAI's. PCM_CAPTURE_ADD/PLAYBACK_ADD are
>>> needed
>>> for adding the FE dai links.
>> ok, but then why do those macros make references to the DAIs?
> The dai_id is used when creating the cpu_dai for the PCM elems and
> their ID is set to the dai_id specified here.
>
> I wish I understood cpu dai's better but I couldnt wrap my head around
> why we do that.
>
> Keyon, any hints?
So it's a different dai_id from what is used for back-ends? Looks like a 
complete mess to me...

>
>> +# PCM (PCM_CAPTURE_ADD(name, pipeline, pcm_id, dai_id, capture))
>> +#PCM_CAPTURE_ADD(DMIC0, 1, 0, 0, PIPELINE_PCM_1)
>> +#PCM_PLAYBACK_ADD(SSP5, 2, 0, 5, PIPELINE_PCM_2)
>> +#PCM_PLAYBACK_ADD(SSP1, 3, 1, 1, PIPELINE_PCM_3)
>>
>> In addition the information on the PCM # is already provided in
>> PIPELINE_ADD, so this looks redundant on both the FE and BE sides?
>>>> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.i
>>>> ntel
>>>> .com>
>>>> ---
>>>>    topology/Makefile.am       |   1 +
>>>>    topology/sof-apl-da7219.m4 | 104
>>>> +++++++++++++++++++++++++++++++++++++++++++++
>>>>    2 files changed, 105 insertions(+)
>>>>    create mode 100644 topology/sof-apl-da7219.m4
>>>>
>>>> diff --git a/topology/Makefile.am b/topology/Makefile.am
>>>> index 33d0418..396b5b9 100644
>>>> --- a/topology/Makefile.am
>>>> +++ b/topology/Makefile.am
>>>> @@ -31,6 +31,7 @@ MACHINES = \
>>>>    	sof-hsw-rt5640.tplg \
>>>>    	sof-apl-tdf8532.tplg \
>>>>    	sof-apl-pcm512x.tplg \
>>>> +	sof-apl-da7219.tplg \
>>>>    	sof-glk-codec.tplg
>>>>    
>>>>    # Uncomment the following line if you want to debug conf files
>>>> diff --git a/topology/sof-apl-da7219.m4 b/topology/sof-apl-
>>>> da7219.m4
>>>> new file mode 100644
>>>> index 0000000..3934df5
>>>> --- /dev/null
>>>> +++ b/topology/sof-apl-da7219.m4
>>>> @@ -0,0 +1,104 @@
>>>> +#
>>>> +# Topology for AppoloLake with headset on SSP1, spk on SSP5 and
>>>> DMIC+# PCM (PCM_CAPTURE_ADD(name, pipeline, pcm_id, dai_id,
>>>> capture))
>>>> +#PCM_CAPTURE_ADD(DMIC0, 1, 0, 0, PIPELINE_PCM_1)
>>>> +#PCM_PLAYBACK_ADD(SSP5, 2, 0, 5, PIPELINE_PCM_2)
>>>> +#PCM_PLAYBACK_ADD(SSP1, 3, 1, 1, PIPELINE_PCM_3)
>>>> capture
>>>> +#
>>>> +
>>>> +# Include topology builder
>>>> +include(`utils.m4')
>>>> +include(`dai.m4')
>>>> +include(`pipeline.m4')
>>>> +include(`ssp.m4')
>>>> +
>>>> +# Include TLV library
>>>> +include(`common/tlv.m4')
>>>> +
>>>> +# Include Token library
>>>> +include(`sof/tokens.m4')
>>>> +
>>>> +# Include bxt DSP configuration
>>>> +include(`platform/intel/bxt.m4')
>>>> +include(`platform/intel/dmic.m4')
>>>> +
>>>> +#
>>>> +# Define the pipelines
>>>> +#
>>>> +# PCM0 <---- volume <----- DMIC0 (dmic capture)
>>>> +# PCM0 ----> volume -----> SSP5 (speaker - maxim98357a)
>>>> +# PCM1 ----> volume -----> SSP1 (headset - da7219)
>>>> +#
>>>> +
>>>> +# Low Latency capture pipeline 1 on PCM 0 using max 4 channels
>>>> of
>>>> s32le.
>>>> +# Schedule 48 frames per 1000us deadline on core 0 with priority
>>>> 0
>>>> +PIPELINE_PCM_ADD(sof/pipe-volume-capture.m4,
>>>> +	1, 0, 4, s32le,
>>>> +	48, 1000, 0, 0)
>>>> +
>>>> +# Low Latency playback pipeline 2 on PCM 0 using max 2 channels
>>>> of
>>>> s16le.
>>>> +# Schedule 48 frames per 1000us deadline on core 0 with priority
>>>> 0
>>>> +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
>>>> +	2, 0, 2, s16le,
>>>> +	48, 1000, 0, 0)
>>>> +
>>>> +# Low Latency playback pipeline 3 on PCM 1 using max 2 channels
>>>> of
>>>> s16le.
>>>> +# Schedule 48 frames per 1000us deadline on core 0 with priority
>>>> 0
>>>> +PIPELINE_PCM_ADD(sof/pipe-volume-playback.m4,
>>>> +	3, 1, 2, s16le,
>>>> +	48, 1000, 0, 0)
>>>> +
>>>> +#
>>>> +# DAIs configuration
>>>> +#
>>>> +
>>>> +# capture DAI is DMIC0 using 2 periods
>>>> +# Buffers use s16le format, with 48 frame per 1000us on core 0
>>>> with
>>>> priority 0
>>>> +DAI_ADD(sof/pipe-dai-capture.m4,
>>>> +	1, DMIC, 0, DMIC0,
>>>> +	PIPELINE_SINK_1, 2, s32le,
>>>> +	48, 1000, 0, 0)
>>>> +
>>>> +# playback DAI is SSP5 using 2 periods
>>>> +# Buffers use s16le format, with 48 frame per 1000us on core 0
>>>> with
>>>> priority 0
>>>> +DAI_ADD(sof/pipe-dai-playback.m4,
>>>> +	2, SSP, 5, SSP5-Codec,
>>>> +	PIPELINE_SOURCE_2, 2, s16le,
>>>> +	48, 1000, 0, 0)
>>>> +
>>>> +# playback DAI is SSP1 using 2 periods
>>>> +# Buffers use s16le format, with 48 frame per 1000us on core 0
>>>> with
>>>> priority 0
>>>> +DAI_ADD(sof/pipe-dai-playback.m4,
>>>> +	3, SSP, 1, SSP1-Codec,
>>>> +	PIPELINE_SOURCE_3, 2, s16le,
>>>> +	48, 1000, 0, 0)
>>>> +
>>>> +# FIXME: Why is this needed? And is this correct?
>>>> +# PCM (PCM_CAPTURE_ADD(name, pipeline, pcm_id, dai_id, capture))
>>>> +#PCM_CAPTURE_ADD(DMIC0, 1, 0, 0, PIPELINE_PCM_1)
>>>> +#PCM_PLAYBACK_ADD(SSP5, 2, 0, 5, PIPELINE_PCM_2)
>>>> +#PCM_PLAYBACK_ADD(SSP1, 3, 1, 1, PIPELINE_PCM_3)
>>>> +
>>>> +#
>>>> +# BE configurations - overrides config in ACPI if present
>>>> +#
>>>> +# FIXME: the machine driver uses .name = "dmic01" and .id=2
>>>> +# DMIC0 (id: 2)
>>>> +DAI_CONFIG(DMIC, 0, 2, dmic01,
>>>> +	DMIC_CONFIG(1, 500000, 4800000, 40, 60, 48000,
>>>> +		DMIC_WORD_LENGTH(s32le), DMIC, 0,
>>>> +		PDM_CONFIG(DMIC, 0, FOUR_CH_PDM0_PDM1)))
>>>> +
>>>> +# FIXME: the machine driver uses .name = "SSP5-Codec", .id=0,
>>>> .cpu_name="SSP5 Pin"
>>>> +#SSP 5 (ID: 0) with 19.2MHz mclk with MCLK_ID 0
>>>> +DAI_CONFIG(SSP, 5, 0, SSP5-Codec,
>>>> +	SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000,
>>>> codec_mclk_in),
>>>> +		SSP_CLOCK(bclk, 1920000, codec_slave),
>>>> +		SSP_CLOCK(fsync, 48000, codec_slave),
>>>> +		SSP_TDM(2, 20, 3, 3),
>>>> +		SSP_CONFIG_DATA(SSP, 5, 16, 0)))
>>>> +
>>>> +# FIXME: the machine driver uses .name = "SSP1-Codec", .id=1,
>>>> .cpu_name="SSP1 Pin"
>>>> +#SSP 1 (ID: 1) with 19.2MHz mclk with MCLK_ID 0
>>>> +DAI_CONFIG(SSP, 1, 1, SSP1-Codec,
>>>> +	SSP_CONFIG(I2S, SSP_CLOCK(mclk, 19200000,
>>>> codec_mclk_in),
>>>> +		SSP_CLOCK(bclk, 1920000, codec_slave),
>>>> +		SSP_CLOCK(fsync, 48000, codec_slave),
>>>> +		SSP_TDM(2, 20, 3, 3),
>>>> +		SSP_CONFIG_DATA(SSP, 1, 16, 0)))
>>> _______________________________________________
>>> Sound-open-firmware mailing list
>>> Sound-open-firmware at alsa-project.org
>>> http://mailman.alsa-project.org/mailman/listinfo/sound-open-firmwar
>>> e
>>



More information about the Sound-open-firmware mailing list