sound/pci/lola/lola_proc.c
Source file repositories/reference/linux-study-clean/sound/pci/lola/lola_proc.c
File Facts
- System
- Linux kernel
- Corpus path
sound/pci/lola/lola_proc.c- Extension
.c- Size
- 6383 bytes
- Lines
- 204
- 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
linux/kernel.hlinux/init.hlinux/io.hsound/core.hsound/info.hsound/pcm.hlola.h
Detected Declarations
function Copyrightfunction print_pin_widgetfunction print_clock_widgetfunction print_mixer_widgetfunction lola_proc_codec_readfunction lola_proc_codec_rw_writefunction lola_proc_codec_rw_readfunction lola_proc_regs_readfunction lola_proc_debug_new
Annotated Snippet
if (type == LOLA_CLOCK_TYPE_INTERNAL) {
name = "Internal";
freq = lola_sample_rate_convert(freq);
} else if (type == LOLA_CLOCK_TYPE_VIDEO) {
name = "Video";
freq = lola_sample_rate_convert(freq);
} else {
name = "Other";
}
snd_iprintf(buffer, " Clock %d: Type %d:%s, freq=%d\n",
i + j, type, name, freq);
}
}
}
static void print_mixer_widget(struct snd_info_buffer *buffer,
struct lola *chip, int nid)
{
unsigned int val;
lola_read_param(chip, nid, LOLA_PAR_AUDIO_WIDGET_CAP, &val);
snd_iprintf(buffer, "Node 0x%02x [Mixer] wcaps 0x%x\n", nid, val);
}
static void lola_proc_codec_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct lola *chip = entry->private_data;
unsigned int val;
int i, nid;
lola_read_param(chip, 0, LOLA_PAR_VENDOR_ID, &val);
snd_iprintf(buffer, "Vendor: 0x%08x\n", val);
lola_read_param(chip, 1, LOLA_PAR_FUNCTION_TYPE, &val);
snd_iprintf(buffer, "Function Type: %d\n", val);
lola_read_param(chip, 1, LOLA_PAR_SPECIFIC_CAPS, &val);
snd_iprintf(buffer, "Specific-Caps: 0x%08x\n", val);
snd_iprintf(buffer, " Pins-In %d, Pins-Out %d\n",
chip->pin[CAPT].num_pins, chip->pin[PLAY].num_pins);
nid = 2;
for (i = 0; i < chip->pcm[CAPT].num_streams; i++, nid++)
print_audio_widget(buffer, chip, nid, "[Audio-In]");
for (i = 0; i < chip->pcm[PLAY].num_streams; i++, nid++)
print_audio_widget(buffer, chip, nid, "[Audio-Out]");
for (i = 0; i < chip->pin[CAPT].num_pins; i++, nid++)
print_pin_widget(buffer, chip, nid, LOLA_PAR_AMP_IN_CAP,
"[Pin-In]");
for (i = 0; i < chip->pin[PLAY].num_pins; i++, nid++)
print_pin_widget(buffer, chip, nid, LOLA_PAR_AMP_OUT_CAP,
"[Pin-Out]");
if (LOLA_AFG_CLOCK_WIDGET_PRESENT(chip->lola_caps)) {
print_clock_widget(buffer, chip, nid);
nid++;
}
if (LOLA_AFG_MIXER_WIDGET_PRESENT(chip->lola_caps)) {
print_mixer_widget(buffer, chip, nid);
nid++;
}
}
/* direct codec access for debugging */
static void lola_proc_codec_rw_write(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct lola *chip = entry->private_data;
char line[64];
unsigned int id, verb, data, extdata;
while (!snd_info_get_line(buffer, line, sizeof(line))) {
if (sscanf(line, "%u %u %u %u", &id, &verb, &data, &extdata) != 4)
continue;
lola_codec_read(chip, id, verb, data, extdata,
&chip->debug_res,
&chip->debug_res_ex);
}
}
static void lola_proc_codec_rw_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct lola *chip = entry->private_data;
snd_iprintf(buffer, "0x%x 0x%x\n", chip->debug_res, chip->debug_res_ex);
}
/*
* dump some registers
*/
static void lola_proc_regs_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct lola *chip = entry->private_data;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/init.h`, `linux/io.h`, `sound/core.h`, `sound/info.h`, `sound/pcm.h`, `lola.h`.
- Detected declarations: `function Copyright`, `function print_pin_widget`, `function print_clock_widget`, `function print_mixer_widget`, `function lola_proc_codec_read`, `function lola_proc_codec_rw_write`, `function lola_proc_codec_rw_read`, `function lola_proc_regs_read`, `function lola_proc_debug_new`.
- 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.