Release 4.7 include/sound/info.h
#ifndef __SOUND_INFO_H
#define __SOUND_INFO_H
/*
* Header file for info interface
* Copyright (c) by Jaroslav Kysela <perex@perex.cz>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <linux/poll.h>
#include <linux/seq_file.h>
#include <sound/core.h>
/* buffer for information */
struct snd_info_buffer {
char *buffer; /* pointer to begin of buffer */
unsigned int curr; /* current position in buffer */
unsigned int size; /* current size */
unsigned int len; /* total length of buffer */
int stop; /* stop flag */
int error; /* error code */
};
#define SNDRV_INFO_CONTENT_TEXT 0
#define SNDRV_INFO_CONTENT_DATA 1
struct snd_info_entry;
struct snd_info_entry_text {
void (*read)(struct snd_info_entry *entry,
struct snd_info_buffer *buffer);
void (*write)(struct snd_info_entry *entry,
struct snd_info_buffer *buffer);
};
struct snd_info_entry_ops {
int (*open)(struct snd_info_entry *entry,
unsigned short mode, void **file_private_data);
int (*release)(struct snd_info_entry *entry,
unsigned short mode, void *file_private_data);
ssize_t (*read)(struct snd_info_entry *entry, void *file_private_data,
struct file *file, char __user *buf,
size_t count, loff_t pos);
ssize_t (*write)(struct snd_info_entry *entry, void *file_private_data,
struct file *file, const char __user *buf,
size_t count, loff_t pos);
loff_t (*llseek)(struct snd_info_entry *entry,
void *file_private_data, struct file *file,
loff_t offset, int orig);
unsigned int (*poll)(struct snd_info_entry *entry,
void *file_private_data, struct file *file,
poll_table *wait);
int (*ioctl)(struct snd_info_entry *entry, void *file_private_data,
struct file *file, unsigned int cmd, unsigned long arg);
int (*mmap)(struct snd_info_entry *entry, void *file_private_data,
struct inode *inode, struct file *file,
struct vm_area_struct *vma);
};
struct snd_info_entry {
const char *name;
umode_t mode;
long size;
unsigned short content;
union {
struct snd_info_entry_text text;
struct snd_info_entry_ops *ops;
}
c;
struct snd_info_entry *parent;
struct snd_card *card;
struct module *module;
void *private_data;
void (*private_free)(struct snd_info_entry *entry);
struct proc_dir_entry *p;
struct mutex access;
struct list_head children;
struct list_head list;
};
#if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_SND_PROC_FS)
int snd_info_minor_register(void);
#else
#define snd_info_minor_register() 0
#endif
#ifdef CONFIG_SND_PROC_FS
extern struct snd_info_entry *snd_seq_root;
#ifdef CONFIG_SND_OSSEMUL
extern struct snd_info_entry *snd_oss_root;
void snd_card_info_read_oss(struct snd_info_buffer *buffer);
#else
#define snd_oss_root NULL
static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
marcin slusarz | marcin slusarz | 11 | 100.00% | 1 | 100.00% |
| Total | 11 | 100.00% | 1 | 100.00% |
#endif
/**
* snd_iprintf - printf on the procfs buffer
* @buf: the procfs buffer
* @fmt: the printf format
*
* Outputs the string on the procfs buffer just like printf().
*
* Return: zero for success, or a negative error code.
*/
#define snd_iprintf(buf, fmt, args...) \
seq_printf((struct seq_file *)(buf)->buffer, fmt, ##args)
int snd_info_init(void);
int snd_info_done(void);
int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len);
const char *snd_info_get_str(char *dest, const char *src, int len);
struct snd_info_entry *snd_info_create_module_entry(struct module *module,
const char *name,
struct snd_info_entry *parent);
struct snd_info_entry *snd_info_create_card_entry(struct snd_card *card,
const char *name,
struct snd_info_entry *parent);
void snd_info_free_entry(struct snd_info_entry *entry);
int snd_info_store_text(struct snd_info_entry *entry);
int snd_info_restore_text(struct snd_info_entry *entry);
int snd_info_card_create(struct snd_card *card);
int snd_info_card_register(struct snd_card *card);
int snd_info_card_free(struct snd_card *card);
void snd_info_card_disconnect(struct snd_card *card);
void snd_info_card_id_change(struct snd_card *card);
int snd_info_register(struct snd_info_entry *entry);
/* for card drivers */
static inline int snd_card_proc_new(struct snd_card *card, const char *name,
struct snd_info_entry **entryp)
{
*entryp = snd_info_create_card_entry(card, name, card->proc_root);
return *entryp ? 0 : -ENOMEM;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
takashi iwai | takashi iwai | 31 | 67.39% | 2 | 66.67% |
jaroslav kysela | jaroslav kysela | 15 | 32.61% | 1 | 33.33% |
| Total | 46 | 100.00% | 3 | 100.00% |
static inline void snd_info_set_text_ops(struct snd_info_entry *entry,
void *private_data,
void (*read)(struct snd_info_entry *, struct snd_info_buffer *))
{
entry->private_data = private_data;
entry->c.text.read = read;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 41 | 87.23% | 2 | 66.67% |
takashi iwai | takashi iwai | 6 | 12.77% | 1 | 33.33% |
| Total | 47 | 100.00% | 3 | 100.00% |
int snd_info_check_reserved_words(const char *str);
#else
#define snd_seq_root NULL
#define snd_oss_root NULL
static inline int snd_iprintf(struct snd_info_buffer *buffer, char *fmt, ...) { return 0; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 19 | 90.48% | 1 | 50.00% |
takashi iwai | takashi iwai | 2 | 9.52% | 1 | 50.00% |
| Total | 21 | 100.00% | 2 | 100.00% |
static inline int snd_info_init(void) { return 0; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 12 | 100.00% | 1 | 100.00% |
| Total | 12 | 100.00% | 1 | 100.00% |
static inline int snd_info_done(void) { return 0; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 12 | 100.00% | 1 | 100.00% |
| Total | 12 | 100.00% | 1 | 100.00% |
static inline int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len) { return 0; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 20 | 90.91% | 1 | 50.00% |
takashi iwai | takashi iwai | 2 | 9.09% | 1 | 50.00% |
| Total | 22 | 100.00% | 2 | 100.00% |
static inline char *snd_info_get_str(char *dest, char *src, int len) { return NULL; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 22 | 100.00% | 1 | 100.00% |
| Total | 22 | 100.00% | 1 | 100.00% |
static inline struct snd_info_entry *snd_info_create_module_entry(struct module *module, const char *name, struct snd_info_entry *parent) { return NULL; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 23 | 85.19% | 2 | 66.67% |
takashi iwai | takashi iwai | 4 | 14.81% | 1 | 33.33% |
| Total | 27 | 100.00% | 3 | 100.00% |
static inline struct snd_info_entry *snd_info_create_card_entry(struct snd_card *card, const char *name, struct snd_info_entry *parent) { return NULL; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 21 | 77.78% | 2 | 66.67% |
takashi iwai | takashi iwai | 6 | 22.22% | 1 | 33.33% |
| Total | 27 | 100.00% | 3 | 100.00% |
static inline void snd_info_free_entry(struct snd_info_entry *entry) { ; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 11 | 84.62% | 1 | 50.00% |
takashi iwai | takashi iwai | 2 | 15.38% | 1 | 50.00% |
| Total | 13 | 100.00% | 2 | 100.00% |
static inline int snd_info_card_create(struct snd_card *card) { return 0; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 13 | 86.67% | 1 | 50.00% |
takashi iwai | takashi iwai | 2 | 13.33% | 1 | 50.00% |
| Total | 15 | 100.00% | 2 | 100.00% |
static inline int snd_info_card_register(struct snd_card *card) { return 0; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 13 | 86.67% | 1 | 50.00% |
takashi iwai | takashi iwai | 2 | 13.33% | 1 | 50.00% |
| Total | 15 | 100.00% | 2 | 100.00% |
static inline int snd_info_card_free(struct snd_card *card) { return 0; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 13 | 86.67% | 2 | 66.67% |
takashi iwai | takashi iwai | 2 | 13.33% | 1 | 33.33% |
| Total | 15 | 100.00% | 3 | 100.00% |
static inline void snd_info_card_disconnect(struct snd_card *card) { }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
takashi iwai | takashi iwai | 6 | 54.55% | 2 | 66.67% |
jaroslav kysela | jaroslav kysela | 5 | 45.45% | 1 | 33.33% |
| Total | 11 | 100.00% | 3 | 100.00% |
static inline void snd_info_card_id_change(struct snd_card *card) { }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 11 | 100.00% | 1 | 100.00% |
| Total | 11 | 100.00% | 1 | 100.00% |
static inline int snd_info_register(struct snd_info_entry *entry) { return 0; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 12 | 80.00% | 1 | 33.33% |
takashi iwai | takashi iwai | 3 | 20.00% | 2 | 66.67% |
| Total | 15 | 100.00% | 3 | 100.00% |
static inline int snd_card_proc_new(struct snd_card *card, const char *name,
struct snd_info_entry **entryp) { return -EINVAL; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
takashi iwai | takashi iwai | 19 | 70.37% | 1 | 50.00% |
jaroslav kysela | jaroslav kysela | 8 | 29.63% | 1 | 50.00% |
| Total | 27 | 100.00% | 2 | 100.00% |
static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)),
void *private_data,
void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {}
static inline int snd_info_check_reserved_words(const char *str) { return 1; }
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
takashi iwai | takashi iwai | 14 | 93.33% | 1 | 50.00% |
jaroslav kysela | jaroslav kysela | 1 | 6.67% | 1 | 50.00% |
| Total | 15 | 100.00% | 2 | 100.00% |
#endif
/*
* OSS info part
*/
#if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_SND_PROC_FS)
#define SNDRV_OSS_INFO_DEV_AUDIO 0
#define SNDRV_OSS_INFO_DEV_SYNTH 1
#define SNDRV_OSS_INFO_DEV_MIDI 2
#define SNDRV_OSS_INFO_DEV_TIMERS 4
#define SNDRV_OSS_INFO_DEV_MIXERS 5
#define SNDRV_OSS_INFO_DEV_COUNT 6
int snd_oss_info_register(int dev, int num, char *string);
#define snd_oss_info_unregister(dev, num) snd_oss_info_register(dev, num, NULL)
#endif /* CONFIG_SND_OSSEMUL && CONFIG_SND_PROC_FS */
#endif /* __SOUND_INFO_H */
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jaroslav kysela | jaroslav kysela | 881 | 76.15% | 11 | 42.31% |
takashi iwai | takashi iwai | 244 | 21.09% | 9 | 34.62% |
marcin slusarz | marcin slusarz | 20 | 1.73% | 1 | 3.85% |
jie yang | jie yang | 4 | 0.35% | 1 | 3.85% |
linus torvalds | linus torvalds | 4 | 0.35% | 1 | 3.85% |
al viro | al viro | 3 | 0.26% | 2 | 7.69% |
ingo molnar | ingo molnar | 1 | 0.09% | 1 | 3.85% |
| Total | 1157 | 100.00% | 26 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.