From 6a22683e89e2c851f754ebbec0f2a53f2967bc07 Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Fri, 25 Apr 2014 22:45:08 +0900 Subject: ALSA: fireworks: Add proc interface for debugging purpose This commit adds proc interface to output infomation for debugging. - firmware information - sampling rate and clock source - physical metering (linear value) Signed-off-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- sound/firewire/fireworks/fireworks.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'sound/firewire/fireworks/fireworks.c') diff --git a/sound/firewire/fireworks/fireworks.c b/sound/firewire/fireworks/fireworks.c index 25997f1ee300..311e4a6ef0a6 100644 --- a/sound/firewire/fireworks/fireworks.c +++ b/sound/firewire/fireworks/fireworks.c @@ -150,6 +150,21 @@ get_hardware_info(struct snd_efw *efw) efw->pcm_playback_channels[0] = hwinfo->amdtp_rx_pcm_channels; efw->pcm_playback_channels[1] = hwinfo->amdtp_rx_pcm_channels_2x; efw->pcm_playback_channels[2] = hwinfo->amdtp_rx_pcm_channels_4x; + + /* Hardware metering. */ + if (hwinfo->phys_in_grp_count > HWINFO_MAX_CAPS_GROUPS || + hwinfo->phys_out_grp_count > HWINFO_MAX_CAPS_GROUPS) { + return -EIO; + goto end; + } + efw->phys_in = hwinfo->phys_in; + efw->phys_out = hwinfo->phys_out; + efw->phys_in_grp_count = hwinfo->phys_in_grp_count; + efw->phys_out_grp_count = hwinfo->phys_out_grp_count; + memcpy(&efw->phys_in_grps, hwinfo->phys_in_grps, + sizeof(struct snd_efw_phys_grp) * hwinfo->phys_in_grp_count); + memcpy(&efw->phys_out_grps, hwinfo->phys_out_grps, + sizeof(struct snd_efw_phys_grp) * hwinfo->phys_out_grp_count); end: kfree(hwinfo); return err; @@ -209,6 +224,8 @@ efw_probe(struct fw_unit *unit, if (entry->model_id == MODEL_ECHO_AUDIOFIRE_9) efw->is_af9 = true; + snd_efw_proc_init(efw); + err = snd_efw_stream_init_duplex(efw); if (err < 0) goto error; -- cgit v1.2.3