提交 53d2f744 编写于 作者: T Takashi Iwai 提交者: 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: NTakashi Iwai <tiwai@suse.de>
上级 82e9bae6
......@@ -26,20 +26,6 @@
#include <sound/asound.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 SNDRV_TIMER_DEVICES 16
......@@ -64,11 +50,9 @@ typedef struct sndrv_timer_tread snd_timer_tread_t;
#define SNDRV_TIMER_FLG_CHANGE 0x00000001
#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);
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;
struct _snd_timer_hardware {
struct snd_timer_hardware {
/* -- must be filled with low-level driver */
unsigned int flags; /* various flags */
unsigned long resolution; /* average timer resolution for one tick in nsec */
......@@ -76,18 +60,18 @@ struct _snd_timer_hardware {
unsigned long resolution_max; /* maximal resolution */
unsigned long ticks; /* max timer ticks per interrupt */
/* -- low-level functions -- */
int (*open) (snd_timer_t * timer);
int (*close) (snd_timer_t * timer);
unsigned long (*c_resolution) (snd_timer_t * timer);
int (*start) (snd_timer_t * timer);
int (*stop) (snd_timer_t * timer);
int (*set_period) (snd_timer_t * timer, unsigned long period_num, unsigned long period_den);
int (*precise_resolution) (snd_timer_t * timer, unsigned long *num, unsigned long *den);
int (*open) (struct snd_timer * timer);
int (*close) (struct snd_timer * timer);
unsigned long (*c_resolution) (struct snd_timer * timer);
int (*start) (struct snd_timer * timer);
int (*stop) (struct snd_timer * timer);
int (*set_period) (struct snd_timer * timer, unsigned long period_num, unsigned long period_den);
int (*precise_resolution) (struct snd_timer * timer, unsigned long *num, unsigned long *den);
};
struct _snd_timer {
snd_timer_class_t tmr_class;
snd_card_t *card;
struct snd_timer {
int tmr_class;
struct snd_card *card;
struct module *module;
int tmr_device;
int tmr_subdevice;
......@@ -97,8 +81,8 @@ struct _snd_timer {
int running; /* running instances */
unsigned long sticks; /* schedule ticks */
void *private_data;
void (*private_free) (snd_timer_t *timer);
struct _snd_timer_hardware hw;
void (*private_free) (struct snd_timer *timer);
struct snd_timer_hardware hw;
spinlock_t lock;
struct list_head device_list;
struct list_head open_list_head;
......@@ -108,49 +92,53 @@ struct _snd_timer {
struct tasklet_struct task_queue;
};
struct _snd_timer_instance {
snd_timer_t * timer;
struct snd_timer_instance {
struct snd_timer *timer;
char *owner;
unsigned int flags;
void *private_data;
void (*private_free) (snd_timer_instance_t *ti);
snd_timer_callback_t callback;
snd_timer_ccallback_t ccallback;
void (*private_free) (struct snd_timer_instance *ti);
void (*callback) (struct snd_timer_instance *timeri,
unsigned long ticks, unsigned long resolution);
void (*ccallback) (struct snd_timer_instance * timeri,
int event,
struct timespec * tstamp,
unsigned long resolution);
void *callback_data;
unsigned long ticks; /* auto-load ticks when expired */
unsigned long cticks; /* current ticks */
unsigned long pticks; /* accumulated ticks for callback */
unsigned long resolution; /* current resolution for tasklet */
unsigned long lost; /* lost ticks */
snd_timer_slave_class_t slave_class;
int slave_class;
unsigned int slave_id;
struct list_head open_list;
struct list_head active_list;
struct list_head ack_list;
struct list_head slave_list_head;
struct list_head slave_active_head;
snd_timer_instance_t *master;
struct snd_timer_instance *master;
};
/*
* Registering
*/
extern int snd_timer_new(snd_card_t *card, char *id, snd_timer_id_t *tid, snd_timer_t ** rtimer);
extern void snd_timer_notify(snd_timer_t *timer, enum sndrv_timer_event event, struct timespec *tstamp);
extern int snd_timer_global_new(char *id, int device, snd_timer_t **rtimer);
extern int snd_timer_global_free(snd_timer_t *timer);
extern int snd_timer_global_register(snd_timer_t *timer);
extern int snd_timer_global_unregister(snd_timer_t *timer);
extern int snd_timer_open(snd_timer_instance_t ** ti, char *owner, snd_timer_id_t *tid, unsigned int slave_id);
extern int snd_timer_close(snd_timer_instance_t * timeri);
extern unsigned long snd_timer_resolution(snd_timer_instance_t * timeri);
extern int snd_timer_start(snd_timer_instance_t * timeri, unsigned int ticks);
extern int snd_timer_stop(snd_timer_instance_t * timeri);
extern int snd_timer_continue(snd_timer_instance_t * timeri);
extern int snd_timer_pause(snd_timer_instance_t * timeri);
extern void snd_timer_interrupt(snd_timer_t * timer, unsigned long ticks_left);
int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid, struct snd_timer **rtimer);
void snd_timer_notify(struct snd_timer *timer, int event, struct timespec *tstamp);
int snd_timer_global_new(char *id, int device, struct snd_timer **rtimer);
int snd_timer_global_free(struct snd_timer *timer);
int snd_timer_global_register(struct snd_timer *timer);
int snd_timer_global_unregister(struct snd_timer *timer);
int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id);
int snd_timer_close(struct snd_timer_instance *timeri);
unsigned long snd_timer_resolution(struct snd_timer_instance *timeri);
int snd_timer_start(struct snd_timer_instance *timeri, unsigned int ticks);
int snd_timer_stop(struct snd_timer_instance *timeri);
int snd_timer_continue(struct snd_timer_instance *timeri);
int snd_timer_pause(struct snd_timer_instance *timeri);
void snd_timer_interrupt(struct snd_timer *timer, unsigned long ticks_left);
#endif /* __SOUND_TIMER_H */
......@@ -40,16 +40,16 @@
/*
* prototypes
*/
static int rtctimer_open(snd_timer_t *t);
static int rtctimer_close(snd_timer_t *t);
static int rtctimer_start(snd_timer_t *t);
static int rtctimer_stop(snd_timer_t *t);
static int rtctimer_open(struct snd_timer *t);
static int rtctimer_close(struct snd_timer *t);
static int rtctimer_start(struct snd_timer *t);
static int rtctimer_stop(struct snd_timer *t);
/*
* 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,
.ticks = 100000000L, /* FIXME: XXX */
.open = rtctimer_open,
......@@ -59,12 +59,12 @@ static struct _snd_timer_hardware rtc_hw = {
};
static int rtctimer_freq = RTC_FREQ; /* frequency */
static snd_timer_t *rtctimer;
static struct snd_timer *rtctimer;
static rtc_task_t rtc_task;
static int
rtctimer_open(snd_timer_t *t)
rtctimer_open(struct snd_timer *t)
{
int err;
......@@ -76,7 +76,7 @@ rtctimer_open(snd_timer_t *t)
}
static int
rtctimer_close(snd_timer_t *t)
rtctimer_close(struct snd_timer *t)
{
rtc_task_t *rtc = t->private_data;
if (rtc) {
......@@ -87,7 +87,7 @@ rtctimer_close(snd_timer_t *t)
}
static int
rtctimer_start(snd_timer_t *timer)
rtctimer_start(struct snd_timer *timer)
{
rtc_task_t *rtc = timer->private_data;
snd_assert(rtc != NULL, return -EINVAL);
......@@ -97,7 +97,7 @@ rtctimer_start(snd_timer_t *timer)
}
static int
rtctimer_stop(snd_timer_t *timer)
rtctimer_stop(struct snd_timer *timer)
{
rtc_task_t *rtc = timer->private_data;
snd_assert(rtc != NULL, return -EINVAL);
......@@ -120,7 +120,7 @@ static void rtctimer_interrupt(void *private_data)
static int __init rtctimer_init(void)
{
int err;
snd_timer_t *timer;
struct snd_timer *timer;
if (rtctimer_freq < 2 || rtctimer_freq > 8192 ||
(rtctimer_freq & (rtctimer_freq - 1)) != 0) {
......
此差异已折叠。
......@@ -22,7 +22,7 @@
#include <linux/compat.h>
struct sndrv_timer_info32 {
struct snd_timer_info32 {
u32 flags;
s32 card;
unsigned char id[64];
......@@ -33,11 +33,11 @@ struct sndrv_timer_info32 {
};
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 sndrv_timer_info32 info;
snd_timer_t *t;
struct snd_timer_user *tu;
struct snd_timer_info32 info;
struct snd_timer *t;
tu = file->private_data;
snd_assert(tu->timeri != NULL, return -ENXIO);
......@@ -55,7 +55,7 @@ static int snd_timer_user_info_compat(struct file *file,
return 0;
}
struct sndrv_timer_status32 {
struct snd_timer_status32 {
struct compat_timespec tstamp;
u32 resolution;
u32 lost;
......@@ -65,10 +65,10 @@ struct sndrv_timer_status32 {
};
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;
snd_timer_status_t status;
struct snd_timer_user *tu;
struct snd_timer_status status;
tu = file->private_data;
snd_assert(tu->timeri != NULL, return -ENXIO);
......@@ -89,8 +89,8 @@ static int snd_timer_user_status_compat(struct file *file,
*/
enum {
SNDRV_TIMER_IOCTL_INFO32 = _IOR('T', 0x11, struct sndrv_timer_info32),
SNDRV_TIMER_IOCTL_STATUS32 = _IOW('T', 0x14, struct sndrv_timer_status32),
SNDRV_TIMER_IOCTL_INFO32 = _IOR('T', 0x11, struct snd_timer_info32),
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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册