0052-ASoC-dwc-i2s-Fix-getting-platform-data-error-for-Sta.patch 1015 B

123456789101112131415161718192021222324252627282930
  1. From 9cc8de0cdc1600f460f618e342e1f524adad07c4 Mon Sep 17 00:00:00 2001
  2. From: Xingyu Wu <[email protected]>
  3. Date: Wed, 21 Feb 2024 10:23:48 +0800
  4. Subject: [PATCH 052/116] ASoC: dwc: i2s: Fix getting platform data error for
  5. StarFive JH7110
  6. JH7110 need to use a DT specific function to get the platform data,
  7. otherwise, it fails in probe().
  8. Fixes: 9c97790a07dc ("ASoC: dwc: Fix non-DT instantiation")
  9. Signed-off-by: Xingyu Wu <[email protected]>
  10. Signed-off-by: Hal Feng <[email protected]>
  11. ---
  12. sound/soc/dwc/dwc-i2s.c | 4 ++++
  13. 1 file changed, 4 insertions(+)
  14. --- a/sound/soc/dwc/dwc-i2s.c
  15. +++ b/sound/soc/dwc/dwc-i2s.c
  16. @@ -916,7 +916,11 @@ static int jh7110_i2stx0_clk_cfg(struct
  17. static int dw_i2s_probe(struct platform_device *pdev)
  18. {
  19. +#ifdef CONFIG_OF
  20. + const struct i2s_platform_data *pdata = of_device_get_match_data(&pdev->dev);
  21. +#else
  22. const struct i2s_platform_data *pdata = pdev->dev.platform_data;
  23. +#endif
  24. struct dw_i2s_dev *dev;
  25. struct resource *res;
  26. int ret, irq;