linux/include/sound/timer.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
#ifndef __SOUND_TIMER_H
#define __SOUND_TIMER_H

/*
 *  Timer abstract layer
 *  Copyright (c) by Jaroslav Kysela <[email protected]>,
 *		     Abramo Bagnara <[email protected]>
 */

#include <sound/asound.h>
#include <linux/interrupt.h>

#define snd_timer_chip(timer)

#define SNDRV_TIMER_DEVICES

#define SNDRV_TIMER_DEV_FLG_PCM

#define SNDRV_TIMER_HW_AUTO
#define SNDRV_TIMER_HW_STOP
#define SNDRV_TIMER_HW_SLAVE
#define SNDRV_TIMER_HW_FIRST
#define SNDRV_TIMER_HW_WORK

#define SNDRV_TIMER_IFLG_SLAVE
#define SNDRV_TIMER_IFLG_RUNNING
#define SNDRV_TIMER_IFLG_START
#define SNDRV_TIMER_IFLG_AUTO
#define SNDRV_TIMER_IFLG_FAST
#define SNDRV_TIMER_IFLG_CALLBACK
#define SNDRV_TIMER_IFLG_EXCLUSIVE
#define SNDRV_TIMER_IFLG_EARLY_EVENT

#define SNDRV_TIMER_FLG_CHANGE
#define SNDRV_TIMER_FLG_RESCHED

struct snd_timer;

struct snd_timer_hardware {};

struct snd_timer {};

struct snd_timer_instance {};

/*
 *  Registering
 */

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 timespec64 *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);

struct snd_timer_instance *snd_timer_instance_new(const char *owner);
void snd_timer_instance_free(struct snd_timer_instance *timeri);
int snd_timer_open(struct snd_timer_instance *timeri, struct snd_timer_id *tid, unsigned int slave_id);
void 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 */