[Sound-open-firmware] [PATCH] topology: mirror alsa-lib definitions for mclk/bclk

Pan, Xiuli xiuli.pan at linux.intel.com
Sat Apr 28 05:46:37 CEST 2018



On 4/28/2018 02:47, Pierre-Louis Bossart wrote:
> ALSA-lib introduced new definitions to work around an logical
> inversion for master/slave definitions. see e.g. commit 3778a30bb00
> ('ASoC: topology: Fix bclk and fsync inversion in
> set_link_hw_format()')
>
> Make sure clarifications are reflected in the topology files
> bclk/fsync slave -> codec_slave
> mclk slave -> codec_mclk_in
>
> This patch requires the use of the latest alsa-lib git master (v1.1.6
> does not contain the relevant patches).
> This patch also requires an updated kernel.
>
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart at linux.intel.com>
> ---
>   topology/sof-apl-nocodec.m4             |  6 +++---
>   topology/sof-apl-tdf8532.m4             | 12 ++++++------
>   topology/sof-bdw-rt286.m4               |  6 +++---
>   topology/sof-bdw-rt5640.m4              |  6 +++---
>   topology/sof-byt-da7213.m4              |  6 +++---
>   topology/sof-byt-nocodec.m4             |  6 +++---
>   topology/sof-byt-rt5640.m4              |  6 +++---
>   topology/sof-byt-rt5645.m4              |  6 +++---
>   topology/sof-byt-rt5651.m4              |  6 +++---
>   topology/sof-cht-max98090.m4            |  6 +++---
>   topology/sof-cht-nocodec.m4             |  6 +++---
>   topology/sof-cnl-rt274.m4               |  6 +++---
>   topology/sof-hsw-rt5640.m4              |  6 +++---
>   topology/test/test-capture-ssp.m4       |  6 +++---
>   topology/test/test-playback-ssp.m4      |  6 +++---
>   topology/test/test-ssp.m4               |  6 +++---
>   topology/test/test-tone-playback-ssp.m4 |  6 +++---
>   17 files changed, 54 insertions(+), 54 deletions(-)
>
> diff --git a/topology/sof-apl-nocodec.m4 b/topology/sof-apl-nocodec.m4
> index 78a1a4e..9c4286b 100644
> --- a/topology/sof-apl-nocodec.m4
> +++ b/topology/sof-apl-nocodec.m4
> @@ -94,7 +94,7 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
>   # BE configurations - overrides config in ACPI if present
>   #
>   DAI_CONFIG(SSP, 2, NoCodec, I2S, 24,
> -	DAI_CLOCK(mclk, 19200000, slave),
> -	DAI_CLOCK(bclk, 2400000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 19200000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 2400000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
modify to macro may be simple to our case. It will easier to revert the 
change if someone is using some old version ALSA-lib.

Thanks
Xiuli

diff --git a/topology/m4/dai.m4 b/topology/m4/dai.m4
index 0b030af..a3dc39e 100644
--- a/topology/m4/dai.m4
+++ b/topology/m4/dai.m4
@@ -125,7 +125,7 @@ define(`D_DAI', `SectionDAI."'N_DAI`" {'

  dnl DAI_CLOCK(clock, freq, codec_master)
  define(`DAI_CLOCK',
-       $1              STR($3)
+       $1              "codec_$3"
         $1_freq STR($2))




>   	DAI_TDM(2, 25, 3, 3))
> diff --git a/topology/sof-apl-tdf8532.m4 b/topology/sof-apl-tdf8532.m4
> index 50023f0..1ff0a0d 100644
> --- a/topology/sof-apl-tdf8532.m4
> +++ b/topology/sof-apl-tdf8532.m4
> @@ -77,13 +77,13 @@ PCM_DUPLEX_ADD(Port2, 4, 1, 1, PIPELINE_PCM_2, PIPELINE_PCM_3)
>   # BE configurations - overrides config in ACPI if present
>   #
>   DAI_CONFIG(SSP, 4, SSP4-Codec, DSP_B, 32,
> -	DAI_CLOCK(mclk, 24576000, slave),
> -	DAI_CLOCK(bclk, 12288000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 24576000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 12288000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(8, 32, 15, 15))
>   
>   DAI_CONFIG(SSP, 2, SSP2-Codec, I2S, 16,
> -	DAI_CLOCK(mclk, 24576000, slave),
> -	DAI_CLOCK(bclk, 1536000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 24576000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 1536000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, 16, 3, 3))
> diff --git a/topology/sof-bdw-rt286.m4 b/topology/sof-bdw-rt286.m4
> index c7dded6..a13a49c 100644
> --- a/topology/sof-bdw-rt286.m4
> +++ b/topology/sof-bdw-rt286.m4
> @@ -94,7 +94,7 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
>   # BE configurations - overrides config in ACPI if present
>   #
>   DAI_CONFIG(SSP, 0, Codec, I2S, 24,
> -	DAI_CLOCK(mclk, 24000000, slave),
> -	DAI_CLOCK(bclk, 2400000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 24000000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 2400000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, 25, 3, 3))
> diff --git a/topology/sof-bdw-rt5640.m4 b/topology/sof-bdw-rt5640.m4
> index 0a083e4..007944a 100644
> --- a/topology/sof-bdw-rt5640.m4
> +++ b/topology/sof-bdw-rt5640.m4
> @@ -94,7 +94,7 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
>   # BE configurations - overrides config in ACPI if present
>   #
>   DAI_CONFIG(SSP, 0, Codec, I2S, 24,
> -	DAI_CLOCK(mclk, 24000000, slave),
> -	DAI_CLOCK(bclk, 2400000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 24000000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 2400000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, 25, 3, 3))
> diff --git a/topology/sof-byt-da7213.m4 b/topology/sof-byt-da7213.m4
> index 1e77e7e..ecf90c6 100644
> --- a/topology/sof-byt-da7213.m4
> +++ b/topology/sof-byt-da7213.m4
> @@ -94,7 +94,7 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
>   # BE configurations - overrides config in ACPI if present
>   #
>   DAI_CONFIG(SSP, 2, SSP2-Codec, I2S, 24,
> -	DAI_CLOCK(mclk, 19200000, slave),
> -	DAI_CLOCK(bclk, 2400000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 19200000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 2400000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, 25, 3, 3))
> diff --git a/topology/sof-byt-nocodec.m4 b/topology/sof-byt-nocodec.m4
> index 3be5d00..efa321b 100644
> --- a/topology/sof-byt-nocodec.m4
> +++ b/topology/sof-byt-nocodec.m4
> @@ -94,7 +94,7 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
>   # BE configurations - overrides config in ACPI if present
>   #
>   DAI_CONFIG(SSP, 2, NoCodec, I2S, 24,
> -	DAI_CLOCK(mclk, 19200000, slave),
> -	DAI_CLOCK(bclk, 2400000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 19200000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 2400000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, 25, 3, 3))
> diff --git a/topology/sof-byt-rt5640.m4 b/topology/sof-byt-rt5640.m4
> index 14313db..ae54969 100644
> --- a/topology/sof-byt-rt5640.m4
> +++ b/topology/sof-byt-rt5640.m4
> @@ -94,7 +94,7 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
>   # BE configurations - overrides config in ACPI if present
>   #
>   DAI_CONFIG(SSP, 2, SSP2-Codec, I2S, 24,
> -	DAI_CLOCK(mclk, 19200000, slave),
> -	DAI_CLOCK(bclk, 2400000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 19200000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 2400000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, 25, 3, 3))
> diff --git a/topology/sof-byt-rt5645.m4 b/topology/sof-byt-rt5645.m4
> index 15cac48..364121f 100644
> --- a/topology/sof-byt-rt5645.m4
> +++ b/topology/sof-byt-rt5645.m4
> @@ -94,7 +94,7 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
>   # BE configurations - overrides config in ACPI if present
>   #
>   DAI_CONFIG(SSP, 2, SSP2-Codec, I2S, 24,
> -	DAI_CLOCK(mclk, 19200000, slave),
> -	DAI_CLOCK(bclk, 2400000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 19200000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 2400000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, 25, 3, 3))
> diff --git a/topology/sof-byt-rt5651.m4 b/topology/sof-byt-rt5651.m4
> index 0e76c56..be3d994 100644
> --- a/topology/sof-byt-rt5651.m4
> +++ b/topology/sof-byt-rt5651.m4
> @@ -94,8 +94,8 @@ PCM_DUPLEX_ADD(Low Latency, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
>   # BE configurations - overrides config in ACPI if present
>   #
>   DAI_CONFIG(SSP, 2, SSP2-Codec, I2S, 24,
> -	DAI_CLOCK(mclk, 19200000, slave),
> -	DAI_CLOCK(bclk, 2400000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 19200000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 2400000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, 25, 3, 3))
>   
> diff --git a/topology/sof-cht-max98090.m4 b/topology/sof-cht-max98090.m4
> index ab1b639..7ba4df7 100644
> --- a/topology/sof-cht-max98090.m4
> +++ b/topology/sof-cht-max98090.m4
> @@ -94,7 +94,7 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
>   # BE configurations - overrides config in ACPI if present
>   #
>   DAI_CONFIG(SSP, 2, SSP2-Codec, I2S, 16,
> -	DAI_CLOCK(mclk, 19200000, slave),
> -	DAI_CLOCK(bclk, 1920000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 19200000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 1920000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, 20, 3, 3))
> diff --git a/topology/sof-cht-nocodec.m4 b/topology/sof-cht-nocodec.m4
> index 3f61e44..a0eb9cd 100644
> --- a/topology/sof-cht-nocodec.m4
> +++ b/topology/sof-cht-nocodec.m4
> @@ -94,7 +94,7 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
>   # BE configurations - overrides config in ACPI if present
>   #
>   DAI_CONFIG(SSP, 2, NoCodec, I2S, 24,
> -	DAI_CLOCK(mclk, 19200000, slave),
> -	DAI_CLOCK(bclk, 2400000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 19200000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 2400000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, 25, 3, 3))
> diff --git a/topology/sof-cnl-rt274.m4 b/topology/sof-cnl-rt274.m4
> index 495fab3..89d5a25 100644
> --- a/topology/sof-cnl-rt274.m4
> +++ b/topology/sof-cnl-rt274.m4
> @@ -65,7 +65,7 @@ PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
>   # BE configurations - overrides config in ACPI if present
>   #
>   DAI_CONFIG(SSP, 0, SSP0-Codec, DSP_B, 24,
> -	DAI_CLOCK(mclk, 24000000, slave),
> -	DAI_CLOCK(bclk, 4800000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 24000000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 4800000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(4, 25, 3, 3))
> diff --git a/topology/sof-hsw-rt5640.m4 b/topology/sof-hsw-rt5640.m4
> index 5516451..85b8209 100644
> --- a/topology/sof-hsw-rt5640.m4
> +++ b/topology/sof-hsw-rt5640.m4
> @@ -94,7 +94,7 @@ PCM_DUPLEX_ADD(Low Latency, 6, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
>   # BE configurations - overrides config in ACPI if present
>   #
>   DAI_CONFIG(SSP, 0, Codec, I2S, 24,
> -	DAI_CLOCK(mclk, 24000000, slave),
> -	DAI_CLOCK(bclk, 2400000, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, 24000000, codec_mclk_in),
> +	DAI_CLOCK(bclk, 2400000, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, 25, 3, 3))
> diff --git a/topology/test/test-capture-ssp.m4 b/topology/test/test-capture-ssp.m4
> index 78b6479..6d666dc 100644
> --- a/topology/test/test-capture-ssp.m4
> +++ b/topology/test/test-capture-ssp.m4
> @@ -69,7 +69,7 @@ PCM_CAPTURE_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_2)
>   # TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT
>   #
>   DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS,
> -	DAI_CLOCK(mclk, TEST_SSP_MCLK, slave),
> -	DAI_CLOCK(bclk, TEST_SSP_BCLK, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in),
> +	DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3))
> diff --git a/topology/test/test-playback-ssp.m4 b/topology/test/test-playback-ssp.m4
> index e4b09ec..5ee1b53 100644
> --- a/topology/test/test-playback-ssp.m4
> +++ b/topology/test/test-playback-ssp.m4
> @@ -69,7 +69,7 @@ PCM_PLAYBACK_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1)
>   # TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT
>   #
>   DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS,
> -	DAI_CLOCK(mclk, TEST_SSP_MCLK, slave),
> -	DAI_CLOCK(bclk, TEST_SSP_BCLK, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_slave),
> +	DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3))
> diff --git a/topology/test/test-ssp.m4 b/topology/test/test-ssp.m4
> index 676e19b..1bdce2f 100644
> --- a/topology/test/test-ssp.m4
> +++ b/topology/test/test-ssp.m4
> @@ -87,7 +87,7 @@ PCM_DUPLEX_ADD(Passthrough, 3, 0, 0, PIPELINE_PCM_1, PIPELINE_PCM_2)
>   # TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT
>   #
>   DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, TEST_SSP_MODE, TEST_SSP_DATA_BITS,
> -	DAI_CLOCK(mclk, TEST_SSP_MCLK, slave),
> -	DAI_CLOCK(bclk, TEST_SSP_BCLK, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in),
> +	DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3))
> diff --git a/topology/test/test-tone-playback-ssp.m4 b/topology/test/test-tone-playback-ssp.m4
> index 7cf1ed5..069ad64 100644
> --- a/topology/test/test-tone-playback-ssp.m4
> +++ b/topology/test/test-tone-playback-ssp.m4
> @@ -57,7 +57,7 @@ DAI_ADD(sof/pipe-dai-playback.m4,
>   # TEST_SSP_DATA_BITS bit I2S using TEST_SSP_PHY_BITS bit sample conatiner on SSP TEST_SSP_PORT
>   #
>   DAI_CONFIG(SSP, TEST_SSP_PORT, TEST_DAI_LINK_NAME, I2S, TEST_SSP_DATA_BITS,
> -	DAI_CLOCK(mclk, TEST_SSP_MCLK, slave),
> -	DAI_CLOCK(bclk, TEST_SSP_BCLK, slave),
> -	DAI_CLOCK(fsync, 48000, slave),
> +	DAI_CLOCK(mclk, TEST_SSP_MCLK, codec_mclk_in),
> +	DAI_CLOCK(bclk, TEST_SSP_BCLK, codec_slave),
> +	DAI_CLOCK(fsync, 48000, codec_slave),
>   	DAI_TDM(2, TEST_SSP_PHY_BITS, 3, 3))



More information about the Sound-open-firmware mailing list