forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/sound/soc/bcm/bcm2835-i2s.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * ALSA SoC I2S Audio Layer for Broadcom BCM2835 SoC
34 *
....@@ -20,15 +21,6 @@
2021 * Freescale SSI ALSA SoC Digital Audio Interface (DAI) driver
2122 * Author: Timur Tabi <timur@freescale.com>
2223 * Copyright 2007-2010 Freescale Semiconductor, Inc.
23
- *
24
- * This program is free software; you can redistribute it and/or
25
- * modify it under the terms of the GNU General Public License
26
- * version 2 as published by the Free Software Foundation.
27
- *
28
- * This program is distributed in the hope that it will be useful, but
29
- * WITHOUT ANY WARRANTY; without even the implied warranty of
30
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31
- * General Public License for more details.
3224 */
3325
3426 #include <linux/bitops.h>
....@@ -661,7 +653,7 @@
661653 BCM2835_I2S_CS_A_REG, mask, 0);
662654
663655 /* Stop also the clock when not SND_SOC_DAIFMT_CONT */
664
- if (!dai->active && !(dev->fmt & SND_SOC_DAIFMT_CONT))
656
+ if (!snd_soc_dai_active(dai) && !(dev->fmt & SND_SOC_DAIFMT_CONT))
665657 bcm2835_i2s_stop_clock(dev);
666658 }
667659
....@@ -703,7 +695,7 @@
703695 {
704696 struct bcm2835_i2s_dev *dev = snd_soc_dai_get_drvdata(dai);
705697
706
- if (dai->active)
698
+ if (snd_soc_dai_active(dai))
707699 return 0;
708700
709701 /* Should this still be running stop it */
....@@ -731,7 +723,7 @@
731723 bcm2835_i2s_stop(dev, substream, dai);
732724
733725 /* If both streams are stopped, disable module and clock */
734
- if (dai->active)
726
+ if (snd_soc_dai_active(dai))
735727 return;
736728
737729 /* Disable the module */
....@@ -836,7 +828,6 @@
836828 {
837829 struct bcm2835_i2s_dev *dev;
838830 int ret;
839
- struct resource *mem;
840831 void __iomem *base;
841832 const __be32 *addr;
842833 dma_addr_t dma_base;
....@@ -850,14 +841,16 @@
850841 dev->clk_prepared = false;
851842 dev->clk = devm_clk_get(&pdev->dev, NULL);
852843 if (IS_ERR(dev->clk)) {
853
- dev_err(&pdev->dev, "could not get clk: %ld\n",
854
- PTR_ERR(dev->clk));
855
- return PTR_ERR(dev->clk);
844
+ ret = PTR_ERR(dev->clk);
845
+ if (ret == -EPROBE_DEFER)
846
+ dev_dbg(&pdev->dev, "could not get clk: %d\n", ret);
847
+ else
848
+ dev_err(&pdev->dev, "could not get clk: %d\n", ret);
849
+ return ret;
856850 }
857851
858852 /* Request ioarea */
859
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
860
- base = devm_ioremap_resource(&pdev->dev, mem);
853
+ base = devm_platform_ioremap_resource(pdev, 0);
861854 if (IS_ERR(base))
862855 return PTR_ERR(base);
863856