Lines Matching full:ac97

3  * tegra20_ac97.c - Tegra20 AC97 platform driver
32 #define DRV_NAME "tegra20-ac97"
36 static void tegra20_ac97_codec_reset(struct snd_ac97 *ac97) in tegra20_ac97_codec_reset() argument
62 static void tegra20_ac97_codec_warm_reset(struct snd_ac97 *ac97) in tegra20_ac97_codec_warm_reset() argument
141 static inline void tegra20_ac97_start_playback(struct tegra20_ac97 *ac97) in tegra20_ac97_start_playback() argument
143 regmap_update_bits(ac97->regmap, TEGRA20_AC97_FIFO1_SCR, in tegra20_ac97_start_playback()
147 regmap_update_bits(ac97->regmap, TEGRA20_AC97_CTRL, in tegra20_ac97_start_playback()
154 static inline void tegra20_ac97_stop_playback(struct tegra20_ac97 *ac97) in tegra20_ac97_stop_playback() argument
156 regmap_update_bits(ac97->regmap, TEGRA20_AC97_FIFO1_SCR, in tegra20_ac97_stop_playback()
159 regmap_update_bits(ac97->regmap, TEGRA20_AC97_CTRL, in tegra20_ac97_stop_playback()
163 static inline void tegra20_ac97_start_capture(struct tegra20_ac97 *ac97) in tegra20_ac97_start_capture() argument
165 regmap_update_bits(ac97->regmap, TEGRA20_AC97_FIFO1_SCR, in tegra20_ac97_start_capture()
170 static inline void tegra20_ac97_stop_capture(struct tegra20_ac97 *ac97) in tegra20_ac97_stop_capture() argument
172 regmap_update_bits(ac97->regmap, TEGRA20_AC97_FIFO1_SCR, in tegra20_ac97_stop_capture()
179 struct tegra20_ac97 *ac97 = snd_soc_dai_get_drvdata(dai); in tegra20_ac97_trigger() local
186 tegra20_ac97_start_playback(ac97); in tegra20_ac97_trigger()
188 tegra20_ac97_start_capture(ac97); in tegra20_ac97_trigger()
194 tegra20_ac97_stop_playback(ac97); in tegra20_ac97_trigger()
196 tegra20_ac97_stop_capture(ac97); in tegra20_ac97_trigger()
207 struct tegra20_ac97 *ac97 = snd_soc_dai_get_drvdata(dai); in tegra20_ac97_probe() local
209 snd_soc_dai_init_dma_data(dai, &ac97->playback_dma_data, in tegra20_ac97_probe()
210 &ac97->capture_dma_data); in tegra20_ac97_probe()
221 .name = "tegra-ac97-pcm",
303 struct tegra20_ac97 *ac97; in tegra20_ac97_platform_probe() local
308 ac97 = devm_kzalloc(&pdev->dev, sizeof(struct tegra20_ac97), in tegra20_ac97_platform_probe()
310 if (!ac97) { in tegra20_ac97_platform_probe()
314 dev_set_drvdata(&pdev->dev, ac97); in tegra20_ac97_platform_probe()
316 ac97->reset = devm_reset_control_get_exclusive(&pdev->dev, "ac97"); in tegra20_ac97_platform_probe()
317 if (IS_ERR(ac97->reset)) { in tegra20_ac97_platform_probe()
318 dev_err(&pdev->dev, "Can't retrieve ac97 reset\n"); in tegra20_ac97_platform_probe()
319 ret = PTR_ERR(ac97->reset); in tegra20_ac97_platform_probe()
323 ac97->clk_ac97 = devm_clk_get(&pdev->dev, NULL); in tegra20_ac97_platform_probe()
324 if (IS_ERR(ac97->clk_ac97)) { in tegra20_ac97_platform_probe()
325 dev_err(&pdev->dev, "Can't retrieve ac97 clock\n"); in tegra20_ac97_platform_probe()
326 ret = PTR_ERR(ac97->clk_ac97); in tegra20_ac97_platform_probe()
336 ac97->regmap = devm_regmap_init_mmio(&pdev->dev, regs, in tegra20_ac97_platform_probe()
338 if (IS_ERR(ac97->regmap)) { in tegra20_ac97_platform_probe()
340 ret = PTR_ERR(ac97->regmap); in tegra20_ac97_platform_probe()
345 ac97->reset_gpio = devm_gpiod_get(&pdev->dev, in tegra20_ac97_platform_probe()
348 if (IS_ERR(ac97->reset_gpio)) { in tegra20_ac97_platform_probe()
349 ret = PTR_ERR(ac97->reset_gpio); in tegra20_ac97_platform_probe()
353 gpiod_set_consumer_name(ac97->reset_gpio, "codec-reset"); in tegra20_ac97_platform_probe()
355 ac97->sync_gpio = devm_gpiod_get(&pdev->dev, in tegra20_ac97_platform_probe()
358 if (IS_ERR(ac97->sync_gpio)) { in tegra20_ac97_platform_probe()
359 ret = PTR_ERR(ac97->sync_gpio); in tegra20_ac97_platform_probe()
363 gpiod_set_consumer_name(ac97->sync_gpio, "codec-sync"); in tegra20_ac97_platform_probe()
365 ac97->capture_dma_data.addr = mem->start + TEGRA20_AC97_FIFO_RX1; in tegra20_ac97_platform_probe()
366 ac97->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; in tegra20_ac97_platform_probe()
367 ac97->capture_dma_data.maxburst = 4; in tegra20_ac97_platform_probe()
369 ac97->playback_dma_data.addr = mem->start + TEGRA20_AC97_FIFO_TX1; in tegra20_ac97_platform_probe()
370 ac97->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; in tegra20_ac97_platform_probe()
371 ac97->playback_dma_data.maxburst = 4; in tegra20_ac97_platform_probe()
373 ret = reset_control_assert(ac97->reset); in tegra20_ac97_platform_probe()
379 ret = clk_prepare_enable(ac97->clk_ac97); in tegra20_ac97_platform_probe()
387 ret = reset_control_deassert(ac97->reset); in tegra20_ac97_platform_probe()
413 /* XXX: crufty ASoC AC97 API - only one AC97 codec allowed */ in tegra20_ac97_platform_probe()
414 workdata = ac97; in tegra20_ac97_platform_probe()
421 clk_disable_unprepare(ac97->clk_ac97); in tegra20_ac97_platform_probe()
430 struct tegra20_ac97 *ac97 = dev_get_drvdata(&pdev->dev); in tegra20_ac97_platform_remove() local
435 clk_disable_unprepare(ac97->clk_ac97); in tegra20_ac97_platform_remove()
441 { .compatible = "nvidia,tegra20-ac97", },
456 MODULE_DESCRIPTION("Tegra20 AC97 ASoC driver");