Lines Matching refs:ahub
34 static struct tegra30_ahub *ahub; variable
38 regmap_write(ahub->regmap_apbif, reg, val); in tegra30_apbif_write()
45 regmap_read(ahub->regmap_apbif, reg, &val); in tegra30_apbif_read()
51 regmap_write(ahub->regmap_ahub, reg, val); in tegra30_audio_write()
56 regcache_cache_only(ahub->regmap_apbif, true); in tegra30_ahub_runtime_suspend()
57 regcache_cache_only(ahub->regmap_ahub, true); in tegra30_ahub_runtime_suspend()
59 clk_disable_unprepare(ahub->clk_apbif); in tegra30_ahub_runtime_suspend()
60 clk_disable_unprepare(ahub->clk_d_audio); in tegra30_ahub_runtime_suspend()
80 ret = clk_prepare_enable(ahub->clk_d_audio); in tegra30_ahub_runtime_resume()
85 ret = clk_prepare_enable(ahub->clk_apbif); in tegra30_ahub_runtime_resume()
88 clk_disable(ahub->clk_d_audio); in tegra30_ahub_runtime_resume()
92 regcache_cache_only(ahub->regmap_apbif, false); in tegra30_ahub_runtime_resume()
93 regcache_cache_only(ahub->regmap_ahub, false); in tegra30_ahub_runtime_resume()
106 channel = find_first_zero_bit(ahub->rx_usage, in tegra30_ahub_allocate_rx_fifo()
111 __set_bit(channel, ahub->rx_usage); in tegra30_ahub_allocate_rx_fifo()
115 *fiforeg = ahub->apbif_addr + TEGRA30_AHUB_CHANNEL_RXFIFO + in tegra30_ahub_allocate_rx_fifo()
118 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_allocate_rx_fifo()
144 ahub->soc_data->set_audio_cif(ahub->regmap_apbif, reg, &cif_conf); in tegra30_ahub_allocate_rx_fifo()
146 pm_runtime_put(ahub->dev); in tegra30_ahub_allocate_rx_fifo()
157 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_enable_rx_fifo()
165 pm_runtime_put(ahub->dev); in tegra30_ahub_enable_rx_fifo()
176 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_disable_rx_fifo()
184 pm_runtime_put(ahub->dev); in tegra30_ahub_disable_rx_fifo()
194 __clear_bit(channel, ahub->rx_usage); in tegra30_ahub_free_rx_fifo()
208 channel = find_first_zero_bit(ahub->tx_usage, in tegra30_ahub_allocate_tx_fifo()
213 __set_bit(channel, ahub->tx_usage); in tegra30_ahub_allocate_tx_fifo()
217 *fiforeg = ahub->apbif_addr + TEGRA30_AHUB_CHANNEL_TXFIFO + in tegra30_ahub_allocate_tx_fifo()
220 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_allocate_tx_fifo()
246 ahub->soc_data->set_audio_cif(ahub->regmap_apbif, reg, &cif_conf); in tegra30_ahub_allocate_tx_fifo()
248 pm_runtime_put(ahub->dev); in tegra30_ahub_allocate_tx_fifo()
259 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_enable_tx_fifo()
267 pm_runtime_put(ahub->dev); in tegra30_ahub_enable_tx_fifo()
278 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_disable_tx_fifo()
286 pm_runtime_put(ahub->dev); in tegra30_ahub_disable_tx_fifo()
296 __clear_bit(channel, ahub->tx_usage); in tegra30_ahub_free_tx_fifo()
308 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_set_rx_cif_source()
314 pm_runtime_put(ahub->dev); in tegra30_ahub_set_rx_cif_source()
325 pm_runtime_get_sync(ahub->dev); in tegra30_ahub_unset_rx_cif_source()
331 pm_runtime_put(ahub->dev); in tegra30_ahub_unset_rx_cif_source()
529 if (ahub) in tegra30_ahub_probe()
562 ahub = devm_kzalloc(&pdev->dev, sizeof(struct tegra30_ahub), in tegra30_ahub_probe()
564 if (!ahub) in tegra30_ahub_probe()
566 dev_set_drvdata(&pdev->dev, ahub); in tegra30_ahub_probe()
568 ahub->soc_data = soc_data; in tegra30_ahub_probe()
569 ahub->dev = &pdev->dev; in tegra30_ahub_probe()
571 ahub->clk_d_audio = devm_clk_get(&pdev->dev, "d_audio"); in tegra30_ahub_probe()
572 if (IS_ERR(ahub->clk_d_audio)) { in tegra30_ahub_probe()
574 ret = PTR_ERR(ahub->clk_d_audio); in tegra30_ahub_probe()
578 ahub->clk_apbif = devm_clk_get(&pdev->dev, "apbif"); in tegra30_ahub_probe()
579 if (IS_ERR(ahub->clk_apbif)) { in tegra30_ahub_probe()
581 ret = PTR_ERR(ahub->clk_apbif); in tegra30_ahub_probe()
590 ahub->apbif_addr = res0->start; in tegra30_ahub_probe()
592 ahub->regmap_apbif = devm_regmap_init_mmio(&pdev->dev, regs_apbif, in tegra30_ahub_probe()
594 if (IS_ERR(ahub->regmap_apbif)) { in tegra30_ahub_probe()
596 ret = PTR_ERR(ahub->regmap_apbif); in tegra30_ahub_probe()
599 regcache_cache_only(ahub->regmap_apbif, true); in tegra30_ahub_probe()
606 ahub->regmap_ahub = devm_regmap_init_mmio(&pdev->dev, regs_ahub, in tegra30_ahub_probe()
608 if (IS_ERR(ahub->regmap_ahub)) { in tegra30_ahub_probe()
610 ret = PTR_ERR(ahub->regmap_ahub); in tegra30_ahub_probe()
613 regcache_cache_only(ahub->regmap_ahub, true); in tegra30_ahub_probe()
634 if (!ahub) in tegra30_ahub_remove()
647 regcache_mark_dirty(ahub->regmap_ahub); in tegra30_ahub_suspend()
648 regcache_mark_dirty(ahub->regmap_apbif); in tegra30_ahub_suspend()
660 ret = regcache_sync(ahub->regmap_ahub); in tegra30_ahub_resume()
661 ret |= regcache_sync(ahub->regmap_apbif); in tegra30_ahub_resume()