2 * Information interface for ALSA driver
3 * Copyright (c) by Jaroslav Kysela <perex@suse.cz>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #include <sound/driver.h>
23 #include <linux/init.h>
24 #include <linux/time.h>
25 #include <linux/smp_lock.h>
26 #include <linux/string.h>
27 #include <sound/core.h>
28 #include <sound/minors.h>
29 #include <sound/info.h>
30 #include <sound/version.h>
31 #include <linux/proc_fs.h>
32 #include <linux/devfs_fs_kernel.h>
33 #include <linux/mutex.h>
42 int snd_info_check_reserved_words(const char *str
)
44 static char *reserved
[] =
59 char **xstr
= reserved
;
62 if (!strcmp(*xstr
, str
))
66 if (!strncmp(str
, "card", 4))
71 static DEFINE_MUTEX(info_mutex
);
73 struct snd_info_private_data
{
74 struct snd_info_buffer
*rbuffer
;
75 struct snd_info_buffer
*wbuffer
;
76 struct snd_info_entry
*entry
;
77 void *file_private_data
;
80 static int snd_info_version_init(void);
81 static int snd_info_version_done(void);
84 /* resize the proc r/w buffer */
85 static int resize_info_buffer(struct snd_info_buffer
*buffer
,
90 nsize
= PAGE_ALIGN(nsize
);
91 nbuf
= kmalloc(nsize
, GFP_KERNEL
);
95 memcpy(nbuf
, buffer
->buffer
, buffer
->len
);
96 kfree(buffer
->buffer
);
97 buffer
->buffer
= nbuf
;
103 * snd_iprintf - printf on the procfs buffer
104 * @buffer: the procfs buffer
105 * @fmt: the printf format
107 * Outputs the string on the procfs buffer just like printf().
109 * Returns the size of output string.
111 int snd_iprintf(struct snd_info_buffer
*buffer
, char *fmt
,...)
118 if (buffer
->stop
|| buffer
->error
)
120 len
= buffer
->len
- buffer
->size
;
123 res
= vsnprintf(buffer
->buffer
+ buffer
->curr
, len
, fmt
, args
);
126 err
= resize_info_buffer(buffer
, buffer
->len
+ PAGE_SIZE
);
129 len
= buffer
->len
- buffer
->size
;
140 EXPORT_SYMBOL(snd_iprintf
);
146 static struct proc_dir_entry
*snd_proc_root
;
147 struct snd_info_entry
*snd_seq_root
;
148 EXPORT_SYMBOL(snd_seq_root
);
150 #ifdef CONFIG_SND_OSSEMUL
151 struct snd_info_entry
*snd_oss_root
;
154 static inline void snd_info_entry_prepare(struct proc_dir_entry
*de
)
156 de
->owner
= THIS_MODULE
;
159 static void snd_remove_proc_entry(struct proc_dir_entry
*parent
,
160 struct proc_dir_entry
*de
)
163 remove_proc_entry(de
->name
, parent
);
166 static loff_t
snd_info_entry_llseek(struct file
*file
, loff_t offset
, int orig
)
168 struct snd_info_private_data
*data
;
169 struct snd_info_entry
*entry
;
172 data
= file
->private_data
;
175 switch (entry
->content
) {
176 case SNDRV_INFO_CONTENT_TEXT
:
178 case 0: /* SEEK_SET */
179 file
->f_pos
= offset
;
182 case 1: /* SEEK_CUR */
183 file
->f_pos
+= offset
;
186 case 2: /* SEEK_END */
192 case SNDRV_INFO_CONTENT_DATA
:
193 if (entry
->c
.ops
->llseek
) {
194 ret
= entry
->c
.ops
->llseek(entry
,
195 data
->file_private_data
,
207 static ssize_t
snd_info_entry_read(struct file
*file
, char __user
*buffer
,
208 size_t count
, loff_t
* offset
)
210 struct snd_info_private_data
*data
;
211 struct snd_info_entry
*entry
;
212 struct snd_info_buffer
*buf
;
216 data
= file
->private_data
;
217 snd_assert(data
!= NULL
, return -ENXIO
);
219 if (pos
< 0 || (long) pos
!= pos
|| (ssize_t
) count
< 0)
221 if ((unsigned long) pos
+ (unsigned long) count
< (unsigned long) pos
)
224 switch (entry
->content
) {
225 case SNDRV_INFO_CONTENT_TEXT
:
229 if (pos
>= buf
->size
)
231 size
= buf
->size
- pos
;
232 size
= min(count
, size
);
233 if (copy_to_user(buffer
, buf
->buffer
+ pos
, size
))
236 case SNDRV_INFO_CONTENT_DATA
:
237 if (entry
->c
.ops
->read
)
238 size
= entry
->c
.ops
->read(entry
,
239 data
->file_private_data
,
240 file
, buffer
, count
, pos
);
243 if ((ssize_t
) size
> 0)
244 *offset
= pos
+ size
;
248 static ssize_t
snd_info_entry_write(struct file
*file
, const char __user
*buffer
,
249 size_t count
, loff_t
* offset
)
251 struct snd_info_private_data
*data
;
252 struct snd_info_entry
*entry
;
253 struct snd_info_buffer
*buf
;
257 data
= file
->private_data
;
258 snd_assert(data
!= NULL
, return -ENXIO
);
261 if (pos
< 0 || (long) pos
!= pos
|| (ssize_t
) count
< 0)
263 if ((unsigned long) pos
+ (unsigned long) count
< (unsigned long) pos
)
265 switch (entry
->content
) {
266 case SNDRV_INFO_CONTENT_TEXT
:
270 mutex_lock(&entry
->access
);
271 if (pos
+ count
>= buf
->len
) {
272 if (resize_info_buffer(buf
, pos
+ count
)) {
273 mutex_unlock(&entry
->access
);
277 if (copy_from_user(buf
->buffer
+ pos
, buffer
, count
)) {
278 mutex_unlock(&entry
->access
);
281 buf
->size
= pos
+ count
;
282 mutex_unlock(&entry
->access
);
285 case SNDRV_INFO_CONTENT_DATA
:
286 if (entry
->c
.ops
->write
)
287 size
= entry
->c
.ops
->write(entry
,
288 data
->file_private_data
,
289 file
, buffer
, count
, pos
);
292 if ((ssize_t
) size
> 0)
293 *offset
= pos
+ size
;
297 static int snd_info_entry_open(struct inode
*inode
, struct file
*file
)
299 struct snd_info_entry
*entry
;
300 struct snd_info_private_data
*data
;
301 struct snd_info_buffer
*buffer
;
302 struct proc_dir_entry
*p
;
305 mutex_lock(&info_mutex
);
307 entry
= p
== NULL
? NULL
: (struct snd_info_entry
*)p
->data
;
308 if (entry
== NULL
|| entry
->disconnected
) {
309 mutex_unlock(&info_mutex
);
312 if (!try_module_get(entry
->module
)) {
316 mode
= file
->f_flags
& O_ACCMODE
;
317 if (mode
== O_RDONLY
|| mode
== O_RDWR
) {
318 if ((entry
->content
== SNDRV_INFO_CONTENT_DATA
&&
319 entry
->c
.ops
->read
== NULL
)) {
324 if (mode
== O_WRONLY
|| mode
== O_RDWR
) {
325 if ((entry
->content
== SNDRV_INFO_CONTENT_DATA
&&
326 entry
->c
.ops
->write
== NULL
)) {
331 data
= kzalloc(sizeof(*data
), GFP_KERNEL
);
337 switch (entry
->content
) {
338 case SNDRV_INFO_CONTENT_TEXT
:
339 if (mode
== O_RDONLY
|| mode
== O_RDWR
) {
340 buffer
= kzalloc(sizeof(*buffer
), GFP_KERNEL
);
343 data
->rbuffer
= buffer
;
344 buffer
->len
= PAGE_SIZE
;
345 buffer
->buffer
= kmalloc(buffer
->len
, GFP_KERNEL
);
346 if (buffer
->buffer
== NULL
)
349 if (mode
== O_WRONLY
|| mode
== O_RDWR
) {
350 buffer
= kzalloc(sizeof(*buffer
), GFP_KERNEL
);
353 data
->wbuffer
= buffer
;
354 buffer
->len
= PAGE_SIZE
;
355 buffer
->buffer
= kmalloc(buffer
->len
, GFP_KERNEL
);
356 if (buffer
->buffer
== NULL
)
360 case SNDRV_INFO_CONTENT_DATA
: /* data */
361 if (entry
->c
.ops
->open
) {
362 if ((err
= entry
->c
.ops
->open(entry
, mode
,
363 &data
->file_private_data
)) < 0) {
370 file
->private_data
= data
;
371 mutex_unlock(&info_mutex
);
372 if (entry
->content
== SNDRV_INFO_CONTENT_TEXT
&&
373 (mode
== O_RDONLY
|| mode
== O_RDWR
)) {
374 if (entry
->c
.text
.read
) {
375 mutex_lock(&entry
->access
);
376 entry
->c
.text
.read(entry
, data
->rbuffer
);
377 mutex_unlock(&entry
->access
);
384 kfree(data
->rbuffer
->buffer
);
385 kfree(data
->rbuffer
);
388 kfree(data
->wbuffer
->buffer
);
389 kfree(data
->wbuffer
);
394 module_put(entry
->module
);
396 mutex_unlock(&info_mutex
);
400 static int snd_info_entry_release(struct inode
*inode
, struct file
*file
)
402 struct snd_info_entry
*entry
;
403 struct snd_info_private_data
*data
;
406 mode
= file
->f_flags
& O_ACCMODE
;
407 data
= file
->private_data
;
409 switch (entry
->content
) {
410 case SNDRV_INFO_CONTENT_TEXT
:
412 kfree(data
->rbuffer
->buffer
);
413 kfree(data
->rbuffer
);
416 if (entry
->c
.text
.write
) {
417 entry
->c
.text
.write(entry
, data
->wbuffer
);
418 if (data
->wbuffer
->error
) {
419 snd_printk(KERN_WARNING
"data write error to %s (%i)\n",
421 data
->wbuffer
->error
);
424 kfree(data
->wbuffer
->buffer
);
425 kfree(data
->wbuffer
);
428 case SNDRV_INFO_CONTENT_DATA
:
429 if (entry
->c
.ops
->release
)
430 entry
->c
.ops
->release(entry
, mode
,
431 data
->file_private_data
);
434 module_put(entry
->module
);
439 static unsigned int snd_info_entry_poll(struct file
*file
, poll_table
* wait
)
441 struct snd_info_private_data
*data
;
442 struct snd_info_entry
*entry
;
445 data
= file
->private_data
;
450 switch (entry
->content
) {
451 case SNDRV_INFO_CONTENT_DATA
:
452 if (entry
->c
.ops
->poll
)
453 return entry
->c
.ops
->poll(entry
,
454 data
->file_private_data
,
456 if (entry
->c
.ops
->read
)
457 mask
|= POLLIN
| POLLRDNORM
;
458 if (entry
->c
.ops
->write
)
459 mask
|= POLLOUT
| POLLWRNORM
;
465 static long snd_info_entry_ioctl(struct file
*file
, unsigned int cmd
,
468 struct snd_info_private_data
*data
;
469 struct snd_info_entry
*entry
;
471 data
= file
->private_data
;
475 switch (entry
->content
) {
476 case SNDRV_INFO_CONTENT_DATA
:
477 if (entry
->c
.ops
->ioctl
)
478 return entry
->c
.ops
->ioctl(entry
,
479 data
->file_private_data
,
486 static int snd_info_entry_mmap(struct file
*file
, struct vm_area_struct
*vma
)
488 struct inode
*inode
= file
->f_dentry
->d_inode
;
489 struct snd_info_private_data
*data
;
490 struct snd_info_entry
*entry
;
492 data
= file
->private_data
;
496 switch (entry
->content
) {
497 case SNDRV_INFO_CONTENT_DATA
:
498 if (entry
->c
.ops
->mmap
)
499 return entry
->c
.ops
->mmap(entry
,
500 data
->file_private_data
,
507 static struct file_operations snd_info_entry_operations
=
509 .owner
= THIS_MODULE
,
510 .llseek
= snd_info_entry_llseek
,
511 .read
= snd_info_entry_read
,
512 .write
= snd_info_entry_write
,
513 .poll
= snd_info_entry_poll
,
514 .unlocked_ioctl
= snd_info_entry_ioctl
,
515 .mmap
= snd_info_entry_mmap
,
516 .open
= snd_info_entry_open
,
517 .release
= snd_info_entry_release
,
521 * snd_create_proc_entry - create a procfs entry
522 * @name: the name of the proc file
523 * @mode: the file permission bits, S_Ixxx
524 * @parent: the parent proc-directory entry
526 * Creates a new proc file entry with the given name and permission
527 * on the given directory.
529 * Returns the pointer of new instance or NULL on failure.
531 static struct proc_dir_entry
*snd_create_proc_entry(const char *name
, mode_t mode
,
532 struct proc_dir_entry
*parent
)
534 struct proc_dir_entry
*p
;
535 p
= create_proc_entry(name
, mode
, parent
);
537 snd_info_entry_prepare(p
);
541 int __init
snd_info_init(void)
543 struct proc_dir_entry
*p
;
545 p
= snd_create_proc_entry("asound", S_IFDIR
| S_IRUGO
| S_IXUGO
, &proc_root
);
549 #ifdef CONFIG_SND_OSSEMUL
551 struct snd_info_entry
*entry
;
552 if ((entry
= snd_info_create_module_entry(THIS_MODULE
, "oss", NULL
)) == NULL
)
554 entry
->mode
= S_IFDIR
| S_IRUGO
| S_IXUGO
;
555 if (snd_info_register(entry
) < 0) {
556 snd_info_free_entry(entry
);
559 snd_oss_root
= entry
;
562 #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
564 struct snd_info_entry
*entry
;
565 if ((entry
= snd_info_create_module_entry(THIS_MODULE
, "seq", NULL
)) == NULL
)
567 entry
->mode
= S_IFDIR
| S_IRUGO
| S_IXUGO
;
568 if (snd_info_register(entry
) < 0) {
569 snd_info_free_entry(entry
);
572 snd_seq_root
= entry
;
575 snd_info_version_init();
576 snd_minor_info_init();
577 snd_minor_info_oss_init();
578 snd_card_info_init();
582 int __exit
snd_info_done(void)
584 snd_card_info_done();
585 snd_minor_info_oss_done();
586 snd_minor_info_done();
587 snd_info_version_done();
589 #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
590 snd_info_unregister(snd_seq_root
);
592 #ifdef CONFIG_SND_OSSEMUL
593 snd_info_unregister(snd_oss_root
);
595 snd_remove_proc_entry(&proc_root
, snd_proc_root
);
606 * create a card proc file
609 int snd_info_card_create(struct snd_card
*card
)
612 struct snd_info_entry
*entry
;
614 snd_assert(card
!= NULL
, return -ENXIO
);
616 sprintf(str
, "card%i", card
->number
);
617 if ((entry
= snd_info_create_module_entry(card
->module
, str
, NULL
)) == NULL
)
619 entry
->mode
= S_IFDIR
| S_IRUGO
| S_IXUGO
;
620 if (snd_info_register(entry
) < 0) {
621 snd_info_free_entry(entry
);
624 card
->proc_root
= entry
;
629 * register the card proc file
632 int snd_info_card_register(struct snd_card
*card
)
634 struct proc_dir_entry
*p
;
636 snd_assert(card
!= NULL
, return -ENXIO
);
638 if (!strcmp(card
->id
, card
->proc_root
->name
))
641 p
= proc_symlink(card
->id
, snd_proc_root
, card
->proc_root
->name
);
644 card
->proc_root_link
= p
;
649 * de-register the card proc file
652 int snd_info_card_free(struct snd_card
*card
)
654 snd_assert(card
!= NULL
, return -ENXIO
);
655 if (card
->proc_root_link
) {
656 snd_remove_proc_entry(snd_proc_root
, card
->proc_root_link
);
657 card
->proc_root_link
= NULL
;
659 if (card
->proc_root
) {
660 snd_info_unregister(card
->proc_root
);
661 card
->proc_root
= NULL
;
668 * snd_info_get_line - read one line from the procfs buffer
669 * @buffer: the procfs buffer
670 * @line: the buffer to store
671 * @len: the max. buffer size - 1
673 * Reads one line from the buffer and stores the string.
675 * Returns zero if successful, or 1 if error or EOF.
677 int snd_info_get_line(struct snd_info_buffer
*buffer
, char *line
, int len
)
681 if (len
<= 0 || buffer
->stop
|| buffer
->error
)
684 c
= buffer
->buffer
[buffer
->curr
++];
686 if (buffer
->curr
>= buffer
->size
)
691 if (buffer
->curr
>= buffer
->size
) {
696 while (c
!= '\n' && !buffer
->stop
) {
697 c
= buffer
->buffer
[buffer
->curr
++];
698 if (buffer
->curr
>= buffer
->size
)
705 EXPORT_SYMBOL(snd_info_get_line
);
708 * snd_info_get_str - parse a string token
709 * @dest: the buffer to store the string token
710 * @src: the original string
711 * @len: the max. length of token - 1
713 * Parses the original string and copy a token to the given
716 * Returns the updated pointer of the original string so that
717 * it can be used for the next call.
719 char *snd_info_get_str(char *dest
, char *src
, int len
)
723 while (*src
== ' ' || *src
== '\t')
725 if (*src
== '"' || *src
== '\'') {
727 while (--len
> 0 && *src
&& *src
!= c
) {
733 while (--len
> 0 && *src
&& *src
!= ' ' && *src
!= '\t') {
738 while (*src
== ' ' || *src
== '\t')
743 EXPORT_SYMBOL(snd_info_get_str
);
746 * snd_info_create_entry - create an info entry
747 * @name: the proc file name
749 * Creates an info entry with the given file name and initializes as
752 * Usually called from other functions such as
753 * snd_info_create_card_entry().
755 * Returns the pointer of the new instance, or NULL on failure.
757 static struct snd_info_entry
*snd_info_create_entry(const char *name
)
759 struct snd_info_entry
*entry
;
760 entry
= kzalloc(sizeof(*entry
), GFP_KERNEL
);
763 entry
->name
= kstrdup(name
, GFP_KERNEL
);
764 if (entry
->name
== NULL
) {
768 entry
->mode
= S_IFREG
| S_IRUGO
;
769 entry
->content
= SNDRV_INFO_CONTENT_TEXT
;
770 mutex_init(&entry
->access
);
775 * snd_info_create_module_entry - create an info entry for the given module
776 * @module: the module pointer
777 * @name: the file name
778 * @parent: the parent directory
780 * Creates a new info entry and assigns it to the given module.
782 * Returns the pointer of the new instance, or NULL on failure.
784 struct snd_info_entry
*snd_info_create_module_entry(struct module
* module
,
786 struct snd_info_entry
*parent
)
788 struct snd_info_entry
*entry
= snd_info_create_entry(name
);
790 entry
->module
= module
;
791 entry
->parent
= parent
;
796 EXPORT_SYMBOL(snd_info_create_module_entry
);
799 * snd_info_create_card_entry - create an info entry for the given card
800 * @card: the card instance
801 * @name: the file name
802 * @parent: the parent directory
804 * Creates a new info entry and assigns it to the given card.
806 * Returns the pointer of the new instance, or NULL on failure.
808 struct snd_info_entry
*snd_info_create_card_entry(struct snd_card
*card
,
810 struct snd_info_entry
* parent
)
812 struct snd_info_entry
*entry
= snd_info_create_entry(name
);
814 entry
->module
= card
->module
;
816 entry
->parent
= parent
;
821 EXPORT_SYMBOL(snd_info_create_card_entry
);
823 static int snd_info_dev_free_entry(struct snd_device
*device
)
825 struct snd_info_entry
*entry
= device
->device_data
;
826 snd_info_free_entry(entry
);
830 static int snd_info_dev_register_entry(struct snd_device
*device
)
832 struct snd_info_entry
*entry
= device
->device_data
;
833 return snd_info_register(entry
);
836 static int snd_info_dev_disconnect_entry(struct snd_device
*device
)
838 struct snd_info_entry
*entry
= device
->device_data
;
839 entry
->disconnected
= 1;
843 static int snd_info_dev_unregister_entry(struct snd_device
*device
)
845 struct snd_info_entry
*entry
= device
->device_data
;
846 return snd_info_unregister(entry
);
850 * snd_card_proc_new - create an info entry for the given card
851 * @card: the card instance
852 * @name: the file name
853 * @entryp: the pointer to store the new info entry
855 * Creates a new info entry and assigns it to the given card.
856 * Unlike snd_info_create_card_entry(), this function registers the
857 * info entry as an ALSA device component, so that it can be
858 * unregistered/released without explicit call.
859 * Also, you don't have to register this entry via snd_info_register(),
860 * since this will be registered by snd_card_register() automatically.
862 * The parent is assumed as card->proc_root.
864 * For releasing this entry, use snd_device_free() instead of
865 * snd_info_free_entry().
867 * Returns zero if successful, or a negative error code on failure.
869 int snd_card_proc_new(struct snd_card
*card
, const char *name
,
870 struct snd_info_entry
**entryp
)
872 static struct snd_device_ops ops
= {
873 .dev_free
= snd_info_dev_free_entry
,
874 .dev_register
= snd_info_dev_register_entry
,
875 .dev_disconnect
= snd_info_dev_disconnect_entry
,
876 .dev_unregister
= snd_info_dev_unregister_entry
878 struct snd_info_entry
*entry
;
881 entry
= snd_info_create_card_entry(card
, name
, card
->proc_root
);
884 if ((err
= snd_device_new(card
, SNDRV_DEV_INFO
, entry
, &ops
)) < 0) {
885 snd_info_free_entry(entry
);
893 EXPORT_SYMBOL(snd_card_proc_new
);
896 * snd_info_free_entry - release the info entry
897 * @entry: the info entry
899 * Releases the info entry. Don't call this after registered.
901 void snd_info_free_entry(struct snd_info_entry
* entry
)
906 if (entry
->private_free
)
907 entry
->private_free(entry
);
911 EXPORT_SYMBOL(snd_info_free_entry
);
914 * snd_info_register - register the info entry
915 * @entry: the info entry
917 * Registers the proc info entry.
919 * Returns zero if successful, or a negative error code on failure.
921 int snd_info_register(struct snd_info_entry
* entry
)
923 struct proc_dir_entry
*root
, *p
= NULL
;
925 snd_assert(entry
!= NULL
, return -ENXIO
);
926 root
= entry
->parent
== NULL
? snd_proc_root
: entry
->parent
->p
;
927 mutex_lock(&info_mutex
);
928 p
= snd_create_proc_entry(entry
->name
, entry
->mode
, root
);
930 mutex_unlock(&info_mutex
);
933 p
->owner
= entry
->module
;
934 if (!S_ISDIR(entry
->mode
))
935 p
->proc_fops
= &snd_info_entry_operations
;
936 p
->size
= entry
->size
;
939 mutex_unlock(&info_mutex
);
943 EXPORT_SYMBOL(snd_info_register
);
946 * snd_info_unregister - de-register the info entry
947 * @entry: the info entry
949 * De-registers the info entry and releases the instance.
951 * Returns zero if successful, or a negative error code on failure.
953 int snd_info_unregister(struct snd_info_entry
* entry
)
955 struct proc_dir_entry
*root
;
959 snd_assert(entry
->p
!= NULL
, return -ENXIO
);
960 root
= entry
->parent
== NULL
? snd_proc_root
: entry
->parent
->p
;
961 snd_assert(root
, return -ENXIO
);
962 mutex_lock(&info_mutex
);
963 snd_remove_proc_entry(root
, entry
->p
);
964 mutex_unlock(&info_mutex
);
965 snd_info_free_entry(entry
);
969 EXPORT_SYMBOL(snd_info_unregister
);
975 static struct snd_info_entry
*snd_info_version_entry
;
977 static void snd_info_version_read(struct snd_info_entry
*entry
, struct snd_info_buffer
*buffer
)
980 "Advanced Linux Sound Architecture Driver Version "
981 CONFIG_SND_VERSION CONFIG_SND_DATE
".\n"
985 static int __init
snd_info_version_init(void)
987 struct snd_info_entry
*entry
;
989 entry
= snd_info_create_module_entry(THIS_MODULE
, "version", NULL
);
992 entry
->c
.text
.read
= snd_info_version_read
;
993 if (snd_info_register(entry
) < 0) {
994 snd_info_free_entry(entry
);
997 snd_info_version_entry
= entry
;
1001 static int __exit
snd_info_version_done(void)
1003 if (snd_info_version_entry
)
1004 snd_info_unregister(snd_info_version_entry
);
1008 #endif /* CONFIG_PROC_FS */