diff options
author | Takashi Iwai <tiwai@suse.de> | 2005-05-15 09:43:54 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2005-05-29 04:10:53 -0400 |
commit | 8c50b37c04a026ab6641ecb7eaf0fd479798e8b8 (patch) | |
tree | d4f6d64609ba587f94678d9765f2c2caff10494c | |
parent | 15790a6be14852850ee7cbd791225fa51750d8af (diff) |
[ALSA] Change some timer ioctls due to confliction
Timer Midlevel,ALSA Core
Change values of some timer ioctls to avoid confliction with FIO* ioctls.
The protocol version is increased to indicate this change.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | include/sound/asound.h | 11 | ||||
-rw-r--r-- | sound/core/timer.c | 11 | ||||
-rw-r--r-- | sound/core/timer_compat.c | 4 |
3 files changed, 21 insertions, 5 deletions
diff --git a/include/sound/asound.h b/include/sound/asound.h index 4321e92a7f8b..9974f83cca44 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
@@ -560,7 +560,7 @@ enum { | |||
560 | * Timer section - /dev/snd/timer | 560 | * Timer section - /dev/snd/timer |
561 | */ | 561 | */ |
562 | 562 | ||
563 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 3) | 563 | #define SNDRV_TIMER_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 4) |
564 | 564 | ||
565 | enum sndrv_timer_class { | 565 | enum sndrv_timer_class { |
566 | SNDRV_TIMER_CLASS_NONE = -1, | 566 | SNDRV_TIMER_CLASS_NONE = -1, |
@@ -673,10 +673,11 @@ enum { | |||
673 | SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct sndrv_timer_info), | 673 | SNDRV_TIMER_IOCTL_INFO = _IOR('T', 0x11, struct sndrv_timer_info), |
674 | SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct sndrv_timer_params), | 674 | SNDRV_TIMER_IOCTL_PARAMS = _IOW('T', 0x12, struct sndrv_timer_params), |
675 | SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct sndrv_timer_status), | 675 | SNDRV_TIMER_IOCTL_STATUS = _IOR('T', 0x14, struct sndrv_timer_status), |
676 | SNDRV_TIMER_IOCTL_START = _IO('T', 0x20), | 676 | /* The following four ioctls are changed since 1.0.9 due to confliction */ |
677 | SNDRV_TIMER_IOCTL_STOP = _IO('T', 0x21), | 677 | SNDRV_TIMER_IOCTL_START = _IO('T', 0xa0), |
678 | SNDRV_TIMER_IOCTL_CONTINUE = _IO('T', 0x22), | 678 | SNDRV_TIMER_IOCTL_STOP = _IO('T', 0xa1), |
679 | SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0x23), | 679 | SNDRV_TIMER_IOCTL_CONTINUE = _IO('T', 0xa2), |
680 | SNDRV_TIMER_IOCTL_PAUSE = _IO('T', 0xa3), | ||
680 | }; | 681 | }; |
681 | 682 | ||
682 | struct sndrv_timer_read { | 683 | struct sndrv_timer_read { |
diff --git a/sound/core/timer.c b/sound/core/timer.c index 48aebdf6550b..305e39d74092 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c | |||
@@ -1690,6 +1690,13 @@ static int snd_timer_user_pause(struct file *file) | |||
1690 | return (err = snd_timer_continue(tu->timeri)) < 0 ? err : 0; | 1690 | return (err = snd_timer_continue(tu->timeri)) < 0 ? err : 0; |
1691 | } | 1691 | } |
1692 | 1692 | ||
1693 | enum { | ||
1694 | SNDRV_TIMER_IOCTL_START_OLD = _IO('T', 0x20), | ||
1695 | SNDRV_TIMER_IOCTL_STOP_OLD = _IO('T', 0x21), | ||
1696 | SNDRV_TIMER_IOCTL_CONTINUE_OLD = _IO('T', 0x22), | ||
1697 | SNDRV_TIMER_IOCTL_PAUSE_OLD = _IO('T', 0x23), | ||
1698 | }; | ||
1699 | |||
1693 | static long snd_timer_user_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | 1700 | static long snd_timer_user_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
1694 | { | 1701 | { |
1695 | snd_timer_user_t *tu; | 1702 | snd_timer_user_t *tu; |
@@ -1734,12 +1741,16 @@ static long snd_timer_user_ioctl(struct file *file, unsigned int cmd, unsigned l | |||
1734 | case SNDRV_TIMER_IOCTL_STATUS: | 1741 | case SNDRV_TIMER_IOCTL_STATUS: |
1735 | return snd_timer_user_status(file, argp); | 1742 | return snd_timer_user_status(file, argp); |
1736 | case SNDRV_TIMER_IOCTL_START: | 1743 | case SNDRV_TIMER_IOCTL_START: |
1744 | case SNDRV_TIMER_IOCTL_START_OLD: | ||
1737 | return snd_timer_user_start(file); | 1745 | return snd_timer_user_start(file); |
1738 | case SNDRV_TIMER_IOCTL_STOP: | 1746 | case SNDRV_TIMER_IOCTL_STOP: |
1747 | case SNDRV_TIMER_IOCTL_STOP_OLD: | ||
1739 | return snd_timer_user_stop(file); | 1748 | return snd_timer_user_stop(file); |
1740 | case SNDRV_TIMER_IOCTL_CONTINUE: | 1749 | case SNDRV_TIMER_IOCTL_CONTINUE: |
1750 | case SNDRV_TIMER_IOCTL_CONTINUE_OLD: | ||
1741 | return snd_timer_user_continue(file); | 1751 | return snd_timer_user_continue(file); |
1742 | case SNDRV_TIMER_IOCTL_PAUSE: | 1752 | case SNDRV_TIMER_IOCTL_PAUSE: |
1753 | case SNDRV_TIMER_IOCTL_PAUSE_OLD: | ||
1743 | return snd_timer_user_pause(file); | 1754 | return snd_timer_user_pause(file); |
1744 | } | 1755 | } |
1745 | return -ENOTTY; | 1756 | return -ENOTTY; |
diff --git a/sound/core/timer_compat.c b/sound/core/timer_compat.c index 420817d10b7c..3de552dfe80f 100644 --- a/sound/core/timer_compat.c +++ b/sound/core/timer_compat.c | |||
@@ -106,9 +106,13 @@ static long snd_timer_user_ioctl_compat(struct file *file, unsigned int cmd, uns | |||
106 | case SNDRV_TIMER_IOCTL_SELECT: | 106 | case SNDRV_TIMER_IOCTL_SELECT: |
107 | case SNDRV_TIMER_IOCTL_PARAMS: | 107 | case SNDRV_TIMER_IOCTL_PARAMS: |
108 | case SNDRV_TIMER_IOCTL_START: | 108 | case SNDRV_TIMER_IOCTL_START: |
109 | case SNDRV_TIMER_IOCTL_START_OLD: | ||
109 | case SNDRV_TIMER_IOCTL_STOP: | 110 | case SNDRV_TIMER_IOCTL_STOP: |
111 | case SNDRV_TIMER_IOCTL_STOP_OLD: | ||
110 | case SNDRV_TIMER_IOCTL_CONTINUE: | 112 | case SNDRV_TIMER_IOCTL_CONTINUE: |
113 | case SNDRV_TIMER_IOCTL_CONTINUE_OLD: | ||
111 | case SNDRV_TIMER_IOCTL_PAUSE: | 114 | case SNDRV_TIMER_IOCTL_PAUSE: |
115 | case SNDRV_TIMER_IOCTL_PAUSE_OLD: | ||
112 | case SNDRV_TIMER_IOCTL_NEXT_DEVICE: | 116 | case SNDRV_TIMER_IOCTL_NEXT_DEVICE: |
113 | return snd_timer_user_ioctl(file, cmd, (unsigned long)argp); | 117 | return snd_timer_user_ioctl(file, cmd, (unsigned long)argp); |
114 | case SNDRV_TIMER_IOCTL_INFO32: | 118 | case SNDRV_TIMER_IOCTL_INFO32: |