Changeset 679 for GPL/trunk/alsa-kernel/include/sound/info.h
- Timestamp:
- Mar 18, 2021, 8:57:36 PM (4 years ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-linux-3.2.102 (added) merged: 611-614 /GPL/branches/uniaud32-next (added) merged: 615-678
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/include/sound/info.h
r598 r679 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 1 2 #ifndef __SOUND_INFO_H 2 3 #define __SOUND_INFO_H … … 5 6 * Header file for info interface 6 7 * Copyright (c) by Jaroslav Kysela <perex@perex.cz> 7 *8 *9 * This program is free software; you can redistribute it and/or modify10 * it under the terms of the GNU General Public License as published by11 * the Free Software Foundation; either version 2 of the License, or12 * (at your option) any later version.13 *14 * This program is distributed in the hope that it will be useful,15 * but WITHOUT ANY WARRANTY; without even the implied warranty of16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the17 * GNU General Public License for more details.18 *19 * You should have received a copy of the GNU General Public License20 * along with this program; if not, write to the Free Software21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA22 *23 8 */ 24 9 25 10 #include <linux/poll.h> 11 #include <linux/seq_file.h> 12 #include <sound/core.h> 26 13 27 14 /* buffer for information */ … … 61 48 void *file_private_data, struct file *file, 62 49 loff_t offset, int orig); 63 unsigned int (*poll)(struct snd_info_entry *entry,50 __poll_t (*poll)(struct snd_info_entry *entry, 64 51 void *file_private_data, struct file *file, 65 52 poll_table *wait); … … 73 60 struct snd_info_entry { 74 61 const char *name; 75 mode_t mode;62 umode_t mode; 76 63 long size; 77 64 unsigned short content; 78 65 union { 79 66 struct snd_info_entry_text text; 80 struct snd_info_entry_ops *ops;67 const struct snd_info_entry_ops *ops; 81 68 } c; 82 69 struct snd_info_entry *parent; 83 struct snd_card *card;84 70 struct module *module; 85 71 void *private_data; … … 91 77 }; 92 78 93 #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)79 #if (defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_SND_PROC_FS)) || defined(TARGET_OS2) 94 80 int snd_info_minor_register(void); 95 int snd_info_minor_unregister(void); 96 #else 97 #define snd_info_minor_register() /* NOP */ 98 #define snd_info_minor_unregister() /* NOP */ 99 #endif 100 101 102 #ifdef CONFIG_PROC_FS 81 #else 82 #define snd_info_minor_register() 0 83 #endif 84 85 86 #if defined(CONFIG_SND_PROC_FS) 103 87 104 88 extern struct snd_info_entry *snd_seq_root; … … 111 95 #endif 112 96 97 /** 98 * snd_iprintf - printf on the procfs buffer 99 * @buf: the procfs buffer 100 * @fmt: the printf format 101 * 102 * Outputs the string on the procfs buffer just like printf(). 103 * 104 * Return: zero for success, or a negative error code. 105 */ 113 106 #ifndef TARGET_OS2 114 int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...) \ 115 __attribute__ ((format (printf, 2, 3))); 116 #else 117 int snd_iprintf(struct snd_info_buffer * buffer, char *fmt,...); 118 #endif 107 #define snd_iprintf(buf, fmt, args...) \ 108 seq_printf((struct seq_file *)(buf)->buffer, fmt, ##args) 109 #else 110 static inline int snd_iprintf(struct snd_info_buffer *buffer, char *fmt, ...) { return 0; } 111 #endif 112 119 113 int snd_info_init(void); 120 114 int snd_info_done(void); … … 140 134 141 135 /* for card drivers */ 142 int snd_card_proc_new(struct snd_card *card, const char *name, 143 struct snd_info_entry **entryp); 136 static inline int snd_card_proc_new(struct snd_card *card, const char *name, 137 struct snd_info_entry **entryp) 138 { 139 *entryp = snd_info_create_card_entry(card, name, card->proc_root); 140 return *entryp ? 0 : -ENOMEM; 141 } 144 142 145 143 static inline void snd_info_set_text_ops(struct snd_info_entry *entry, … … 150 148 entry->c.text.read = read; 151 149 } 150 151 int snd_card_rw_proc_new(struct snd_card *card, const char *name, 152 void *private_data, 153 void (*read)(struct snd_info_entry *, 154 struct snd_info_buffer *), 155 void (*write)(struct snd_info_entry *entry, 156 struct snd_info_buffer *buffer)); 152 157 153 158 int snd_info_check_reserved_words(const char *str); … … 177 182 static inline int snd_card_proc_new(struct snd_card *card, const char *name, 178 183 struct snd_info_entry **entryp) { return -EINVAL; } 179 static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)),184 static inline void snd_info_set_text_ops(struct snd_info_entry *entry /*__attribute__((unused))*/, 180 185 void *private_data, 181 186 void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {} 182 187 static inline int snd_card_rw_proc_new(struct snd_card *card, const char *name, 188 void *private_data, 189 void (*read)(struct snd_info_entry *, 190 struct snd_info_buffer *), 191 void (*write)(struct snd_info_entry *entry, 192 struct snd_info_buffer *buffer)) 193 { 194 return 0; 195 } 183 196 static inline int snd_info_check_reserved_words(const char *str) { return 1; } 184 197 185 198 #endif 199 200 /** 201 * snd_card_ro_proc_new - Create a read-only text proc file entry for the card 202 * @card: the card instance 203 * @name: the file name 204 * @private_data: the arbitrary private data 205 * @read: the read callback 206 * 207 * This proc file entry will be registered via snd_card_register() call, and 208 * it will be removed automatically at the card removal, too. 209 */ 210 static inline int 211 snd_card_ro_proc_new(struct snd_card *card, const char *name, 212 void *private_data, 213 void (*read)(struct snd_info_entry *, 214 struct snd_info_buffer *)) 215 { 216 return snd_card_rw_proc_new(card, name, private_data, read, NULL); 217 } 186 218 187 219 /* … … 189 221 */ 190 222 191 #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)223 #if (defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_SND_PROC_FS)) || defined(TARGET_OS2) 192 224 193 225 #define SNDRV_OSS_INFO_DEV_AUDIO 0 … … 202 234 #define snd_oss_info_unregister(dev, num) snd_oss_info_register(dev, num, NULL) 203 235 204 #endif /* CONFIG_SND_OSSEMUL && CONFIG_ PROC_FS */236 #endif /* CONFIG_SND_OSSEMUL && CONFIG_SND_PROC_FS */ 205 237 206 238 #endif /* __SOUND_INFO_H */
Note:
See TracChangeset
for help on using the changeset viewer.