aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-11-17 07:56:05 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:17:34 -0500
commit53d2f744afc1fcb4fb68975a443fb66eb6c44da4 (patch)
tree46db033f71a8da32470d4b5f1027cee379fc7914 /include
parent82e9bae6fd253af4aea9c690223c7800313632ad (diff)
[ALSA] Remove xxx_t typedefs: Timer
Modules: RTC timer driver,Timer Midlevel Remove xxx_t typedefs from the core timer. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/sound/timer.h94
1 files changed, 41 insertions, 53 deletions
diff --git a/include/sound/timer.h b/include/sound/timer.h
index b55f38ae56e1..5ece2bf541dc 100644
--- a/include/sound/timer.h
+++ b/include/sound/timer.h
@@ -26,20 +26,6 @@
26#include <sound/asound.h> 26#include <sound/asound.h>
27#include <linux/interrupt.h> 27#include <linux/interrupt.h>
28 28
29typedef enum sndrv_timer_class snd_timer_class_t;
30typedef enum sndrv_timer_slave_class snd_timer_slave_class_t;
31typedef enum sndrv_timer_global snd_timer_global_t;
32typedef struct sndrv_timer_id snd_timer_id_t;
33typedef struct sndrv_timer_ginfo snd_timer_ginfo_t;
34typedef struct sndrv_timer_gparams snd_timer_gparams_t;
35typedef struct sndrv_timer_gstatus snd_timer_gstatus_t;
36typedef struct sndrv_timer_select snd_timer_select_t;
37typedef struct sndrv_timer_info snd_timer_info_t;
38typedef struct sndrv_timer_params snd_timer_params_t;
39typedef struct sndrv_timer_status snd_timer_status_t;
40typedef struct sndrv_timer_read snd_timer_read_t;
41typedef struct sndrv_timer_tread snd_timer_tread_t;
42
43#define snd_timer_chip(timer) ((timer)->private_data) 29#define snd_timer_chip(timer) ((timer)->private_data)
44 30
45#define SNDRV_TIMER_DEVICES 16 31#define SNDRV_TIMER_DEVICES 16
@@ -64,11 +50,9 @@ typedef struct sndrv_timer_tread snd_timer_tread_t;
64#define SNDRV_TIMER_FLG_CHANGE 0x00000001 50#define SNDRV_TIMER_FLG_CHANGE 0x00000001
65#define SNDRV_TIMER_FLG_RESCHED 0x00000002 /* need reschedule */ 51#define SNDRV_TIMER_FLG_RESCHED 0x00000002 /* need reschedule */
66 52
67typedef void (*snd_timer_callback_t) (snd_timer_instance_t * timeri, unsigned long ticks, unsigned long resolution); 53struct snd_timer;
68typedef void (*snd_timer_ccallback_t) (snd_timer_instance_t * timeri, enum sndrv_timer_event event,
69 struct timespec * tstamp, unsigned long resolution);
70 54
71struct _snd_timer_hardware { 55struct snd_timer_hardware {
72 /* -- must be filled with low-level driver */ 56 /* -- must be filled with low-level driver */
73 unsigned int flags; /* various flags */ 57 unsigned int flags; /* various flags */
74 unsigned long resolution; /* average timer resolution for one tick in nsec */ 58 unsigned long resolution; /* average timer resolution for one tick in nsec */
@@ -76,18 +60,18 @@ struct _snd_timer_hardware {
76 unsigned long resolution_max; /* maximal resolution */ 60 unsigned long resolution_max; /* maximal resolution */
77 unsigned long ticks; /* max timer ticks per interrupt */ 61 unsigned long ticks; /* max timer ticks per interrupt */
78 /* -- low-level functions -- */ 62 /* -- low-level functions -- */
79 int (*open) (snd_timer_t * timer); 63 int (*open) (struct snd_timer * timer);
80 int (*close) (snd_timer_t * timer); 64 int (*close) (struct snd_timer * timer);
81 unsigned long (*c_resolution) (snd_timer_t * timer); 65 unsigned long (*c_resolution) (struct snd_timer * timer);
82 int (*start) (snd_timer_t * timer); 66 int (*start) (struct snd_timer * timer);
83 int (*stop) (snd_timer_t * timer); 67 int (*stop) (struct snd_timer * timer);
84 int (*set_period) (snd_timer_t * timer, unsigned long period_num, unsigned long period_den); 68 int (*set_period) (struct snd_timer * timer, unsigned long period_num, unsigned long period_den);
85 int (*precise_resolution) (snd_timer_t * timer, unsigned long *num, unsigned long *den); 69 int (*precise_resolution) (struct snd_timer * timer, unsigned long *num, unsigned long *den);
86}; 70};
87 71
88struct _snd_timer { 72struct snd_timer {
89 snd_timer_class_t tmr_class; 73 int tmr_class;
90 snd_card_t *card; 74 struct snd_card *card;
91 struct module *module; 75 struct module *module;
92 int tmr_device; 76 int tmr_device;
93 int tmr_subdevice; 77 int tmr_subdevice;
@@ -97,8 +81,8 @@ struct _snd_timer {
97 int running; /* running instances */ 81 int running; /* running instances */
98 unsigned long sticks; /* schedule ticks */ 82 unsigned long sticks; /* schedule ticks */
99 void *private_data; 83 void *private_data;
100 void (*private_free) (snd_timer_t *timer); 84 void (*private_free) (struct snd_timer *timer);
101 struct _snd_timer_hardware hw; 85 struct snd_timer_hardware hw;
102 spinlock_t lock; 86 spinlock_t lock;
103 struct list_head device_list; 87 struct list_head device_list;
104 struct list_head open_list_head; 88 struct list_head open_list_head;
@@ -108,49 +92,53 @@ struct _snd_timer {
108 struct tasklet_struct task_queue; 92 struct tasklet_struct task_queue;
109}; 93};
110 94
111struct _snd_timer_instance { 95struct snd_timer_instance {
112 snd_timer_t * timer; 96 struct snd_timer *timer;
113 char *owner; 97 char *owner;
114 unsigned int flags; 98 unsigned int flags;
115 void *private_data; 99 void *private_data;
116 void (*private_free) (snd_timer_instance_t *ti); 100 void (*private_free) (struct snd_timer_instance *ti);
117 snd_timer_callback_t callback; 101 void (*callback) (struct snd_timer_instance *timeri,
118 snd_timer_ccallback_t ccallback; 102 unsigned long ticks, unsigned long resolution);
103 void (*ccallback) (struct snd_timer_instance * timeri,
104 int event,
105 struct timespec * tstamp,
106 unsigned long resolution);
119 void *callback_data; 107 void *callback_data;
120 unsigned long ticks; /* auto-load ticks when expired */ 108 unsigned long ticks; /* auto-load ticks when expired */
121 unsigned long cticks; /* current ticks */ 109 unsigned long cticks; /* current ticks */
122 unsigned long pticks; /* accumulated ticks for callback */ 110 unsigned long pticks; /* accumulated ticks for callback */
123 unsigned long resolution; /* current resolution for tasklet */ 111 unsigned long resolution; /* current resolution for tasklet */
124 unsigned long lost; /* lost ticks */ 112 unsigned long lost; /* lost ticks */
125 snd_timer_slave_class_t slave_class; 113 int slave_class;
126 unsigned int slave_id; 114 unsigned int slave_id;
127 struct list_head open_list; 115 struct list_head open_list;
128 struct list_head active_list; 116 struct list_head active_list;
129 struct list_head ack_list; 117 struct list_head ack_list;
130 struct list_head slave_list_head; 118 struct list_head slave_list_head;
131 struct list_head slave_active_head; 119 struct list_head slave_active_head;
132 snd_timer_instance_t *master; 120 struct snd_timer_instance *master;
133}; 121};
134 122
135/* 123/*
136 * Registering 124 * Registering
137 */ 125 */
138 126
139extern int snd_timer_new(snd_card_t *card, char *id, snd_timer_id_t *tid, snd_timer_t ** rtimer); 127int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid, struct snd_timer **rtimer);
140extern void snd_timer_notify(snd_timer_t *timer, enum sndrv_timer_event event, struct timespec *tstamp); 128void snd_timer_notify(struct snd_timer *timer, int event, struct timespec *tstamp);
141extern int snd_timer_global_new(char *id, int device, snd_timer_t **rtimer); 129int snd_timer_global_new(char *id, int device, struct snd_timer **rtimer);
142extern int snd_timer_global_free(snd_timer_t *timer); 130int snd_timer_global_free(struct snd_timer *timer);
143extern int snd_timer_global_register(snd_timer_t *timer); 131int snd_timer_global_register(struct snd_timer *timer);
144extern int snd_timer_global_unregister(snd_timer_t *timer); 132int snd_timer_global_unregister(struct snd_timer *timer);
145 133
146extern int snd_timer_open(snd_timer_instance_t ** ti, char *owner, snd_timer_id_t *tid, unsigned int slave_id); 134int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id);
147extern int snd_timer_close(snd_timer_instance_t * timeri); 135int snd_timer_close(struct snd_timer_instance *timeri);
148extern unsigned long snd_timer_resolution(snd_timer_instance_t * timeri); 136unsigned long snd_timer_resolution(struct snd_timer_instance *timeri);
149extern int snd_timer_start(snd_timer_instance_t * timeri, unsigned int ticks); 137int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks);
150extern int snd_timer_stop(snd_timer_instance_t * timeri); 138int snd_timer_stop(struct snd_timer_instance *timeri);
151extern int snd_timer_continue(snd_timer_instance_t * timeri); 139int snd_timer_continue(struct snd_timer_instance *timeri);
152extern int snd_timer_pause(snd_timer_instance_t * timeri); 140int snd_timer_pause(struct snd_timer_instance *timeri);
153 141
154extern void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left); 142void snd_timer_interrupt(struct snd_timer *timer, unsigned long ticks_left);
155 143
156#endif /* __SOUND_TIMER_H */ 144#endif /* __SOUND_TIMER_H */