diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-05-02 08:24:42 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-05-02 08:24:42 +0200 |
commit | d7dc450d5a7162de96edbed6b1792240c2f3a55f (patch) | |
tree | d6dc2d26b393dd69881cd4b9498718f65b35abeb /sound/firewire/fireface/ff-proc.c | |
parent | d4a2fbcee0c8449ce24d6de168f3d90c5e6d7596 (diff) | |
parent | 0997e378be1d888a5d093eeee55f842cdfe55ebe (diff) |
Merge branch 'for-next' into for-linus
For 4.12 merge.
Diffstat (limited to 'sound/firewire/fireface/ff-proc.c')
-rw-r--r-- | sound/firewire/fireface/ff-proc.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/sound/firewire/fireface/ff-proc.c b/sound/firewire/fireface/ff-proc.c new file mode 100644 index 000000000000..69441d121f71 --- /dev/null +++ b/sound/firewire/fireface/ff-proc.c @@ -0,0 +1,63 @@ +/* + * ff-proc.c - a part of driver for RME Fireface series + * + * Copyright (c) 2015-2017 Takashi Sakamoto + * + * Licensed under the terms of the GNU General Public License, version 2. + */ + +#include "./ff.h" + +static void proc_dump_clock_config(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) +{ + struct snd_ff *ff = entry->private_data; + + ff->spec->protocol->dump_clock_config(ff, buffer); +} + +static void proc_dump_sync_status(struct snd_info_entry *entry, + struct snd_info_buffer *buffer) +{ + struct snd_ff *ff = entry->private_data; + + ff->spec->protocol->dump_sync_status(ff, buffer); +} + +static void add_node(struct snd_ff *ff, struct snd_info_entry *root, + const char *name, + void (*op)(struct snd_info_entry *e, + struct snd_info_buffer *b)) +{ + struct snd_info_entry *entry; + + entry = snd_info_create_card_entry(ff->card, name, root); + if (entry == NULL) + return; + + snd_info_set_text_ops(entry, ff, op); + if (snd_info_register(entry) < 0) + snd_info_free_entry(entry); +} + +void snd_ff_proc_init(struct snd_ff *ff) +{ + struct snd_info_entry *root; + + /* + * All nodes are automatically removed at snd_card_disconnect(), + * by following to link list. + */ + root = snd_info_create_card_entry(ff->card, "firewire", + ff->card->proc_root); + if (root == NULL) + return; + root->mode = S_IFDIR | S_IRUGO | S_IXUGO; + if (snd_info_register(root) < 0) { + snd_info_free_entry(root); + return; + } + + add_node(ff, root, "clock-config", proc_dump_clock_config); + add_node(ff, root, "sync-status", proc_dump_sync_status); +} |