hc
2024-02-20 e636c8d336489bf3eed5878299e6cc045bbad077
kernel/include/sound/timer.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 #ifndef __SOUND_TIMER_H
23 #define __SOUND_TIMER_H
34
....@@ -5,26 +6,11 @@
56 * Timer abstract layer
67 * Copyright (c) by Jaroslav Kysela <perex@perex.cz>,
78 * Abramo Bagnara <abramo@alsa-project.org>
8
- *
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or
13
- * (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
- * GNU General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public License
21
- * along with this program; if not, write to the Free Software
22
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
- *
249 */
2510
2611 #include <sound/asound.h>
2712 #include <linux/interrupt.h>
13
+#include <linux/android_kabi.h>
2814
2915 #define snd_timer_chip(timer) ((timer)->private_data)
3016
....@@ -36,13 +22,13 @@
3622 #define SNDRV_TIMER_HW_STOP 0x00000002 /* call stop before start */
3723 #define SNDRV_TIMER_HW_SLAVE 0x00000004 /* only slave timer (variable resolution) */
3824 #define SNDRV_TIMER_HW_FIRST 0x00000008 /* first tick can be incomplete */
39
-#define SNDRV_TIMER_HW_TASKLET 0x00000010 /* timer is called from tasklet */
25
+#define SNDRV_TIMER_HW_WORK 0x00000010 /* timer is called from work */
4026
4127 #define SNDRV_TIMER_IFLG_SLAVE 0x00000001
4228 #define SNDRV_TIMER_IFLG_RUNNING 0x00000002
4329 #define SNDRV_TIMER_IFLG_START 0x00000004
4430 #define SNDRV_TIMER_IFLG_AUTO 0x00000008 /* auto restart */
45
-#define SNDRV_TIMER_IFLG_FAST 0x00000010 /* fast callback (do not use tasklet) */
31
+#define SNDRV_TIMER_IFLG_FAST 0x00000010 /* fast callback (do not use work) */
4632 #define SNDRV_TIMER_IFLG_CALLBACK 0x00000020 /* timer callback is active */
4733 #define SNDRV_TIMER_IFLG_EXCLUSIVE 0x00000040 /* exclusive owner - no more instances */
4834 #define SNDRV_TIMER_IFLG_EARLY_EVENT 0x00000080 /* write early event to the poll queue */
....@@ -67,6 +53,8 @@
6753 int (*stop) (struct snd_timer * timer);
6854 int (*set_period) (struct snd_timer * timer, unsigned long period_num, unsigned long period_den);
6955 int (*precise_resolution) (struct snd_timer * timer, unsigned long *num, unsigned long *den);
56
+
57
+ ANDROID_KABI_RESERVE(1);
7058 };
7159
7260 struct snd_timer {
....@@ -89,9 +77,11 @@
8977 struct list_head active_list_head;
9078 struct list_head ack_list_head;
9179 struct list_head sack_list_head; /* slow ack list head */
92
- struct tasklet_struct task_queue;
80
+ struct work_struct task_work;
9381 int max_instances; /* upper limit of timer instances */
9482 int num_instances; /* current number of timer instances */
83
+
84
+ ANDROID_KABI_RESERVE(1);
9585 };
9686
9787 struct snd_timer_instance {
....@@ -104,14 +94,14 @@
10494 unsigned long ticks, unsigned long resolution);
10595 void (*ccallback) (struct snd_timer_instance * timeri,
10696 int event,
107
- struct timespec * tstamp,
97
+ struct timespec64 * tstamp,
10898 unsigned long resolution);
10999 void (*disconnect)(struct snd_timer_instance *timeri);
110100 void *callback_data;
111101 unsigned long ticks; /* auto-load ticks when expired */
112102 unsigned long cticks; /* current ticks */
113103 unsigned long pticks; /* accumulated ticks for callback */
114
- unsigned long resolution; /* current resolution for tasklet */
104
+ unsigned long resolution; /* current resolution for work */
115105 unsigned long lost; /* lost ticks */
116106 int slave_class;
117107 unsigned int slave_id;
....@@ -121,6 +111,8 @@
121111 struct list_head slave_list_head;
122112 struct list_head slave_active_head;
123113 struct snd_timer_instance *master;
114
+
115
+ ANDROID_KABI_RESERVE(1);
124116 };
125117
126118 /*
....@@ -128,13 +120,15 @@
128120 */
129121
130122 int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid, struct snd_timer **rtimer);
131
-void snd_timer_notify(struct snd_timer *timer, int event, struct timespec *tstamp);
123
+void snd_timer_notify(struct snd_timer *timer, int event, struct timespec64 *tstamp);
132124 int snd_timer_global_new(char *id, int device, struct snd_timer **rtimer);
133125 int snd_timer_global_free(struct snd_timer *timer);
134126 int snd_timer_global_register(struct snd_timer *timer);
135127
136
-int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id);
137
-int snd_timer_close(struct snd_timer_instance *timeri);
128
+struct snd_timer_instance *snd_timer_instance_new(const char *owner);
129
+void snd_timer_instance_free(struct snd_timer_instance *timeri);
130
+int snd_timer_open(struct snd_timer_instance *timeri, struct snd_timer_id *tid, unsigned int slave_id);
131
+void snd_timer_close(struct snd_timer_instance *timeri);
138132 unsigned long snd_timer_resolution(struct snd_timer_instance *timeri);
139133 int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks);
140134 int snd_timer_stop(struct snd_timer_instance *timeri);