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()
567 dev_set_drvdata(&pdev->dev, ahub); in tegra30_ahub_probe()
569 ahub->soc_data = soc_data; in tegra30_ahub_probe()
570 ahub->dev = &pdev->dev; in tegra30_ahub_probe()
572 ahub->clk_d_audio = devm_clk_get(&pdev->dev, "d_audio"); in tegra30_ahub_probe()
573 if (IS_ERR(ahub->clk_d_audio)) { in tegra30_ahub_probe()
575 ret = PTR_ERR(ahub->clk_d_audio); in tegra30_ahub_probe()
579 ahub->clk_apbif = devm_clk_get(&pdev->dev, "apbif"); in tegra30_ahub_probe()
580 if (IS_ERR(ahub->clk_apbif)) { in tegra30_ahub_probe()
582 ret = PTR_ERR(ahub->clk_apbif); in tegra30_ahub_probe()
591 ahub->apbif_addr = res0->start; in tegra30_ahub_probe()
593 ahub->regmap_apbif = devm_regmap_init_mmio(&pdev->dev, regs_apbif, in tegra30_ahub_probe()
595 if (IS_ERR(ahub->regmap_apbif)) { in tegra30_ahub_probe()
597 ret = PTR_ERR(ahub->regmap_apbif); in tegra30_ahub_probe()
600 regcache_cache_only(ahub->regmap_apbif, true); in tegra30_ahub_probe()
607 ahub->regmap_ahub = devm_regmap_init_mmio(&pdev->dev, regs_ahub, in tegra30_ahub_probe()
609 if (IS_ERR(ahub->regmap_ahub)) { in tegra30_ahub_probe()
611 ret = PTR_ERR(ahub->regmap_ahub); in tegra30_ahub_probe()
614 regcache_cache_only(ahub->regmap_ahub, true); in tegra30_ahub_probe()
635 if (!ahub) in tegra30_ahub_remove()
648 regcache_mark_dirty(ahub->regmap_ahub); in tegra30_ahub_suspend()
649 regcache_mark_dirty(ahub->regmap_apbif); in tegra30_ahub_suspend()
661 ret = regcache_sync(ahub->regmap_ahub); in tegra30_ahub_resume()
662 ret |= regcache_sync(ahub->regmap_apbif); in tegra30_ahub_resume()