sound/soc/pxa/pxa2xx-ac97.c
Source file repositories/reference/linux-study-clean/sound/soc/pxa/pxa2xx-ac97.c
File Facts
- System
- Linux kernel
- Corpus path
sound/soc/pxa/pxa2xx-ac97.c- Extension
.c- Size
- 7831 bytes
- Lines
- 300
- Domain
- Driver Families
- Bucket
- sound/soc
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/io.hlinux/module.hlinux/platform_device.hlinux/dmaengine.hlinux/dma/pxa-dma.hsound/ac97/controller.hsound/core.hsound/ac97_codec.hsound/soc.hsound/dmaengine_pcm.hlinux/platform_data/asoc-pxa.hpxa2xx-lib.h
Detected Declarations
function pxa2xx_ac97_warm_resetfunction pxa2xx_ac97_cold_resetfunction pxa2xx_ac97_read_actrlfunction pxa2xx_ac97_write_actrlfunction pxa2xx_ac97_hifi_startupfunction pxa2xx_ac97_aux_startupfunction pxa2xx_ac97_mic_startupfunction pxa2xx_ac97_dev_probefunction pxa2xx_ac97_dev_removefunction pxa2xx_ac97_dev_suspendfunction pxa2xx_ac97_dev_resume
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* linux/sound/pxa2xx-ac97.c -- AC97 support for the Intel PXA2xx chip.
*
* Author: Nicolas Pitre
* Created: Dec 02, 2004
* Copyright: MontaVista Software Inc.
*/
#include <linux/init.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/dmaengine.h>
#include <linux/dma/pxa-dma.h>
#include <sound/ac97/controller.h>
#include <sound/core.h>
#include <sound/ac97_codec.h>
#include <sound/soc.h>
#include <sound/dmaengine_pcm.h>
#include <linux/platform_data/asoc-pxa.h>
#include "pxa2xx-lib.h"
#define PCDR 0x0040 /* PCM FIFO Data Register */
#define MODR 0x0140 /* Modem FIFO Data Register */
#define MCDR 0x0060 /* Mic-in FIFO Data Register */
static void pxa2xx_ac97_warm_reset(struct ac97_controller *adrv)
{
pxa2xx_ac97_try_warm_reset();
pxa2xx_ac97_finish_reset();
}
static void pxa2xx_ac97_cold_reset(struct ac97_controller *adrv)
{
pxa2xx_ac97_try_cold_reset();
pxa2xx_ac97_finish_reset();
}
static int pxa2xx_ac97_read_actrl(struct ac97_controller *adrv, int slot,
unsigned short reg)
{
return pxa2xx_ac97_read(slot, reg);
}
static int pxa2xx_ac97_write_actrl(struct ac97_controller *adrv, int slot,
unsigned short reg, unsigned short val)
{
return pxa2xx_ac97_write(slot, reg, val);
}
static struct ac97_controller_ops pxa2xx_ac97_ops = {
.read = pxa2xx_ac97_read_actrl,
.write = pxa2xx_ac97_write_actrl,
.warm_reset = pxa2xx_ac97_warm_reset,
.reset = pxa2xx_ac97_cold_reset,
};
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
.chan_name = "pcm_pcm_stereo_in",
.maxburst = 32,
};
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = {
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
.chan_name = "pcm_pcm_stereo_out",
.maxburst = 32,
};
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_out = {
.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
.chan_name = "pcm_aux_mono_out",
.maxburst = 16,
};
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_aux_mono_in = {
.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
.chan_name = "pcm_aux_mono_in",
.maxburst = 16,
};
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_mic_mono_in = {
.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
.chan_name = "pcm_aux_mic_mono",
Annotation
- Immediate include surface: `linux/init.h`, `linux/io.h`, `linux/module.h`, `linux/platform_device.h`, `linux/dmaengine.h`, `linux/dma/pxa-dma.h`, `sound/ac97/controller.h`, `sound/core.h`.
- Detected declarations: `function pxa2xx_ac97_warm_reset`, `function pxa2xx_ac97_cold_reset`, `function pxa2xx_ac97_read_actrl`, `function pxa2xx_ac97_write_actrl`, `function pxa2xx_ac97_hifi_startup`, `function pxa2xx_ac97_aux_startup`, `function pxa2xx_ac97_mic_startup`, `function pxa2xx_ac97_dev_probe`, `function pxa2xx_ac97_dev_remove`, `function pxa2xx_ac97_dev_suspend`.
- Atlas domain: Driver Families / sound/soc.
- Implementation status: source 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.