sound/soc/tegra/tegra30_ahub.c
Source file repositories/reference/linux-study-clean/sound/soc/tegra/tegra30_ahub.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/tegra/tegra30_ahub.c- Extension
.c- Size
- 18340 bytes
- Lines
- 688
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/clk.hlinux/device.hlinux/io.hlinux/module.hlinux/of_platform.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hlinux/reset.hlinux/slab.hsound/soc.htegra30_ahub.h
Detected Declarations
function tegra30_apbif_writefunction tegra30_apbif_readfunction tegra30_audio_writefunction tegra30_ahub_runtime_suspendfunction tegra30_ahub_runtime_resumefunction tegra30_ahub_allocate_rx_fifofunction tegra30_ahub_enable_rx_fifofunction tegra30_ahub_disable_rx_fifofunction tegra30_ahub_free_rx_fifofunction tegra30_ahub_allocate_tx_fifofunction tegra30_ahub_enable_tx_fifofunction tegra30_ahub_disable_tx_fifofunction tegra30_ahub_free_tx_fifofunction tegra30_ahub_set_rx_cif_sourcefunction tegra30_ahub_unset_rx_cif_sourcefunction tegra30_ahub_apbif_wr_rd_regfunction tegra30_ahub_apbif_volatile_regfunction tegra30_ahub_apbif_precious_regfunction tegra30_ahub_ahub_wr_rd_regfunction tegra30_ahub_probefunction tegra30_ahub_removefunction tegra30_ahub_set_ciffunction tegra124_ahub_set_cifexport tegra30_ahub_allocate_rx_fifoexport tegra30_ahub_enable_rx_fifoexport tegra30_ahub_disable_rx_fifoexport tegra30_ahub_free_rx_fifoexport tegra30_ahub_allocate_tx_fifoexport tegra30_ahub_enable_tx_fifoexport tegra30_ahub_disable_tx_fifoexport tegra30_ahub_free_tx_fifoexport tegra30_ahub_set_rx_cif_sourceexport tegra30_ahub_unset_rx_cif_sourceexport tegra30_ahub_set_cifexport tegra124_ahub_set_cif
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* tegra30_ahub.c - Tegra30 AHUB driver
*
* Copyright (c) 2011,2012, NVIDIA CORPORATION. All rights reserved.
*/
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <sound/soc.h>
#include "tegra30_ahub.h"
#define DRV_NAME "tegra30-ahub"
static struct tegra30_ahub *ahub;
static inline void tegra30_apbif_write(u32 reg, u32 val)
{
regmap_write(ahub->regmap_apbif, reg, val);
}
static inline u32 tegra30_apbif_read(u32 reg)
{
u32 val;
regmap_read(ahub->regmap_apbif, reg, &val);
return val;
}
static inline void tegra30_audio_write(u32 reg, u32 val)
{
regmap_write(ahub->regmap_ahub, reg, val);
}
static int tegra30_ahub_runtime_suspend(struct device *dev)
{
regcache_cache_only(ahub->regmap_apbif, true);
regcache_cache_only(ahub->regmap_ahub, true);
clk_bulk_disable_unprepare(ahub->nclocks, ahub->clocks);
return 0;
}
/*
* clk_apbif isn't required for an I2S<->I2S configuration where no PCM data
* is read from or sent to memory. However, that's not something the rest of
* the driver supports right now, so we'll just treat the two clocks as one
* for now.
*
* These functions should not be a plain ref-count. Instead, each active stream
* contributes some requirement to the minimum clock rate, so starting or
* stopping streams should dynamically adjust the clock as required. However,
* this is not yet implemented.
*/
static int tegra30_ahub_runtime_resume(struct device *dev)
{
int ret;
ret = reset_control_bulk_assert(ahub->nresets, ahub->resets);
if (ret)
return ret;
ret = clk_bulk_prepare_enable(ahub->nclocks, ahub->clocks);
if (ret)
return ret;
usleep_range(10, 100);
ret = reset_control_bulk_deassert(ahub->nresets, ahub->resets);
if (ret)
goto disable_clocks;
regcache_cache_only(ahub->regmap_apbif, false);
regcache_cache_only(ahub->regmap_ahub, false);
regcache_mark_dirty(ahub->regmap_apbif);
regcache_mark_dirty(ahub->regmap_ahub);
ret = regcache_sync(ahub->regmap_apbif);
if (ret)
goto disable_clocks;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/device.h`, `linux/io.h`, `linux/module.h`, `linux/of_platform.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `linux/regmap.h`.
- Detected declarations: `function tegra30_apbif_write`, `function tegra30_apbif_read`, `function tegra30_audio_write`, `function tegra30_ahub_runtime_suspend`, `function tegra30_ahub_runtime_resume`, `function tegra30_ahub_allocate_rx_fifo`, `function tegra30_ahub_enable_rx_fifo`, `function tegra30_ahub_disable_rx_fifo`, `function tegra30_ahub_free_rx_fifo`, `function tegra30_ahub_allocate_tx_fifo`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.