summaryrefslogtreecommitdiff
path: root/src/timer
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-01-26 10:50:28 +0000
committerTakashi Iwai <tiwai@suse.de>2005-01-26 10:50:28 +0000
commit77c925a71f32297f6504b2bdeb0ca4e721d0e9e9 (patch)
tree5b64ff4543ba3b15b24ddb40b85134669d2e623b /src/timer
parent7e74f2ef1ba28184b3a8a70f66ddbefa09434e0b (diff)
downloadalsa-lib-77c925a71f32297f6504b2bdeb0ca4e721d0e9e9.tar.gz
Add resmgr support
Added the support for resmgr. A new configure option --with-resmgr is added to enable the resmgr support.
Diffstat (limited to 'src/timer')
-rw-r--r--src/timer/timer_hw.c10
-rw-r--r--src/timer/timer_query_hw.c10
2 files changed, 18 insertions, 2 deletions
diff --git a/src/timer/timer_hw.c b/src/timer/timer_hw.c
index 2ea2aa98..d09c7a8f 100644
--- a/src/timer/timer_hw.c
+++ b/src/timer/timer_hw.c
@@ -27,6 +27,9 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include "timer_local.h"
+#ifdef SUPPORT_RESMGR
+#include <resmgr.h>
+#endif
#ifndef PIC
/* entry for static linking */
@@ -211,7 +214,12 @@ int snd_timer_hw_open(snd_timer_t **handle, const char *name, int dev_class, int
tmode = O_RDONLY;
if (mode & SND_TIMER_OPEN_NONBLOCK)
tmode |= O_NONBLOCK;
- if ((fd = open(SNDRV_FILE_TIMER, tmode)) < 0)
+#ifdef SUPPORT_RESMGR
+ fd = rsm_open_device(SNDRV_FILE_TIMER, tmode);
+#else
+ fd = open(SNDRV_FILE_TIMER, tmode);
+#endif
+ if (fd < 0)
return -errno;
#if 0
/*
diff --git a/src/timer/timer_query_hw.c b/src/timer/timer_query_hw.c
index 5f1e5b6a..cb0e03c8 100644
--- a/src/timer/timer_query_hw.c
+++ b/src/timer/timer_query_hw.c
@@ -26,6 +26,9 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#include "timer_local.h"
+#ifdef SUPPORT_RESMGR
+#include <resmgr.h>
+#endif
#ifndef PIC
/* entry for static linking */
@@ -99,7 +102,12 @@ int snd_timer_query_hw_open(snd_timer_query_t **handle, const char *name, int mo
tmode = O_RDONLY;
if (mode & SND_TIMER_OPEN_NONBLOCK)
tmode |= O_NONBLOCK;
- if ((fd = open(SNDRV_FILE_TIMER, tmode)) < 0)
+#ifdef SUPPORT_RESMGR
+ fd = rsm_open_device(SNDRV_FILE_TIMER, tmode);
+#else
+ fd = open(SNDRV_FILE_TIMER, tmode);
+#endif
+ if (fd < 0)
return -errno;
if (ioctl(fd, SNDRV_TIMER_IOCTL_PVERSION, &ver) < 0) {
close(fd);