sound/soc/uniphier/aio-cpu.c
Source file repositories/reference/linux-study-clean/sound/soc/uniphier/aio-cpu.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/uniphier/aio-cpu.c- Extension
.c- Size
- 19828 bytes
- Lines
- 833
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/errno.hlinux/kernel.hlinux/mfd/syscon.hlinux/module.hlinux/of.hlinux/of_platform.hlinux/platform_device.hlinux/reset.hsound/core.hsound/pcm.hsound/pcm_params.hsound/soc.haio.h
Detected Declarations
function is_valid_pllfunction match_specfunction driversfunction find_dividerfunction uniphier_aio_set_sysclkfunction uniphier_aio_set_pllfunction uniphier_aio_set_fmtfunction uniphier_aio_startupfunction uniphier_aio_shutdownfunction uniphier_aio_hw_paramsfunction uniphier_aio_hw_freefunction uniphier_aio_preparefunction uniphier_aio_dai_probefunction uniphier_aio_dai_removefunction uniphier_aio_ld11_probefunction uniphier_aio_pxs2_probefunction uniphier_aio_dai_suspendfunction uniphier_aio_suspendfunction uniphier_aio_dai_resumefunction uniphier_aio_resumefunction uniphier_aio_vol_infofunction uniphier_aio_vol_getfunction uniphier_aio_vol_putfunction uniphier_aio_probefunction uniphier_aio_removeexport uniphier_aio_i2s_ld11_opsexport uniphier_aio_spdif_ld11_opsexport uniphier_aio_spdif_ld11_ops2export uniphier_aio_i2s_pxs2_opsexport uniphier_aio_spdif_pxs2_opsexport uniphier_aio_spdif_pxs2_ops2export uniphier_aio_probeexport uniphier_aio_remove
Annotated Snippet
if (div_id >= 0) {
aio->plldiv = div_id;
break;
}
}
if (pll_id == aio->chip->num_plls) {
dev_err(dev, "Sysclk frequency is not supported(%d)\n",
freq);
return -EINVAL;
}
}
if (dir == SND_SOC_CLOCK_OUT)
aio->pll_out = pll_id;
else
aio->pll_in = pll_id;
return 0;
}
static int uniphier_aio_set_pll(struct snd_soc_dai *dai, int pll_id,
int source, unsigned int freq_in,
unsigned int freq_out)
{
struct uniphier_aio *aio = uniphier_priv(dai);
int ret;
if (!is_valid_pll(aio->chip, pll_id))
return -EINVAL;
ret = aio_chip_set_pll(aio->chip, pll_id, freq_out);
if (ret < 0)
return ret;
return 0;
}
static int uniphier_aio_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
{
struct uniphier_aio *aio = uniphier_priv(dai);
struct device *dev = &aio->chip->pdev->dev;
switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
case SND_SOC_DAIFMT_LEFT_J:
case SND_SOC_DAIFMT_RIGHT_J:
case SND_SOC_DAIFMT_I2S:
aio->fmt = fmt & SND_SOC_DAIFMT_FORMAT_MASK;
break;
default:
dev_err(dev, "Format is not supported(%d)\n",
fmt & SND_SOC_DAIFMT_FORMAT_MASK);
return -EINVAL;
}
return 0;
}
static int uniphier_aio_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct uniphier_aio *aio = uniphier_priv(dai);
struct uniphier_aio_sub *sub = &aio->sub[substream->stream];
sub->substream = substream;
sub->pass_through = 0;
sub->use_mmap = true;
return aio_init(sub);
}
static void uniphier_aio_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct uniphier_aio *aio = uniphier_priv(dai);
struct uniphier_aio_sub *sub = &aio->sub[substream->stream];
sub->substream = NULL;
}
static int uniphier_aio_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params,
struct snd_soc_dai *dai)
{
struct uniphier_aio *aio = uniphier_priv(dai);
struct uniphier_aio_sub *sub = &aio->sub[substream->stream];
struct device *dev = &aio->chip->pdev->dev;
int freq, ret;
switch (params_rate(params)) {
case 48000:
Annotation
- Immediate include surface: `linux/clk.h`, `linux/errno.h`, `linux/kernel.h`, `linux/mfd/syscon.h`, `linux/module.h`, `linux/of.h`, `linux/of_platform.h`, `linux/platform_device.h`.
- Detected declarations: `function is_valid_pll`, `function match_spec`, `function drivers`, `function find_divider`, `function uniphier_aio_set_sysclk`, `function uniphier_aio_set_pll`, `function uniphier_aio_set_fmt`, `function uniphier_aio_startup`, `function uniphier_aio_shutdown`, `function uniphier_aio_hw_params`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.