Lines Matching refs:ahub
34 static struct tegra30_ahub *ahub; variable
38 regmap_write(ahub->regmap_apbif, reg, val); in tegra30_apbif_write()
44 regmap_read(ahub->regmap_apbif, reg, &val); in tegra30_apbif_read()
50 regmap_write(ahub->regmap_ahub, reg, val); in tegra30_audio_write()
55 regcache_cache_only(ahub->regmap_apbif, true); in tegra30_ahub_runtime_suspend()
56 regcache_cache_only(ahub->regmap_ahub, true); in tegra30_ahub_runtime_suspend()
58 clk_disable_unprepare(ahub->clk_apbif); in tegra30_ahub_runtime_suspend()
59 clk_disable_unprepare(ahub->clk_d_audio); in tegra30_ahub_runtime_suspend()
79 ret = clk_prepare_enable(ahub->clk_d_audio); in tegra30_ahub_runtime_resume()
84 ret = clk_prepare_enable(ahub->clk_apbif); in tegra30_ahub_runtime_resume()
87 clk_disable(ahub->clk_d_audio); in tegra30_ahub_runtime_resume()
91 regcache_cache_only(ahub->regmap_apbif, false); in tegra30_ahub_runtime_resume()
92 regcache_cache_only(ahub->regmap_ahub, false); in tegra30_ahub_runtime_resume()
105 channel = find_first_zero_bit(ahub->rx_usage, in tegra30_ahub_allocate_rx_fifo()
110 __set_bit(channel, ahub->rx_usage); in tegra30_ahub_allocate_rx_fifo()
114 *fiforeg = ahub->apbif_addr + TEGRA30_AHUB_CHANNEL_RXFIFO + in tegra30_ahub_allocate_rx_fifo()
117 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_allocate_rx_fifo()
143 ahub->soc_data->set_audio_cif(ahub->regmap_apbif, reg, &cif_conf); in tegra30_ahub_allocate_rx_fifo()
145 pm_runtime_put(ahub->dev); in tegra30_ahub_allocate_rx_fifo()
156 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_enable_rx_fifo()
164 pm_runtime_put(ahub->dev); in tegra30_ahub_enable_rx_fifo()
175 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_disable_rx_fifo()
183 pm_runtime_put(ahub->dev); in tegra30_ahub_disable_rx_fifo()
193 __clear_bit(channel, ahub->rx_usage); in tegra30_ahub_free_rx_fifo()
207 channel = find_first_zero_bit(ahub->tx_usage, in tegra30_ahub_allocate_tx_fifo()
212 __set_bit(channel, ahub->tx_usage); in tegra30_ahub_allocate_tx_fifo()
216 *fiforeg = ahub->apbif_addr + TEGRA30_AHUB_CHANNEL_TXFIFO + in tegra30_ahub_allocate_tx_fifo()
219 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_allocate_tx_fifo()
245 ahub->soc_data->set_audio_cif(ahub->regmap_apbif, reg, &cif_conf); in tegra30_ahub_allocate_tx_fifo()
247 pm_runtime_put(ahub->dev); in tegra30_ahub_allocate_tx_fifo()
258 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_enable_tx_fifo()
266 pm_runtime_put(ahub->dev); in tegra30_ahub_enable_tx_fifo()
277 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_disable_tx_fifo()
285 pm_runtime_put(ahub->dev); in tegra30_ahub_disable_tx_fifo()
295 __clear_bit(channel, ahub->tx_usage); in tegra30_ahub_free_tx_fifo()
307 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_set_rx_cif_source()
313 pm_runtime_put(ahub->dev); in tegra30_ahub_set_rx_cif_source()
324 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_unset_rx_cif_source()
330 pm_runtime_put(ahub->dev); in tegra30_ahub_unset_rx_cif_source()
528 if (ahub) in tegra30_ahub_probe()
561 ahub = devm_kzalloc(&pdev->dev, sizeof(struct tegra30_ahub), in tegra30_ahub_probe()
563 if (!ahub) { in tegra30_ahub_probe()
568 dev_set_drvdata(&pdev->dev, ahub); in tegra30_ahub_probe()
570 ahub->soc_data = soc_data; in tegra30_ahub_probe()
571 ahub->dev = &pdev->dev; in tegra30_ahub_probe()
573 ahub->clk_d_audio = clk_get(&pdev->dev, "d_audio"); in tegra30_ahub_probe()
574 if (IS_ERR(ahub->clk_d_audio)) { in tegra30_ahub_probe()
576 ret = PTR_ERR(ahub->clk_d_audio); in tegra30_ahub_probe()
580 ahub->clk_apbif = clk_get(&pdev->dev, "apbif"); in tegra30_ahub_probe()
581 if (IS_ERR(ahub->clk_apbif)) { in tegra30_ahub_probe()
583 ret = PTR_ERR(ahub->clk_apbif); in tegra30_ahub_probe()
601 ahub->apbif_addr = res0->start; in tegra30_ahub_probe()
611 ahub->regmap_apbif = devm_regmap_init_mmio(&pdev->dev, regs_apbif, in tegra30_ahub_probe()
613 if (IS_ERR(ahub->regmap_apbif)) { in tegra30_ahub_probe()
615 ret = PTR_ERR(ahub->regmap_apbif); in tegra30_ahub_probe()
618 regcache_cache_only(ahub->regmap_apbif, true); in tegra30_ahub_probe()
643 ahub->regmap_ahub = devm_regmap_init_mmio(&pdev->dev, regs_ahub, in tegra30_ahub_probe()
645 if (IS_ERR(ahub->regmap_ahub)) { in tegra30_ahub_probe()
647 ret = PTR_ERR(ahub->regmap_ahub); in tegra30_ahub_probe()
650 regcache_cache_only(ahub->regmap_ahub, true); in tegra30_ahub_probe()
666 clk_put(ahub->clk_apbif); in tegra30_ahub_probe()
668 clk_put(ahub->clk_d_audio); in tegra30_ahub_probe()
669 ahub = NULL; in tegra30_ahub_probe()
676 if (!ahub) in tegra30_ahub_remove()
683 clk_put(ahub->clk_apbif); in tegra30_ahub_remove()
684 clk_put(ahub->clk_d_audio); in tegra30_ahub_remove()
686 ahub = NULL; in tegra30_ahub_remove()
694 regcache_mark_dirty(ahub->regmap_ahub); in tegra30_ahub_suspend()
695 regcache_mark_dirty(ahub->regmap_apbif); in tegra30_ahub_suspend()
707 ret = regcache_sync(ahub->regmap_ahub); in tegra30_ahub_resume()
708 ret |= regcache_sync(ahub->regmap_apbif); in tegra30_ahub_resume()