sound/aoa/aoa.h
Source file repositories/reference/linux-study-clean/sound/aoa/aoa.h
File Facts
- System
- Linux kernel
- Corpus path
sound/aoa/aoa.h- Extension
.h- Size
- 3812 bytes
- Lines
- 128
- Domain
- Driver Families
- Bucket
- sound/aoa
- 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/module.hsound/core.hsound/asound.hsound/control.haoa-gpio.hsoundbus/soundbus.h
Detected Declarations
struct aoa_codecstruct aoa_fabricstruct aoa_card
Annotated Snippet
struct aoa_codec {
char name[MAX_CODEC_NAME_LEN];
struct module *owner;
/* called when the fabric wants to init this codec.
* Do alsa card manipulations from here. */
int (*init)(struct aoa_codec *codec);
/* called when the fabric is done with the codec.
* The alsa card will be cleaned up so don't bother. */
void (*exit)(struct aoa_codec *codec);
/* May be NULL, but can be used by the fabric.
* Refcounting is the codec driver's responsibility */
struct device_node *node;
/* assigned by fabric before init() is called, points
* to the soundbus device. Cannot be NULL. */
struct soundbus_dev *soundbus_dev;
/* assigned by the fabric before init() is called, points
* to the fabric's gpio runtime record for the relevant
* device. */
struct gpio_runtime *gpio;
/* assigned by the fabric before init() is called, contains
* a codec specific bitmask of what outputs and inputs are
* actually connected */
u32 connected;
/* data the fabric can associate with this structure */
const void *fabric_data;
/* private! */
struct list_head list;
struct aoa_fabric *fabric;
};
/* return 0 on success */
extern int
aoa_codec_register(struct aoa_codec *codec);
extern void
aoa_codec_unregister(struct aoa_codec *codec);
#define MAX_LAYOUT_NAME_LEN 32
struct aoa_fabric {
char name[MAX_LAYOUT_NAME_LEN];
struct module *owner;
/* once codecs register, they are passed here after.
* They are of course not initialised, since the
* fabric is responsible for initialising some fields
* in the codec structure! */
int (*found_codec)(struct aoa_codec *codec);
/* called for each codec when it is removed,
* also in the case that aoa_fabric_unregister
* is called and all codecs are removed
* from this fabric.
* Also called if found_codec returned 0 but
* the codec couldn't initialise. */
void (*remove_codec)(struct aoa_codec *codec);
/* If found_codec returned 0, and the codec
* could be initialised, this is called. */
void (*attached_codec)(struct aoa_codec *codec);
};
/* return 0 on success, -EEXIST if another fabric is
* registered, -EALREADY if the same fabric is registered.
* Passing NULL can be used to test for the presence
* of another fabric, if -EALREADY is returned there is
* no other fabric present.
* In the case that the function returns -EALREADY
* and the fabric passed is not NULL, all codecs
* that are not assigned yet are passed to the fabric
* again for reconsideration. */
extern int
aoa_fabric_register(struct aoa_fabric *fabric, struct device *dev);
/* it is vital to call this when the fabric exits!
* When calling, the remove_codec will be called
* for all codecs, unless it is NULL. */
extern void
aoa_fabric_unregister(struct aoa_fabric *fabric);
/* if for some reason you want to get rid of a codec
* before the fabric is removed, use this.
* Note that remove_codec is called for it! */
Annotation
- Immediate include surface: `linux/module.h`, `sound/core.h`, `sound/asound.h`, `sound/control.h`, `aoa-gpio.h`, `soundbus/soundbus.h`.
- Detected declarations: `struct aoa_codec`, `struct aoa_fabric`, `struct aoa_card`.
- Atlas domain: Driver Families / sound/aoa.
- 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.