sound/pci/echoaudio/echoaudio_dsp.c
Source file repositories/reference/linux-study-clean/sound/pci/echoaudio/echoaudio_dsp.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/echoaudio/echoaudio_dsp.c- Extension
.c- Size
- 30037 bytes
- Lines
- 1142
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function wait_handshakefunction send_vectorfunction write_dspfunction read_dspfunction read_snfunction check_asic_statusfunction load_asic_genericfunction install_resident_loaderfunction load_dspfunction load_firmwarefunction set_nominal_levelfunction set_output_gainfunction set_monitor_gainfunction update_output_line_levelfunction update_input_line_levelfunction set_meters_onfunction pipesfunction restore_dsp_settingsfunction set_audio_formatfunction start_transportfunction pause_transportfunction stop_transportfunction is_pipe_allocatedfunction rest_in_peacefunction init_dsp_comm_pagefunction init_line_levelsfunction service_irqfunction allocate_pipesfunction free_pipesfunction sglist_initfunction sglist_add_mappingfunction sglist_add_irqfunction sglist_wrap
Annotated Snippet
if (chip->comm_page->handshake) {
return 0;
}
udelay(1);
}
dev_err(chip->card->dev, "wait_handshake(): Timeout waiting for DSP\n");
return -EBUSY;
}
/* Much of the interaction between the DSP and the driver is done via vector
commands; send_vector writes a vector command to the DSP. Typically, this
causes the DSP to read or write fields in the comm page.
PCI posting is not required thanks to the handshake logic. */
static int send_vector(struct echoaudio *chip, u32 command)
{
int i;
wmb(); /* Flush all pending writes before sending the command */
/* Wait up to 100ms for the "vector busy" bit to be off */
for (i = 0; i < VECTOR_BUSY_TIMEOUT; i++) {
if (!(get_dsp_register(chip, CHI32_VECTOR_REG) &
CHI32_VECTOR_BUSY)) {
set_dsp_register(chip, CHI32_VECTOR_REG, command);
/*if (i) DE_ACT(("send_vector time: %d\n", i));*/
return 0;
}
udelay(1);
}
dev_err(chip->card->dev, "timeout on send_vector\n");
return -EBUSY;
}
/* write_dsp writes a 32-bit value to the DSP; this is used almost
exclusively for loading the DSP. */
static int write_dsp(struct echoaudio *chip, u32 data)
{
u32 status, i;
for (i = 0; i < 10000000; i++) { /* timeout = 10s */
status = get_dsp_register(chip, CHI32_STATUS_REG);
if ((status & CHI32_STATUS_HOST_WRITE_EMPTY) != 0) {
set_dsp_register(chip, CHI32_DATA_REG, data);
wmb(); /* write it immediately */
return 0;
}
udelay(1);
cond_resched();
}
chip->bad_board = true; /* Set true until DSP re-loaded */
dev_dbg(chip->card->dev, "write_dsp: Set bad_board to true\n");
return -EIO;
}
/* read_dsp reads a 32-bit value from the DSP; this is used almost
exclusively for loading the DSP and checking the status of the ASIC. */
static int read_dsp(struct echoaudio *chip, u32 *data)
{
u32 status, i;
for (i = 0; i < READ_DSP_TIMEOUT; i++) {
status = get_dsp_register(chip, CHI32_STATUS_REG);
if ((status & CHI32_STATUS_HOST_READ_FULL) != 0) {
*data = get_dsp_register(chip, CHI32_DATA_REG);
return 0;
}
udelay(1);
cond_resched();
}
chip->bad_board = true; /* Set true until DSP re-loaded */
dev_err(chip->card->dev, "read_dsp: Set bad_board to true\n");
return -EIO;
}
/****************************************************************************
Firmware loading functions
****************************************************************************/
Annotation
- Detected declarations: `function wait_handshake`, `function send_vector`, `function write_dsp`, `function read_dsp`, `function read_sn`, `function check_asic_status`, `function load_asic_generic`, `function install_resident_loader`, `function load_dsp`, `function load_firmware`.
- Atlas domain: Driver Families / sound/pci.
- 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.