aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-10-10 05:49:49 -0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 07:17:47 -0500
commit07799e756c76ecd52cb01a812ba48b7d8ac67633 (patch)
tree5b6a006d90e631e6b70264aba355314a7cedbbe5 /include
parent7c22f1aaa23370bf9ba2dd3abbccbed70dced216 (diff)
[ALSA] Use getnstimeofday()
Modules: Documentation,PCM Midlevel,Timer Midlevel,ALSA Core Use the standard getnstimeofday() function instead of ALSA's own one. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/sound/core.h23
-rw-r--r--include/sound/pcm.h3
2 files changed, 1 insertions, 25 deletions
diff --git a/include/sound/core.h b/include/sound/core.h
index f0f54407fe5c..fa8f4c9492cc 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -29,7 +29,6 @@
29#include <linux/pm.h> /* pm_message_t */ 29#include <linux/pm.h> /* pm_message_t */
30 30
31/* Typedef's */ 31/* Typedef's */
32typedef struct timespec snd_timestamp_t;
33typedef struct sndrv_interval snd_interval_t; 32typedef struct sndrv_interval snd_interval_t;
34typedef enum sndrv_card_type snd_card_type; 33typedef enum sndrv_card_type snd_card_type;
35typedef struct sndrv_xferi snd_xferi_t; 34typedef struct sndrv_xferi snd_xferi_t;
@@ -464,28 +463,6 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...)
464#endif 463#endif
465 464
466 465
467static inline void snd_timestamp_now(struct timespec *tstamp, int timespec)
468{
469 struct timeval val;
470 /* FIXME: use a linear time source */
471 do_gettimeofday(&val);
472 tstamp->tv_sec = val.tv_sec;
473 tstamp->tv_nsec = val.tv_usec;
474 if (timespec)
475 tstamp->tv_nsec *= 1000L;
476}
477
478static inline void snd_timestamp_zero(struct timespec *tstamp)
479{
480 tstamp->tv_sec = 0;
481 tstamp->tv_nsec = 0;
482}
483
484static inline int snd_timestamp_null(struct timespec *tstamp)
485{
486 return tstamp->tv_sec == 0 && tstamp->tv_nsec == 0;
487}
488
489#define SNDRV_OSS_VERSION ((3<<16)|(8<<8)|(1<<4)|(0)) /* 3.8.1a */ 466#define SNDRV_OSS_VERSION ((3<<16)|(8<<8)|(1<<4)|(0)) /* 3.8.1a */
490 467
491/* for easier backward-porting */ 468/* for easier backward-porting */
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 2b23a5967071..acc4fa9d5abe 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -281,7 +281,7 @@ typedef struct {
281struct _snd_pcm_runtime { 281struct _snd_pcm_runtime {
282 /* -- Status -- */ 282 /* -- Status -- */
283 snd_pcm_substream_t *trigger_master; 283 snd_pcm_substream_t *trigger_master;
284 snd_timestamp_t trigger_tstamp; /* trigger timestamp */ 284 struct timespec trigger_tstamp; /* trigger timestamp */
285 int overrange; 285 int overrange;
286 snd_pcm_uframes_t avail_max; 286 snd_pcm_uframes_t avail_max;
287 snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ 287 snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */
@@ -306,7 +306,6 @@ struct _snd_pcm_runtime {
306 unsigned int rate_den; 306 unsigned int rate_den;
307 307
308 /* -- SW params -- */ 308 /* -- SW params -- */
309 int tstamp_timespec; /* use timeval (0) or timespec (1) */
310 snd_pcm_tstamp_t tstamp_mode; /* mmap timestamp is updated */ 309 snd_pcm_tstamp_t tstamp_mode; /* mmap timestamp is updated */
311 unsigned int period_step; 310 unsigned int period_step;
312 unsigned int sleep_min; /* min ticks to sleep */ 311 unsigned int sleep_min; /* min ticks to sleep */