aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-12-01 04:51:58 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:30:10 -0500
commit59d48582508c6e3ed6f60bdd7d13e3e2893416b4 (patch)
treee52ecc173a4f44d1a225e6a4abc1ad842fd38deb /sound/core
parentadf1b3d25e50dbab48fdd21006bea2dd5a4cb3a8 (diff)
[ALSA] pcm - Make the support of old API selectable
Modules: ALSA Core,PCM Midlevel Make the support of old API selectable via config option. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/Kconfig8
-rw-r--r--sound/core/pcm_native.c6
2 files changed, 14 insertions, 0 deletions
diff --git a/sound/core/Kconfig b/sound/core/Kconfig
index 83cbe20c9c9..f79755f77a8 100644
--- a/sound/core/Kconfig
+++ b/sound/core/Kconfig
@@ -122,6 +122,14 @@ config SND_DYNAMIC_MINORS
122 122
123 If you are unsure about this, say N here. 123 If you are unsure about this, say N here.
124 124
125config SND_SUPPORT_OLD_API
126 bool "Support old ALSA API"
127 depends on SND
128 default y
129 help
130 Say Y here to support the obsolete ALSA PCM API (ver.0.9.0 rc3
131 or older).
132
125config SND_VERBOSE_PRINTK 133config SND_VERBOSE_PRINTK
126 bool "Verbose printk" 134 bool "Verbose printk"
127 depends on SND 135 depends on SND
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 9010306bcea..f3d5de7b55a 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -55,6 +55,7 @@ struct snd_pcm_hw_params_old {
55 unsigned char reserved[64]; 55 unsigned char reserved[64];
56}; 56};
57 57
58#ifdef CONFIG_SND_SUPPORT_OLD_API
58#define SNDRV_PCM_IOCTL_HW_REFINE_OLD _IOWR('A', 0x10, struct snd_pcm_hw_params_old) 59#define SNDRV_PCM_IOCTL_HW_REFINE_OLD _IOWR('A', 0x10, struct snd_pcm_hw_params_old)
59#define SNDRV_PCM_IOCTL_HW_PARAMS_OLD _IOWR('A', 0x11, struct snd_pcm_hw_params_old) 60#define SNDRV_PCM_IOCTL_HW_PARAMS_OLD _IOWR('A', 0x11, struct snd_pcm_hw_params_old)
60 61
@@ -62,6 +63,7 @@ static int snd_pcm_hw_refine_old_user(struct snd_pcm_substream *substream,
62 struct snd_pcm_hw_params_old __user * _oparams); 63 struct snd_pcm_hw_params_old __user * _oparams);
63static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream, 64static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream,
64 struct snd_pcm_hw_params_old __user * _oparams); 65 struct snd_pcm_hw_params_old __user * _oparams);
66#endif
65static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream); 67static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream);
66 68
67/* 69/*
@@ -2527,10 +2529,12 @@ static int snd_pcm_common_ioctl1(struct snd_pcm_substream *substream,
2527 return snd_pcm_delay(substream, arg); 2529 return snd_pcm_delay(substream, arg);
2528 case SNDRV_PCM_IOCTL_SYNC_PTR: 2530 case SNDRV_PCM_IOCTL_SYNC_PTR:
2529 return snd_pcm_sync_ptr(substream, arg); 2531 return snd_pcm_sync_ptr(substream, arg);
2532#ifdef CONFIG_SND_SUPPORT_OLD_API
2530 case SNDRV_PCM_IOCTL_HW_REFINE_OLD: 2533 case SNDRV_PCM_IOCTL_HW_REFINE_OLD:
2531 return snd_pcm_hw_refine_old_user(substream, arg); 2534 return snd_pcm_hw_refine_old_user(substream, arg);
2532 case SNDRV_PCM_IOCTL_HW_PARAMS_OLD: 2535 case SNDRV_PCM_IOCTL_HW_PARAMS_OLD:
2533 return snd_pcm_hw_params_old_user(substream, arg); 2536 return snd_pcm_hw_params_old_user(substream, arg);
2537#endif
2534 case SNDRV_PCM_IOCTL_DRAIN: 2538 case SNDRV_PCM_IOCTL_DRAIN:
2535 return snd_pcm_drain(substream); 2539 return snd_pcm_drain(substream);
2536 case SNDRV_PCM_IOCTL_DROP: 2540 case SNDRV_PCM_IOCTL_DROP:
@@ -3270,6 +3274,7 @@ static int snd_pcm_fasync(int fd, struct file * file, int on)
3270 * To be removed helpers to keep binary compatibility 3274 * To be removed helpers to keep binary compatibility
3271 */ 3275 */
3272 3276
3277#ifdef CONFIG_SND_SUPPORT_OLD_API
3273#define __OLD_TO_NEW_MASK(x) ((x&7)|((x&0x07fffff8)<<5)) 3278#define __OLD_TO_NEW_MASK(x) ((x&7)|((x&0x07fffff8)<<5))
3274#define __NEW_TO_OLD_MASK(x) ((x&7)|((x&0xffffff00)>>5)) 3279#define __NEW_TO_OLD_MASK(x) ((x&7)|((x&0xffffff00)>>5))
3275 3280
@@ -3379,6 +3384,7 @@ out:
3379 kfree(oparams); 3384 kfree(oparams);
3380 return err; 3385 return err;
3381} 3386}
3387#endif /* CONFIG_SND_SUPPORT_OLD_API */
3382 3388
3383/* 3389/*
3384 * Register section 3390 * Register section