forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/sound/soc/fsl/imx-ssi.c
....@@ -1,35 +1,28 @@
1
-/*
2
- * imx-ssi.c -- ALSA Soc Audio Layer
3
- *
4
- * Copyright 2009 Sascha Hauer <s.hauer@pengutronix.de>
5
- *
6
- * This code is based on code copyrighted by Freescale,
7
- * Liam Girdwood, Javier Martin and probably others.
8
- *
9
- * This program is free software; you can redistribute it and/or modify it
10
- * under the terms of the GNU General Public License as published by the
11
- * Free Software Foundation; either version 2 of the License, or (at your
12
- * option) any later version.
13
- *
14
- *
15
- * The i.MX SSI core has some nasty limitations in AC97 mode. While most
16
- * sane processor vendors have a FIFO per AC97 slot, the i.MX has only
17
- * one FIFO which combines all valid receive slots. We cannot even select
18
- * which slots we want to receive. The WM9712 with which this driver
19
- * was developed with always sends GPIO status data in slot 12 which
20
- * we receive in our (PCM-) data stream. The only chance we have is to
21
- * manually skip this data in the FIQ handler. With sampling rates different
22
- * from 48000Hz not every frame has valid receive data, so the ratio
23
- * between pcm data and GPIO status data changes. Our FIQ handler is not
24
- * able to handle this, hence this driver only works with 48000Hz sampling
25
- * rate.
26
- * Reading and writing AC97 registers is another challenge. The core
27
- * provides us status bits when the read register is updated with *another*
28
- * value. When we read the same register two times (and the register still
29
- * contains the same value) these status bits are not set. We work
30
- * around this by not polling these bits but only wait a fixed delay.
31
- *
32
- */
1
+// SPDX-License-Identifier: GPL-2.0+
2
+//
3
+// imx-ssi.c -- ALSA Soc Audio Layer
4
+//
5
+// Copyright 2009 Sascha Hauer <s.hauer@pengutronix.de>
6
+//
7
+// This code is based on code copyrighted by Freescale,
8
+// Liam Girdwood, Javier Martin and probably others.
9
+//
10
+// The i.MX SSI core has some nasty limitations in AC97 mode. While most
11
+// sane processor vendors have a FIFO per AC97 slot, the i.MX has only
12
+// one FIFO which combines all valid receive slots. We cannot even select
13
+// which slots we want to receive. The WM9712 with which this driver
14
+// was developed with always sends GPIO status data in slot 12 which
15
+// we receive in our (PCM-) data stream. The only chance we have is to
16
+// manually skip this data in the FIQ handler. With sampling rates different
17
+// from 48000Hz not every frame has valid receive data, so the ratio
18
+// between pcm data and GPIO status data changes. Our FIQ handler is not
19
+// able to handle this, hence this driver only works with 48000Hz sampling
20
+// rate.
21
+// Reading and writing AC97 registers is another challenge. The core
22
+// provides us status bits when the read register is updated with *another*
23
+// value. When we read the same register two times (and the register still
24
+// contains the same value) these status bits are not set. We work
25
+// around this by not polling these bits but only wait a fixed delay.
3326
3427 #include <linux/clk.h>
3528 #include <linux/delay.h>
....@@ -380,7 +373,6 @@
380373
381374 static struct snd_soc_dai_driver imx_ac97_dai = {
382375 .probe = imx_ssi_dai_probe,
383
- .bus_control = true,
384376 .playback = {
385377 .stream_name = "AC97 Playback",
386378 .channels_min = 2,
....@@ -527,10 +519,8 @@
527519 }
528520
529521 ssi->irq = platform_get_irq(pdev, 0);
530
- if (ssi->irq < 0) {
531
- dev_err(&pdev->dev, "Failed to get IRQ: %d\n", ssi->irq);
522
+ if (ssi->irq < 0)
532523 return ssi->irq;
533
- }
534524
535525 ssi->clk = devm_clk_get(&pdev->dev, NULL);
536526 if (IS_ERR(ssi->clk)) {