aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl/fsl_sai.h
diff options
context:
space:
mode:
authorShengjiu Wang <shengjiu.wang@nxp.com>2022-06-17 15:44:37 +0800
committerMark Brown <broonie@kernel.org>2022-06-27 13:18:11 +0100
commite3f4e5b1a3e654d518155b37c7b2084cbce9d1a7 (patch)
treef320c27e02c6bed045c8812f86ed013835752c69 /sound/soc/fsl/fsl_sai.h
parentASoC: dt-bindings: fsl-sai: Add new property to configure dataline (diff)
downloadlinux-dev-e3f4e5b1a3e654d518155b37c7b2084cbce9d1a7.tar.xz
linux-dev-e3f4e5b1a3e654d518155b37c7b2084cbce9d1a7.zip
ASoC: fsl_sai: Configure dataline/FIFO information from dts property
The SAI has multiple successive FIFO registers, but in some use case the required dataline/FIFOs are not successive, so need get such information from dts property "fsl,dataline" fsl,dataline has 3 values for each configuration: first one means the type: I2S(1) or DSD(2), second one is dataline mask for 'rx', third one is dataline mask for 'tx'. Also set dma peripheral address and TRCE bits according to data lane. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Signed-off-by: Viorel Suman <viorel.suman@nxp.com> Link: https://lore.kernel.org/r/1655451877-16382-8-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/fsl/fsl_sai.h')
-rw-r--r--sound/soc/fsl/fsl_sai.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h
index 4d657edc9c9f..9bb8ced520c8 100644
--- a/sound/soc/fsl/fsl_sai.h
+++ b/sound/soc/fsl/fsl_sai.h
@@ -218,6 +218,13 @@
#define PMQOS_CPU_LATENCY BIT(0)
+/* Max number of dataline */
+#define FSL_SAI_DL_NUM (8)
+/* default dataline type is zero */
+#define FSL_SAI_DL_DEFAULT (0)
+#define FSL_SAI_DL_I2S BIT(0)
+#define FSL_SAI_DL_PDM BIT(1)
+
struct fsl_sai_soc_data {
bool use_imx_pcm;
bool use_edma;
@@ -253,6 +260,14 @@ struct fsl_sai_param {
u32 dataline;
};
+struct fsl_sai_dl_cfg {
+ unsigned int type;
+ unsigned int pins[2];
+ unsigned int mask[2];
+ unsigned int start_off[2];
+ unsigned int next_off[2];
+};
+
struct fsl_sai {
struct platform_device *pdev;
struct regmap *regmap;
@@ -265,6 +280,8 @@ struct fsl_sai {
bool is_dsp_mode;
bool is_pdm_mode;
bool synchronous[2];
+ struct fsl_sai_dl_cfg *dl_cfg;
+ unsigned int dl_cfg_cnt;
unsigned int mclk_id[2];
unsigned int mclk_streams;