diff options
author | Takashi Sakamoto <o-takashi@sakamocchi.jp> | 2015-06-14 12:49:30 +0900 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-06-15 13:36:00 +0200 |
commit | 3e254b16b65dbbcc2528781070e1be0f7945f220 (patch) | |
tree | 74d189fcc5b6cdcf8759e7668ed20aa959a81d6a /sound/firewire/bebob/bebob_proc.c | |
parent | ba5177131d8cb4b778a43ce995155928be851117 (diff) |
ALSA: bebob: use normalized representation for the type of clock source
This commit changes function prototype and its processing. As a result,
function caller can execute additional processing according to detected
clock source.
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/firewire/bebob/bebob_proc.c')
-rw-r--r-- | sound/firewire/bebob/bebob_proc.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/sound/firewire/bebob/bebob_proc.c b/sound/firewire/bebob/bebob_proc.c index 335da64506e0..301cc6a93945 100644 --- a/sound/firewire/bebob/bebob_proc.c +++ b/sound/firewire/bebob/bebob_proc.c @@ -132,25 +132,27 @@ static void proc_read_clock(struct snd_info_entry *entry, struct snd_info_buffer *buffer) { + static const char *const clk_labels[] = { + "Internal", + "External", + "SYT-Match", + }; struct snd_bebob *bebob = entry->private_data; struct snd_bebob_rate_spec *rate_spec = bebob->spec->rate; struct snd_bebob_clock_spec *clk_spec = bebob->spec->clock; - unsigned int rate, id; - bool internal; + enum snd_bebob_clock_type src; + unsigned int rate; if (rate_spec->get(bebob, &rate) >= 0) snd_iprintf(buffer, "Sampling rate: %d\n", rate); - if (clk_spec) { - if (clk_spec->get(bebob, &id) >= 0) + if (snd_bebob_stream_get_clock_src(bebob, &src) >= 0) { + if (clk_spec) snd_iprintf(buffer, "Clock Source: %s\n", - clk_spec->labels[id]); - } else { - if (snd_bebob_stream_check_internal_clock(bebob, - &internal) >= 0) + clk_labels[src]); + else snd_iprintf(buffer, "Clock Source: %s (MSU-dest: %d)\n", - (internal) ? "Internal" : "External", - bebob->sync_input_plug); + clk_labels[src], bebob->sync_input_plug); } } |