| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | #ifndef __SOUND_INFO_H |
|---|
| 2 | 3 | #define __SOUND_INFO_H |
|---|
| 3 | 4 | |
|---|
| 4 | 5 | /* |
|---|
| 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 modify |
|---|
| 10 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 11 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 12 | | - * (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 of |
|---|
| 16 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 17 | | - * GNU General Public License for more details. |
|---|
| 18 | | - * |
|---|
| 19 | | - * You should have received a copy of the GNU General Public License |
|---|
| 20 | | - * along with this program; if not, write to the Free Software |
|---|
| 21 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 22 | | - * |
|---|
| 23 | 8 | */ |
|---|
| 24 | 9 | |
|---|
| 25 | 10 | #include <linux/poll.h> |
|---|
| 26 | 11 | #include <linux/seq_file.h> |
|---|
| 12 | +#include <linux/android_kabi.h> |
|---|
| 27 | 13 | #include <sound/core.h> |
|---|
| 28 | 14 | |
|---|
| 29 | 15 | /* buffer for information */ |
|---|
| .. | .. |
|---|
| 70 | 56 | int (*mmap)(struct snd_info_entry *entry, void *file_private_data, |
|---|
| 71 | 57 | struct inode *inode, struct file *file, |
|---|
| 72 | 58 | struct vm_area_struct *vma); |
|---|
| 59 | + |
|---|
| 60 | + ANDROID_KABI_RESERVE(1); |
|---|
| 73 | 61 | }; |
|---|
| 74 | 62 | |
|---|
| 75 | 63 | struct snd_info_entry { |
|---|
| .. | .. |
|---|
| 79 | 67 | unsigned short content; |
|---|
| 80 | 68 | union { |
|---|
| 81 | 69 | struct snd_info_entry_text text; |
|---|
| 82 | | - struct snd_info_entry_ops *ops; |
|---|
| 70 | + const struct snd_info_entry_ops *ops; |
|---|
| 83 | 71 | } c; |
|---|
| 84 | 72 | struct snd_info_entry *parent; |
|---|
| 85 | | - struct snd_card *card; |
|---|
| 86 | 73 | struct module *module; |
|---|
| 87 | 74 | void *private_data; |
|---|
| 88 | 75 | void (*private_free)(struct snd_info_entry *entry); |
|---|
| .. | .. |
|---|
| 90 | 77 | struct mutex access; |
|---|
| 91 | 78 | struct list_head children; |
|---|
| 92 | 79 | struct list_head list; |
|---|
| 80 | + |
|---|
| 81 | + ANDROID_KABI_RESERVE(1); |
|---|
| 93 | 82 | }; |
|---|
| 94 | 83 | |
|---|
| 95 | 84 | #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_SND_PROC_FS) |
|---|
| .. | .. |
|---|
| 160 | 149 | entry->c.text.read = read; |
|---|
| 161 | 150 | } |
|---|
| 162 | 151 | |
|---|
| 152 | +int snd_card_rw_proc_new(struct snd_card *card, const char *name, |
|---|
| 153 | + void *private_data, |
|---|
| 154 | + void (*read)(struct snd_info_entry *, |
|---|
| 155 | + struct snd_info_buffer *), |
|---|
| 156 | + void (*write)(struct snd_info_entry *entry, |
|---|
| 157 | + struct snd_info_buffer *buffer)); |
|---|
| 158 | + |
|---|
| 163 | 159 | int snd_info_check_reserved_words(const char *str); |
|---|
| 164 | | -struct snd_info_entry *snd_info_create_subdir(struct module *mod, |
|---|
| 165 | | - const char *name, |
|---|
| 166 | | - struct snd_info_entry *parent); |
|---|
| 160 | + |
|---|
| 167 | 161 | #else |
|---|
| 168 | 162 | |
|---|
| 169 | 163 | #define snd_seq_root NULL |
|---|
| .. | .. |
|---|
| 191 | 185 | static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)), |
|---|
| 192 | 186 | void *private_data, |
|---|
| 193 | 187 | void (*read)(struct snd_info_entry *, struct snd_info_buffer *)) {} |
|---|
| 188 | +static inline int snd_card_rw_proc_new(struct snd_card *card, const char *name, |
|---|
| 189 | + void *private_data, |
|---|
| 190 | + void (*read)(struct snd_info_entry *, |
|---|
| 191 | + struct snd_info_buffer *), |
|---|
| 192 | + void (*write)(struct snd_info_entry *entry, |
|---|
| 193 | + struct snd_info_buffer *buffer)) |
|---|
| 194 | +{ |
|---|
| 195 | + return 0; |
|---|
| 196 | +} |
|---|
| 194 | 197 | static inline int snd_info_check_reserved_words(const char *str) { return 1; } |
|---|
| 195 | | -static inline struct snd_info_entry *snd_info_create_subdir( |
|---|
| 196 | | - struct module *mod, const char *name, |
|---|
| 197 | | - struct snd_info_entry *parent) { return NULL; } |
|---|
| 198 | + |
|---|
| 198 | 199 | #endif |
|---|
| 199 | 200 | |
|---|
| 201 | +/** |
|---|
| 202 | + * snd_card_ro_proc_new - Create a read-only text proc file entry for the card |
|---|
| 203 | + * @card: the card instance |
|---|
| 204 | + * @name: the file name |
|---|
| 205 | + * @private_data: the arbitrary private data |
|---|
| 206 | + * @read: the read callback |
|---|
| 207 | + * |
|---|
| 208 | + * This proc file entry will be registered via snd_card_register() call, and |
|---|
| 209 | + * it will be removed automatically at the card removal, too. |
|---|
| 210 | + */ |
|---|
| 211 | +static inline int |
|---|
| 212 | +snd_card_ro_proc_new(struct snd_card *card, const char *name, |
|---|
| 213 | + void *private_data, |
|---|
| 214 | + void (*read)(struct snd_info_entry *, |
|---|
| 215 | + struct snd_info_buffer *)) |
|---|
| 216 | +{ |
|---|
| 217 | + return snd_card_rw_proc_new(card, name, private_data, read, NULL); |
|---|
| 218 | +} |
|---|
| 219 | + |
|---|
| 200 | 220 | /* |
|---|
| 201 | 221 | * OSS info part |
|---|
| 202 | 222 | */ |
|---|