Commit 53d2f744 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] Remove xxx_t typedefs: Timer

Modules: RTC timer driver,Timer Midlevel

Remove xxx_t typedefs from the core timer.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 82e9bae6
...@@ -26,20 +26,6 @@ ...@@ -26,20 +26,6 @@
#include <sound/asound.h> #include <sound/asound.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
typedef enum sndrv_timer_class snd_timer_class_t;
typedef enum sndrv_timer_slave_class snd_timer_slave_class_t;
typedef enum sndrv_timer_global snd_timer_global_t;
typedef struct sndrv_timer_id snd_timer_id_t;
typedef struct sndrv_timer_ginfo snd_timer_ginfo_t;
typedef struct sndrv_timer_gparams snd_timer_gparams_t;
typedef struct sndrv_timer_gstatus snd_timer_gstatus_t;
typedef struct sndrv_timer_select snd_timer_select_t;
typedef struct sndrv_timer_info snd_timer_info_t;
typedef struct sndrv_timer_params snd_timer_params_t;
typedef struct sndrv_timer_status snd_timer_status_t;
typedef struct sndrv_timer_read snd_timer_read_t;
typedef struct sndrv_timer_tread snd_timer_tread_t;
#define snd_timer_chip(timer) ((timer)->private_data) #define snd_timer_chip(timer) ((timer)->private_data)
#define SNDRV_TIMER_DEVICES 16 #define SNDRV_TIMER_DEVICES 16
...@@ -64,11 +50,9 @@ typedef struct sndrv_timer_tread snd_timer_tread_t; ...@@ -64,11 +50,9 @@ typedef struct sndrv_timer_tread snd_timer_tread_t;
#define SNDRV_TIMER_FLG_CHANGE 0x00000001 #define SNDRV_TIMER_FLG_CHANGE 0x00000001
#define SNDRV_TIMER_FLG_RESCHED 0x00000002 /* need reschedule */ #define SNDRV_TIMER_FLG_RESCHED 0x00000002 /* need reschedule */
typedef void (*snd_timer_callback_t) (snd_timer_instance_t * timeri, unsigned long ticks, unsigned long resolution); struct snd_timer;
typedef void (*snd_timer_ccallback_t) (snd_timer_instance_t * timeri, enum sndrv_timer_event event,
struct timespec * tstamp, unsigned long resolution);
struct _snd_timer_hardware { struct snd_timer_hardware {
/* -- must be filled with low-level driver */ /* -- must be filled with low-level driver */
unsigned int flags; /* various flags */ unsigned int flags; /* various flags */
unsigned long resolution; /* average timer resolution for one tick in nsec */ unsigned long resolution; /* average timer resolution for one tick in nsec */
...@@ -76,18 +60,18 @@ struct _snd_timer_hardware { ...@@ -76,18 +60,18 @@ struct _snd_timer_hardware {
unsigned long resolution_max; /* maximal resolution */ unsigned long resolution_max; /* maximal resolution */
unsigned long ticks; /* max timer ticks per interrupt */ unsigned long ticks; /* max timer ticks per interrupt */
/* -- low-level functions -- */ /* -- low-level functions -- */
int (*open) (snd_timer_t * timer); int (*open) (struct snd_timer * timer);
int (*close) (snd_timer_t * timer); int (*close) (struct snd_timer * timer);
unsigned long (*c_resolution) (snd_timer_t * timer); unsigned long (*c_resolution) (struct snd_timer * timer);
int (*start) (snd_timer_t * timer); int (*start) (struct snd_timer * timer);
int (*stop) (snd_timer_t * timer); int (*stop) (struct snd_timer * timer);
int (*set_period) (snd_timer_t * timer, unsigned long period_num, unsigned long period_den); int (*set_period) (struct snd_timer * timer, unsigned long period_num, unsigned long period_den);
int (*precise_resolution) (snd_timer_t * timer, unsigned long *num, unsigned long *den); int (*precise_resolution) (struct snd_timer * timer, unsigned long *num, unsigned long *den);
}; };
struct _snd_timer { struct snd_timer {
snd_timer_class_t tmr_class; int tmr_class;
snd_card_t *card; struct snd_card *card;
struct module *module; struct module *module;
int tmr_device; int tmr_device;
int tmr_subdevice; int tmr_subdevice;
...@@ -97,8 +81,8 @@ struct _snd_timer { ...@@ -97,8 +81,8 @@ struct _snd_timer {
int running; /* running instances */ int running; /* running instances */
unsigned long sticks; /* schedule ticks */ unsigned long sticks; /* schedule ticks */
void *private_data; void *private_data;
void (*private_free) (snd_timer_t *timer); void (*private_free) (struct snd_timer *timer);
struct _snd_timer_hardware hw; struct snd_timer_hardware hw;
spinlock_t lock; spinlock_t lock;
struct list_head device_list; struct list_head device_list;
struct list_head open_list_head; struct list_head open_list_head;
...@@ -108,49 +92,53 @@ struct _snd_timer { ...@@ -108,49 +92,53 @@ struct _snd_timer {
struct tasklet_struct task_queue; struct tasklet_struct task_queue;
}; };
struct _snd_timer_instance { struct snd_timer_instance {
snd_timer_t * timer; struct snd_timer *timer;
char *owner; char *owner;
unsigned int flags; unsigned int flags;
void *private_data; void *private_data;
void (*private_free) (snd_timer_instance_t *ti); void (*private_free) (struct snd_timer_instance *ti);
snd_timer_callback_t callback; void (*callback) (struct snd_timer_instance *timeri,
snd_timer_ccallback_t ccallback; unsigned long ticks, unsigned long resolution);
void (*ccallback) (struct snd_timer_instance * timeri,
int event,
struct timespec * tstamp,
unsigned long resolution);
void *callback_data; void *callback_data;
unsigned long ticks; /* auto-load ticks when expired */ unsigned long ticks; /* auto-load ticks when expired */
unsigned long cticks; /* current ticks */ unsigned long cticks; /* current ticks */
unsigned long pticks; /* accumulated ticks for callback */ unsigned long pticks; /* accumulated ticks for callback */
unsigned long resolution; /* current resolution for tasklet */ unsigned long resolution; /* current resolution for tasklet */
unsigned long lost; /* lost ticks */ unsigned long lost; /* lost ticks */
snd_timer_slave_class_t slave_class; int slave_class;
unsigned int slave_id; unsigned int slave_id;
struct list_head open_list; struct list_head open_list;
struct list_head active_list; struct list_head active_list;
struct list_head ack_list; struct list_head ack_list;
struct list_head slave_list_head; struct list_head slave_list_head;
struct list_head slave_active_head; struct list_head slave_active_head;
snd_timer_instance_t *master; struct snd_timer_instance *master;
}; };
/* /*
* Registering * Registering
*/ */
extern int snd_timer_new(snd_card_t *card, char *id, snd_timer_id_t *tid, snd_timer_t ** rtimer); int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid, struct snd_timer **rtimer);
extern void snd_timer_notify(snd_timer_t *timer, enum sndrv_timer_event event, struct timespec *tstamp); void snd_timer_notify(struct snd_timer *timer, int event, struct timespec *tstamp);
extern int snd_timer_global_new(char *id, int device, snd_timer_t **rtimer); int snd_timer_global_new(char *id, int device, struct snd_timer **rtimer);
extern int snd_timer_global_free(snd_timer_t *timer); int snd_timer_global_free(struct snd_timer *timer);
extern int snd_timer_global_register(snd_timer_t *timer); int snd_timer_global_register(struct snd_timer *timer);
extern int snd_timer_global_unregister(snd_timer_t *timer); int snd_timer_global_unregister(struct snd_timer *timer);
extern int snd_timer_open(snd_timer_instance_t ** ti, char *owner, snd_timer_id_t *tid, unsigned int slave_id); int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id);
extern int snd_timer_close(snd_timer_instance_t * timeri); int snd_timer_close(struct snd_timer_instance *timeri);
extern unsigned long snd_timer_resolution(snd_timer_instance_t * timeri); unsigned long snd_timer_resolution(struct snd_timer_instance *timeri);
extern int snd_timer_start(snd_timer_instance_t * timeri, unsigned int ticks); int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks);
extern int snd_timer_stop(snd_timer_instance_t * timeri); int snd_timer_stop(struct snd_timer_instance *timeri);
extern int snd_timer_continue(snd_timer_instance_t * timeri); int snd_timer_continue(struct snd_timer_instance *timeri);
extern int snd_timer_pause(snd_timer_instance_t * timeri); int snd_timer_pause(struct snd_timer_instance *timeri);
extern void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left); void snd_timer_interrupt(struct snd_timer *timer, unsigned long ticks_left);
#endif /* __SOUND_TIMER_H */ #endif /* __SOUND_TIMER_H */
...@@ -40,16 +40,16 @@ ...@@ -40,16 +40,16 @@
/* /*
* prototypes * prototypes
*/ */
static int rtctimer_open(snd_timer_t *t); static int rtctimer_open(struct snd_timer *t);
static int rtctimer_close(snd_timer_t *t); static int rtctimer_close(struct snd_timer *t);
static int rtctimer_start(snd_timer_t *t); static int rtctimer_start(struct snd_timer *t);
static int rtctimer_stop(snd_timer_t *t); static int rtctimer_stop(struct snd_timer *t);
/* /*
* The hardware dependent description for this timer. * The hardware dependent description for this timer.
*/ */
static struct _snd_timer_hardware rtc_hw = { static struct snd_timer_hardware rtc_hw = {
.flags = SNDRV_TIMER_HW_FIRST|SNDRV_TIMER_HW_AUTO, .flags = SNDRV_TIMER_HW_FIRST|SNDRV_TIMER_HW_AUTO,
.ticks = 100000000L, /* FIXME: XXX */ .ticks = 100000000L, /* FIXME: XXX */
.open = rtctimer_open, .open = rtctimer_open,
...@@ -59,12 +59,12 @@ static struct _snd_timer_hardware rtc_hw = { ...@@ -59,12 +59,12 @@ static struct _snd_timer_hardware rtc_hw = {
}; };
static int rtctimer_freq = RTC_FREQ; /* frequency */ static int rtctimer_freq = RTC_FREQ; /* frequency */
static snd_timer_t *rtctimer; static struct snd_timer *rtctimer;
static rtc_task_t rtc_task; static rtc_task_t rtc_task;
static int static int
rtctimer_open(snd_timer_t *t) rtctimer_open(struct snd_timer *t)
{ {
int err; int err;
...@@ -76,7 +76,7 @@ rtctimer_open(snd_timer_t *t) ...@@ -76,7 +76,7 @@ rtctimer_open(snd_timer_t *t)
} }
static int static int
rtctimer_close(snd_timer_t *t) rtctimer_close(struct snd_timer *t)
{ {
rtc_task_t *rtc = t->private_data; rtc_task_t *rtc = t->private_data;
if (rtc) { if (rtc) {
...@@ -87,7 +87,7 @@ rtctimer_close(snd_timer_t *t) ...@@ -87,7 +87,7 @@ rtctimer_close(snd_timer_t *t)
} }
static int static int
rtctimer_start(snd_timer_t *timer) rtctimer_start(struct snd_timer *timer)
{ {
rtc_task_t *rtc = timer->private_data; rtc_task_t *rtc = timer->private_data;
snd_assert(rtc != NULL, return -EINVAL); snd_assert(rtc != NULL, return -EINVAL);
...@@ -97,7 +97,7 @@ rtctimer_start(snd_timer_t *timer) ...@@ -97,7 +97,7 @@ rtctimer_start(snd_timer_t *timer)
} }
static int static int
rtctimer_stop(snd_timer_t *timer) rtctimer_stop(struct snd_timer *timer)
{ {
rtc_task_t *rtc = timer->private_data; rtc_task_t *rtc = timer->private_data;
snd_assert(rtc != NULL, return -EINVAL); snd_assert(rtc != NULL, return -EINVAL);
...@@ -120,7 +120,7 @@ static void rtctimer_interrupt(void *private_data) ...@@ -120,7 +120,7 @@ static void rtctimer_interrupt(void *private_data)
static int __init rtctimer_init(void) static int __init rtctimer_init(void)
{ {
int err; int err;
snd_timer_t *timer; struct snd_timer *timer;
if (rtctimer_freq < 2 || rtctimer_freq > 8192 || if (rtctimer_freq < 2 || rtctimer_freq > 8192 ||
(rtctimer_freq & (rtctimer_freq - 1)) != 0) { (rtctimer_freq & (rtctimer_freq - 1)) != 0) {
......
This diff is collapsed.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <linux/compat.h> #include <linux/compat.h>
struct sndrv_timer_info32 { struct snd_timer_info32 {
u32 flags; u32 flags;
s32 card; s32 card;
unsigned char id[64]; unsigned char id[64];
...@@ -33,11 +33,11 @@ struct sndrv_timer_info32 { ...@@ -33,11 +33,11 @@ struct sndrv_timer_info32 {
}; };
static int snd_timer_user_info_compat(struct file *file, static int snd_timer_user_info_compat(struct file *file,
struct sndrv_timer_info32 __user *_info) struct snd_timer_info32 __user *_info)
{ {
snd_timer_user_t *tu; struct snd_timer_user *tu;
struct sndrv_timer_info32 info; struct snd_timer_info32 info;
snd_timer_t *t; struct snd_timer *t;
tu = file->private_data; tu = file->private_data;
snd_assert(tu->timeri != NULL, return -ENXIO); snd_assert(tu->timeri != NULL, return -ENXIO);
...@@ -55,7 +55,7 @@ static int snd_timer_user_info_compat(struct file *file, ...@@ -55,7 +55,7 @@ static int snd_timer_user_info_compat(struct file *file,
return 0; return 0;
} }
struct sndrv_timer_status32 { struct snd_timer_status32 {
struct compat_timespec tstamp; struct compat_timespec tstamp;
u32 resolution; u32 resolution;
u32 lost; u32 lost;
...@@ -65,10 +65,10 @@ struct sndrv_timer_status32 { ...@@ -65,10 +65,10 @@ struct sndrv_timer_status32 {
}; };
static int snd_timer_user_status_compat(struct file *file, static int snd_timer_user_status_compat(struct file *file,
struct sndrv_timer_status32 __user *_status) struct snd_timer_status32 __user *_status)
{ {
snd_timer_user_t *tu; struct snd_timer_user *tu;
snd_timer_status_t status; struct snd_timer_status status;
tu = file->private_data; tu = file->private_data;
snd_assert(tu->timeri != NULL, return -ENXIO); snd_assert(tu->timeri != NULL, return -ENXIO);
...@@ -89,8 +89,8 @@ static int snd_timer_user_status_compat(struct file *file, ...@@ -89,8 +89,8 @@ static int snd_timer_user_status_compat(struct file *file,
*/ */
enum { enum {
SNDRV_TIMER_IOCTL_INFO32 = _IOR('T', 0x11, struct sndrv_timer_info32), SNDRV_TIMER_IOCTL_INFO32 = _IOR('T', 0x11, struct snd_timer_info32),
SNDRV_TIMER_IOCTL_STATUS32 = _IOW('T', 0x14, struct sndrv_timer_status32), SNDRV_TIMER_IOCTL_STATUS32 = _IOW('T', 0x14, struct snd_timer_status32),
}; };
static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg) static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment