801-audio-0011-Revert-ASoC-fsl_sai-add-of_match-data.patch 2.7 KB

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