Lines Matching +full:i2s +full:- +full:rx
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * pxa2xx-i2s.c -- ALSA Soc Audio Layer
21 #include <sound/pxa2xx-lib.h>
24 #include <linux/platform_data/asoc-pxa.h>
26 #include "pxa2xx-i2s.h"
29 * I2S Controller Register and Bit Definitions
32 #define SACR1 (0x0004) /* Serial Audio I 2 S/MSB-Justified Control Register */
33 #define SASR0 (0x000C) /* Serial Audio I 2 S/MSB-Justified Interface and FIFO Status Register */
37 #define SADR (0x0080) /* Serial Audio Data Register (TX and RX FIFO access Register). */
39 #define SACR0_RFTH(x) ((x) << 12) /* Rx FIFO Interrupt or DMA Trigger Threshold */
43 #define SACR0_RST (1 << 3) /* FIFO, i2s Register Reset */
45 #define SACR0_ENB (1 << 0) /* Enable I2S Link */
52 #define SASR0_ROR (1 << 6) /* Rx FIFO Overrun */
54 #define SASR0_RFS (1 << 4) /* Rx FIFO Service Request */
56 #define SASR0_BSY (1 << 2) /* I2S Busy */
57 #define SASR0_RNE (1 << 1) /* Rx FIFO Not Empty */
60 #define SAICR_ROR (1 << 6) /* Clear Rx FIFO Overrun Interrupt */
63 #define SAIMR_ROR (1 << 6) /* Enable Rx FIFO Overrun Condition Interrupt */
65 #define SAIMR_RFS (1 << 4) /* Enable Rx FIFO Service Interrupt */
89 .chan_name = "rx",
108 /* wait for I2S controller to be ready */
113 /* flush the Rx FIFO */ in pxa_i2s_wait()
149 return -ENODEV; in pxa2xx_i2s_set_dai_sysclk()
161 return -EINVAL; in pxa2xx_i2s_hw_params()
166 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in pxa2xx_i2s_hw_params()
182 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in pxa2xx_i2s_hw_params()
221 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) in pxa2xx_i2s_trigger()
234 ret = -EINVAL; in pxa2xx_i2s_trigger()
243 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { in pxa2xx_i2s_shutdown()
297 clk_i2s = clk_get(dai->dev, "I2SCLK"); in pxa2xx_i2s_probe()
305 * I2S controller registers. in pxa2xx_i2s_probe()
323 clk_i2s = ERR_PTR(-ENOENT); in pxa2xx_i2s_remove()
358 .name = "pxa-i2s",
379 pxa2xx_i2s_pcm_stereo_out.addr = res->start + SADR; in pxa2xx_i2s_drv_probe()
380 pxa2xx_i2s_pcm_stereo_in.addr = res->start + SADR; in pxa2xx_i2s_drv_probe()
382 return devm_snd_soc_register_component(&pdev->dev, &pxa_i2s_component, in pxa2xx_i2s_drv_probe()
390 .name = "pxa2xx-i2s",
396 clk_i2s = ERR_PTR(-ENOENT); in pxa2xx_i2s_init()
410 MODULE_DESCRIPTION("pxa2xx I2S SoC Interface");
412 MODULE_ALIAS("platform:pxa2xx-i2s");