12a32bc26bf6d3c0aa47d36a9eb3fa5a5e42f13c
[openwrt/staging/mkresin.git] / target / linux / layerscape / patches-5.4 / 801-audio-0011-Revert-ASoC-fsl_sai-add-of_match-data.patch
1 From 6e0abca40338d5078be0e5947c7f9723b40bc7e7 Mon Sep 17 00:00:00 2001
2 From: Dong Aisheng <aisheng.dong@nxp.com>
3 Date: Mon, 30 Mar 2020 16:17:52 +0800
4 Subject: [PATCH] Revert "ASoC: fsl_sai: add of_match data"
5
6 This reverts commit 89c9679f699d88986ce552738dc7c5c500c8fc67.
7
8 [rebase]
9 Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
10 ---
11 sound/soc/fsl/fsl_sai.c | 22 ++++++++--------------
12 sound/soc/fsl/fsl_sai.h | 6 +-----
13 2 files changed, 9 insertions(+), 19 deletions(-)
14
15 --- a/sound/soc/fsl/fsl_sai.c
16 +++ b/sound/soc/fsl/fsl_sai.c
17 @@ -9,7 +9,6 @@
18 #include <linux/dmaengine.h>
19 #include <linux/module.h>
20 #include <linux/of_address.h>
21 -#include <linux/of_device.h>
22 #include <linux/pm_runtime.h>
23 #include <linux/regmap.h>
24 #include <linux/slab.h>
25 @@ -789,7 +788,10 @@ static int fsl_sai_probe(struct platform
26 return -ENOMEM;
27
28 sai->pdev = pdev;
29 - sai->soc_data = of_device_get_match_data(&pdev->dev);
30 +
31 + if (of_device_is_compatible(np, "fsl,imx6sx-sai") ||
32 + of_device_is_compatible(np, "fsl,imx6ul-sai"))
33 + sai->sai_on_imx = true;
34
35 sai->is_lsb_first = of_property_read_bool(np, "lsb-first");
36
37 @@ -901,7 +903,7 @@ static int fsl_sai_probe(struct platform
38 if (ret)
39 goto err_pm_disable;
40
41 - if (sai->soc_data->use_imx_pcm) {
42 + if (sai->sai_on_imx)
43 ret = imx_pcm_dma_init(pdev, IMX_SAI_DMABUF_SIZE);
44 if (ret)
45 goto err_pm_disable;
46 @@ -926,18 +928,10 @@ static int fsl_sai_remove(struct platfor
47 return 0;
48 }
49
50 -static const struct fsl_sai_soc_data fsl_sai_vf610_data = {
51 - .use_imx_pcm = false,
52 -};
53 -
54 -static const struct fsl_sai_soc_data fsl_sai_imx6sx_data = {
55 - .use_imx_pcm = true,
56 -};
57 -
58 static const struct of_device_id fsl_sai_ids[] = {
59 - { .compatible = "fsl,vf610-sai", .data = &fsl_sai_vf610_data },
60 - { .compatible = "fsl,imx6sx-sai", .data = &fsl_sai_imx6sx_data },
61 - { .compatible = "fsl,imx6ul-sai", .data = &fsl_sai_imx6sx_data },
62 + { .compatible = "fsl,vf610-sai", },
63 + { .compatible = "fsl,imx6sx-sai", },
64 + { .compatible = "fsl,imx6ul-sai", },
65 { /* sentinel */ }
66 };
67 MODULE_DEVICE_TABLE(of, fsl_sai_ids);
68 --- a/sound/soc/fsl/fsl_sai.h
69 +++ b/sound/soc/fsl/fsl_sai.h
70 @@ -126,10 +126,6 @@
71 #define FSL_SAI_MAXBURST_TX 6
72 #define FSL_SAI_MAXBURST_RX 6
73
74 -struct fsl_sai_soc_data {
75 - bool use_imx_pcm;
76 -};
77 -
78 struct fsl_sai {
79 struct platform_device *pdev;
80 struct regmap *regmap;
81 @@ -139,6 +135,7 @@ struct fsl_sai {
82 bool is_slave_mode;
83 bool is_lsb_first;
84 bool is_dsp_mode;
85 + bool sai_on_imx;
86 bool synchronous[2];
87
88 unsigned int mclk_id[2];
89 @@ -146,7 +143,6 @@ struct fsl_sai {
90 unsigned int slots;
91 unsigned int slot_width;
92
93 - const struct fsl_sai_soc_data *soc_data;
94 struct snd_soc_dai_driver cpu_dai_drv;
95 struct snd_dmaengine_dai_dma_data dma_params_rx;
96 struct snd_dmaengine_dai_dma_data dma_params_tx;