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.

Dependency Surface

Detected Declarations

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

Implementation Notes