Lines Matching +full:i2s +full:- +full:out
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Au1000/Au1500/Au1100 I2S controller driver for ASoC
7 * Note: clock supplied to the I2S controller must be 256x samplerate.
18 #include <asm/mach-au1x00/au1000.h>
39 #define CFG_FM_I2S (0 << 7) /* I2S format */
40 #define CFG_FM_LJ (1 << 7) /* left-justified */
41 #define CFG_FM_RJ (2 << 7) /* right-justified */
72 return __raw_readl(ctx->mmio + reg); in RD()
77 __raw_writel(v, ctx->mmio + reg); in WR()
87 ret = -EINVAL; in au1xi2s_set_fmt()
88 c = ctx->cfg; in au1xi2s_set_fmt()
102 goto out; in au1xi2s_set_fmt()
105 c &= ~(CFG_IC | CFG_ICK); /* IB-IF */ in au1xi2s_set_fmt()
119 goto out; in au1xi2s_set_fmt()
122 /* I2S controller only supports provider */ in au1xi2s_set_fmt()
127 goto out; in au1xi2s_set_fmt()
131 ctx->cfg = c; in au1xi2s_set_fmt()
132 out: in au1xi2s_set_fmt()
148 ctx->cfg |= (stype == PCM_TX) ? CFG_TN : CFG_RN; in au1xi2s_trigger()
149 WR(ctx, I2S_CFG, ctx->cfg); in au1xi2s_trigger()
153 ctx->cfg &= ~((stype == PCM_TX) ? CFG_TN : CFG_RN); in au1xi2s_trigger()
154 WR(ctx, I2S_CFG, ctx->cfg); in au1xi2s_trigger()
158 return -EINVAL; in au1xi2s_trigger()
188 v = msbits_to_reg(params->msbits); in au1xi2s_hw_params()
190 return -EINVAL; in au1xi2s_hw_params()
192 ctx->cfg &= ~CFG_SZ_MASK; in au1xi2s_hw_params()
193 ctx->cfg |= v; in au1xi2s_hw_params()
201 snd_soc_dai_set_dma_data(dai, substream, &ctx->dmaids[0]); in au1xi2s_startup()
239 ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); in au1xi2s_drvprobe()
241 return -ENOMEM; in au1xi2s_drvprobe()
245 return -ENODEV; in au1xi2s_drvprobe()
247 if (!devm_request_mem_region(&pdev->dev, iores->start, in au1xi2s_drvprobe()
249 pdev->name)) in au1xi2s_drvprobe()
250 return -EBUSY; in au1xi2s_drvprobe()
252 ctx->mmio = devm_ioremap(&pdev->dev, iores->start, in au1xi2s_drvprobe()
254 if (!ctx->mmio) in au1xi2s_drvprobe()
255 return -EBUSY; in au1xi2s_drvprobe()
259 return -EBUSY; in au1xi2s_drvprobe()
260 ctx->dmaids[SNDRV_PCM_STREAM_PLAYBACK] = dmares->start; in au1xi2s_drvprobe()
264 return -EBUSY; in au1xi2s_drvprobe()
265 ctx->dmaids[SNDRV_PCM_STREAM_CAPTURE] = dmares->start; in au1xi2s_drvprobe()
269 return snd_soc_register_component(&pdev->dev, &au1xi2s_component, in au1xi2s_drvprobe()
277 snd_soc_unregister_component(&pdev->dev); in au1xi2s_drvremove()
312 .name = "alchemy-i2sc",
322 MODULE_DESCRIPTION("Au1000/1500/1100 I2S ASoC driver");