sound/pci/ctxfi/ctdaio.c
Source file repositories/reference/linux-study-clean/sound/pci/ctxfi/ctdaio.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/ctxfi/ctdaio.c- Extension
.c- Size
- 16660 bytes
- Lines
- 744
- Domain
- Driver Families
- Bucket
- sound/pci
- 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.
- 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
ctdaio.hcthardware.hctimap.hlinux/slab.hlinux/kernel.h
Detected Declarations
struct daio_usagestruct daio_rsc_idxfunction daio_masterfunction daio_indexfunction daio_out_next_conjfunction daio_in_next_conj_20k1function daio_in_next_conj_20k2function daio_device_indexfunction dao_spdif_get_sposfunction dao_spdif_set_sposfunction dao_commit_writefunction dao_set_left_inputfunction dao_set_right_inputfunction dao_clear_inputfunction dao_clear_left_inputfunction dao_clear_right_inputfunction dai_set_srt_srclfunction dai_set_srt_srcrfunction dai_set_srt_msrfunction dai_set_enb_srcfunction dai_set_enb_srtfunction dai_commit_writefunction daio_rsc_initfunction daio_rsc_uninitfunction dao_rsc_initfunction dao_rsc_uninitfunction dao_rsc_reinitfunction dai_rsc_initfunction dai_rsc_uninitfunction daio_mgr_get_rscfunction daio_mgr_put_rscfunction get_daio_rscfunction put_daio_rscfunction scoped_guardfunction daio_mgr_enb_daiofunction daio_mgr_dsb_daiofunction daio_map_opfunction daio_imap_addfunction daio_imap_deletefunction daio_mgr_commit_writefunction daio_mgr_createfunction daio_mgr_destroy
Annotated Snippet
struct daio_usage {
unsigned short data;
};
struct daio_rsc_idx {
unsigned short left;
unsigned short right;
};
static const struct daio_rsc_idx idx_20k1[NUM_DAIOTYP] = {
[LINEO1] = {.left = 0x00, .right = 0x01},
[LINEO2] = {.left = 0x18, .right = 0x19},
[LINEO3] = {.left = 0x08, .right = 0x09},
[LINEO4] = {.left = 0x10, .right = 0x11},
[LINEIM] = {.left = 0x1b5, .right = 0x1bd},
[SPDIFOO] = {.left = 0x20, .right = 0x21},
[SPDIFIO] = {.left = 0x15, .right = 0x1d},
[SPDIFI_BAY] = {.left = 0x95, .right = 0x9d},
};
static const struct daio_rsc_idx idx_20k2[NUM_DAIOTYP] = {
[LINEO1] = {.left = 0x40, .right = 0x41},
[LINEO2] = {.left = 0x60, .right = 0x61},
[LINEO3] = {.left = 0x50, .right = 0x51},
[LINEO4] = {.left = 0x70, .right = 0x71},
[LINEIM] = {.left = 0x45, .right = 0xc5},
[MIC] = {.left = 0x55, .right = 0xd5},
[RCA] = {.left = 0x30, .right = 0x31},
[SPDIFOO] = {.left = 0x00, .right = 0x01},
[SPDIFIO] = {.left = 0x05, .right = 0x85},
};
static void daio_master(struct rsc *rsc)
{
/* Actually, this is not the resource index of DAIO.
* For DAO, it is the input mapper index. And, for DAI,
* it is the output time-slot index. */
rsc->conj = rsc->idx;
}
static int daio_index(const struct rsc *rsc)
{
return rsc->conj;
}
static void daio_out_next_conj(struct rsc *rsc)
{
rsc->conj += 2;
}
static void daio_in_next_conj_20k1(struct rsc *rsc)
{
rsc->conj += 0x200;
}
static void daio_in_next_conj_20k2(struct rsc *rsc)
{
rsc->conj += 0x100;
}
static const struct rsc_ops daio_out_rsc_ops = {
.master = daio_master,
.next_conj = daio_out_next_conj,
.index = daio_index,
.output_slot = NULL,
};
static const struct rsc_ops daio_in_rsc_ops_20k1 = {
.master = daio_master,
.next_conj = daio_in_next_conj_20k1,
.index = NULL,
.output_slot = daio_index,
};
static const struct rsc_ops daio_in_rsc_ops_20k2 = {
.master = daio_master,
.next_conj = daio_in_next_conj_20k2,
.index = NULL,
.output_slot = daio_index,
};
static int daio_device_index(enum DAIOTYP type, struct hw *hw)
{
switch (hw->chip_type) {
case ATC20K1:
switch (type) {
case SPDIFOO: return 0;
case SPDIFIO: return 0;
case SPDIFI_BAY: return 1;
case LINEO1: return 4;
Annotation
- Immediate include surface: `ctdaio.h`, `cthardware.h`, `ctimap.h`, `linux/slab.h`, `linux/kernel.h`.
- Detected declarations: `struct daio_usage`, `struct daio_rsc_idx`, `function daio_master`, `function daio_index`, `function daio_out_next_conj`, `function daio_in_next_conj_20k1`, `function daio_in_next_conj_20k2`, `function daio_device_index`, `function dao_spdif_get_spos`, `function dao_spdif_set_spos`.
- Atlas domain: Driver Families / sound/pci.
- Implementation status: source 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.