ASoC: SOF: imx: Describe SAI parameters to be sent to DSP
authorGuido Roncarolo <guido.roncarolo@nxp.com>
Wed, 18 Dec 2019 00:26:15 +0000 (18:26 -0600)
committerMark Brown <broonie@kernel.org>
Wed, 18 Dec 2019 19:54:07 +0000 (19:54 +0000)
Introduce sof_ipc_dai_sai_params to keep information that
we get from topology and we send to DSP FW.
For the moment it is identical to ESAI one but it will
evolve shortly independently

Signed-off-by: Guido Roncarolo <guido.roncarolo@nxp.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191218002616.7652-8-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/sof/dai-imx.h
include/sound/sof/dai.h
include/uapi/sound/sof/tokens.h

index e02fb0b0fae165f2026e4d68c453e329117bfbf0..ff9088dcc6f2e9de5497492f5f0de48649a85ddb 100644 (file)
@@ -31,4 +31,24 @@ struct sof_ipc_dai_esai_params {
        uint16_t reserved2;     /* alignment */
 } __packed;
 
+/* SAI Configuration Request - SOF_IPC_DAI_SAI_CONFIG */
+struct sof_ipc_dai_sai_params {
+       struct sof_ipc_hdr hdr;
+
+       /* MCLK */
+       uint16_t reserved1;
+       uint16_t mclk_id;
+       uint32_t mclk_direction;
+
+       uint32_t mclk_rate;     /* MCLK frequency in Hz */
+       uint32_t fsync_rate;    /* FSYNC frequency in Hz */
+       uint32_t bclk_rate;     /* BCLK frequency in Hz */
+
+       /* TDM */
+       uint32_t tdm_slots;
+       uint32_t rx_slots;
+       uint32_t tx_slots;
+       uint16_t tdm_slot_width;
+       uint16_t reserved2;     /* alignment */
+} __packed;
 #endif
index c229565767e53a8c0c14c61424ce81911f2b736c..2565edd336f15d8bcd5958b148714c093d2de29b 100644 (file)
@@ -75,6 +75,7 @@ struct sof_ipc_dai_config {
                struct sof_ipc_dai_hda_params hda;
                struct sof_ipc_dai_alh_params alh;
                struct sof_ipc_dai_esai_params esai;
+               struct sof_ipc_dai_sai_params sai;
        };
 } __packed;
 
index a9a5c4d0a89202e5bc9aea188649293937189ac3..2a25cd8da5033e1cb9ed502d23979118adb4300b 100644 (file)
 #define SOF_TKN_EFFECT_TYPE    SOF_TKN_PROCESS_TYPE
 
 /* SAI */
-#define SOF_TKN_IMX_SAI_FIRST_TOKEN            1000
-/* TODO: Add SAI tokens */
+#define SOF_TKN_IMX_SAI_MCLK_ID                        1000
 
 /* ESAI */
 #define SOF_TKN_IMX_ESAI_MCLK_ID               1100