Lines Matching full:i2s

60 	struct axi_i2s *i2s = snd_soc_dai_get_drvdata(dai);  in axi_i2s_trigger()  local
83 regmap_update_bits(i2s->regmap, AXI_I2S_REG_CTRL, mask, val); in axi_i2s_trigger()
91 struct axi_i2s *i2s = snd_soc_dai_get_drvdata(dai); in axi_i2s_hw_params() local
98 bclk_div = DIV_ROUND_UP(clk_get_rate(i2s->clk_ref), bclk_rate) / 2 - 1; in axi_i2s_hw_params()
100 regmap_write(i2s->regmap, AXI_I2S_REG_CLK_CTRL, (word_size << 16) | in axi_i2s_hw_params()
109 struct axi_i2s *i2s = snd_soc_dai_get_drvdata(dai); in axi_i2s_startup() local
118 regmap_write(i2s->regmap, AXI_I2S_REG_RESET, mask); in axi_i2s_startup()
122 &i2s->rate_constraints); in axi_i2s_startup()
126 return clk_prepare_enable(i2s->clk_ref); in axi_i2s_startup()
132 struct axi_i2s *i2s = snd_soc_dai_get_drvdata(dai); in axi_i2s_shutdown() local
134 clk_disable_unprepare(i2s->clk_ref); in axi_i2s_shutdown()
139 struct axi_i2s *i2s = snd_soc_dai_get_drvdata(dai); in axi_i2s_dai_probe() local
143 i2s->has_playback ? &i2s->playback_dma_data : NULL, in axi_i2s_dai_probe()
144 i2s->has_capture ? &i2s->capture_dma_data : NULL); in axi_i2s_dai_probe()
163 .name = "axi-i2s",
174 static void axi_i2s_parse_of(struct axi_i2s *i2s, const struct device_node *np) in axi_i2s_parse_of() argument
181 i2s->has_capture = true; in axi_i2s_parse_of()
183 i2s->has_playback = true; in axi_i2s_parse_of()
190 struct axi_i2s *i2s; in axi_i2s_probe() local
194 i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL); in axi_i2s_probe()
195 if (!i2s) in axi_i2s_probe()
198 platform_set_drvdata(pdev, i2s); in axi_i2s_probe()
200 axi_i2s_parse_of(i2s, pdev->dev.of_node); in axi_i2s_probe()
206 i2s->regmap = devm_regmap_init_mmio(&pdev->dev, base, in axi_i2s_probe()
208 if (IS_ERR(i2s->regmap)) in axi_i2s_probe()
209 return PTR_ERR(i2s->regmap); in axi_i2s_probe()
211 i2s->clk = devm_clk_get(&pdev->dev, "axi"); in axi_i2s_probe()
212 if (IS_ERR(i2s->clk)) in axi_i2s_probe()
213 return PTR_ERR(i2s->clk); in axi_i2s_probe()
215 i2s->clk_ref = devm_clk_get(&pdev->dev, "ref"); in axi_i2s_probe()
216 if (IS_ERR(i2s->clk_ref)) in axi_i2s_probe()
217 return PTR_ERR(i2s->clk_ref); in axi_i2s_probe()
219 ret = clk_prepare_enable(i2s->clk); in axi_i2s_probe()
223 if (i2s->has_playback) { in axi_i2s_probe()
230 i2s->playback_dma_data.addr = res->start + AXI_I2S_REG_TX_FIFO; in axi_i2s_probe()
231 i2s->playback_dma_data.addr_width = 4; in axi_i2s_probe()
232 i2s->playback_dma_data.maxburst = 1; in axi_i2s_probe()
235 if (i2s->has_capture) { in axi_i2s_probe()
242 i2s->capture_dma_data.addr = res->start + AXI_I2S_REG_RX_FIFO; in axi_i2s_probe()
243 i2s->capture_dma_data.addr_width = 4; in axi_i2s_probe()
244 i2s->capture_dma_data.maxburst = 1; in axi_i2s_probe()
247 i2s->ratnum.num = clk_get_rate(i2s->clk_ref) / 2 / AXI_I2S_BITS_PER_FRAME; in axi_i2s_probe()
248 i2s->ratnum.den_step = 1; in axi_i2s_probe()
249 i2s->ratnum.den_min = 1; in axi_i2s_probe()
250 i2s->ratnum.den_max = 64; in axi_i2s_probe()
252 i2s->rate_constraints.rats = &i2s->ratnum; in axi_i2s_probe()
253 i2s->rate_constraints.nrats = 1; in axi_i2s_probe()
255 regmap_write(i2s->regmap, AXI_I2S_REG_RESET, AXI_I2S_RESET_GLOBAL); in axi_i2s_probe()
267 i2s->has_capture ? "enabled" : "disabled", in axi_i2s_probe()
268 i2s->has_playback ? "enabled" : "disabled"); in axi_i2s_probe()
273 clk_disable_unprepare(i2s->clk); in axi_i2s_probe()
279 struct axi_i2s *i2s = platform_get_drvdata(pdev); in axi_i2s_dev_remove() local
281 clk_disable_unprepare(i2s->clk); in axi_i2s_dev_remove()
285 { .compatible = "adi,axi-i2s-1.00.a", },
292 .name = "axi-i2s",
301 MODULE_DESCRIPTION("AXI I2S driver");