sound/pci/echoaudio/echoaudio_3g.c
Source file repositories/reference/linux-study-clean/sound/pci/echoaudio/echoaudio_3g.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/echoaudio/echoaudio_3g.c- Extension
.c- Size
- 10542 bytes
- Lines
- 416
- 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 Corporationfunction get_frq_regfunction write_control_regfunction set_digital_modefunction set_spdif_bitsfunction set_professional_spdiffunction detect_input_clocksfunction load_asicfunction set_sample_ratefunction set_input_clockfunction dsp_set_digital_mode
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/****************************************************************************
Copyright Echo Digital Audio Corporation (c) 1998 - 2004
All rights reserved
www.echoaudio.com
This file is part of Echo Digital Audio's generic driver library.
*************************************************************************
Translation from C++ and adaptation for use in ALSA-Driver
were made by Giuliano Pochini <pochini@shiny.it>
****************************************************************************/
/* These functions are common for all "3G" cards */
static int check_asic_status(struct echoaudio *chip)
{
u32 box_status;
if (wait_handshake(chip))
return -EIO;
chip->comm_page->ext_box_status = cpu_to_le32(E3G_ASIC_NOT_LOADED);
chip->asic_loaded = false;
clear_handshake(chip);
send_vector(chip, DSP_VC_TEST_ASIC);
if (wait_handshake(chip)) {
chip->dsp_code = NULL;
return -EIO;
}
box_status = le32_to_cpu(chip->comm_page->ext_box_status);
dev_dbg(chip->card->dev, "box_status=%x\n", box_status);
if (box_status == E3G_ASIC_NOT_LOADED)
return -ENODEV;
chip->asic_loaded = true;
return box_status & E3G_BOX_TYPE_MASK;
}
static inline u32 get_frq_reg(struct echoaudio *chip)
{
return le32_to_cpu(chip->comm_page->e3g_frq_register);
}
/* Most configuration of 3G cards is accomplished by writing the control
register. write_control_reg sends the new control register value to the DSP. */
static int write_control_reg(struct echoaudio *chip, u32 ctl, u32 frq,
char force)
{
__le32 ctl_reg, frq_reg;
if (wait_handshake(chip))
return -EIO;
dev_dbg(chip->card->dev,
"WriteControlReg: Setting 0x%x, 0x%x\n", ctl, frq);
ctl_reg = cpu_to_le32(ctl);
frq_reg = cpu_to_le32(frq);
if (ctl_reg != chip->comm_page->control_register ||
frq_reg != chip->comm_page->e3g_frq_register || force) {
chip->comm_page->e3g_frq_register = frq_reg;
chip->comm_page->control_register = ctl_reg;
clear_handshake(chip);
return send_vector(chip, DSP_VC_WRITE_CONTROL_REG);
}
dev_dbg(chip->card->dev, "WriteControlReg: not written, no change\n");
return 0;
}
/* Set the digital mode - currently for Gina24, Layla24, Mona, 3G */
static int set_digital_mode(struct echoaudio *chip, u8 mode)
{
u8 previous_mode;
int err, i, o;
Annotation
- Detected declarations: `function Corporation`, `function get_frq_reg`, `function write_control_reg`, `function set_digital_mode`, `function set_spdif_bits`, `function set_professional_spdif`, `function detect_input_clocks`, `function load_asic`, `function set_sample_rate`, `function set_input_clock`.
- 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.