hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/include/sound/info.h
....@@ -1,29 +1,15 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 #ifndef __SOUND_INFO_H
23 #define __SOUND_INFO_H
34
45 /*
56 * Header file for info interface
67 * 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
- *
238 */
249
2510 #include <linux/poll.h>
2611 #include <linux/seq_file.h>
12
+#include <linux/android_kabi.h>
2713 #include <sound/core.h>
2814
2915 /* buffer for information */
....@@ -70,6 +56,8 @@
7056 int (*mmap)(struct snd_info_entry *entry, void *file_private_data,
7157 struct inode *inode, struct file *file,
7258 struct vm_area_struct *vma);
59
+
60
+ ANDROID_KABI_RESERVE(1);
7361 };
7462
7563 struct snd_info_entry {
....@@ -79,10 +67,9 @@
7967 unsigned short content;
8068 union {
8169 struct snd_info_entry_text text;
82
- struct snd_info_entry_ops *ops;
70
+ const struct snd_info_entry_ops *ops;
8371 } c;
8472 struct snd_info_entry *parent;
85
- struct snd_card *card;
8673 struct module *module;
8774 void *private_data;
8875 void (*private_free)(struct snd_info_entry *entry);
....@@ -90,6 +77,8 @@
9077 struct mutex access;
9178 struct list_head children;
9279 struct list_head list;
80
+
81
+ ANDROID_KABI_RESERVE(1);
9382 };
9483
9584 #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_SND_PROC_FS)
....@@ -160,10 +149,15 @@
160149 entry->c.text.read = read;
161150 }
162151
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
+
163159 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
+
167161 #else
168162
169163 #define snd_seq_root NULL
....@@ -191,12 +185,38 @@
191185 static inline void snd_info_set_text_ops(struct snd_info_entry *entry __attribute__((unused)),
192186 void *private_data,
193187 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
+}
194197 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
+
198199 #endif
199200
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
+
200220 /*
201221 * OSS info part
202222 */