浏览代码

[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>
Takashi Iwai 19 年之前
父节点
当前提交
59d4858250
共有 2 个文件被更改,包括 14 次插入0 次删除
  1. 8 0
      sound/core/Kconfig
  2. 6 0
      sound/core/pcm_native.c

+ 8 - 0
sound/core/Kconfig

@@ -122,6 +122,14 @@ config SND_DYNAMIC_MINORS
 
 
 	  If you are unsure about this, say N here.
 	  If you are unsure about this, say N here.
 
 
+config SND_SUPPORT_OLD_API
+	bool "Support old ALSA API"
+	depends on SND
+	default y
+	help
+	  Say Y here to support the obsolete ALSA PCM API (ver.0.9.0 rc3
+	  or older).
+
 config SND_VERBOSE_PRINTK
 config SND_VERBOSE_PRINTK
 	bool "Verbose printk"
 	bool "Verbose printk"
 	depends on SND
 	depends on SND

+ 6 - 0
sound/core/pcm_native.c

@@ -55,6 +55,7 @@ struct snd_pcm_hw_params_old {
 	unsigned char reserved[64];
 	unsigned char reserved[64];
 };
 };
 
 
+#ifdef CONFIG_SND_SUPPORT_OLD_API
 #define SNDRV_PCM_IOCTL_HW_REFINE_OLD _IOWR('A', 0x10, struct snd_pcm_hw_params_old)
 #define SNDRV_PCM_IOCTL_HW_REFINE_OLD _IOWR('A', 0x10, struct snd_pcm_hw_params_old)
 #define SNDRV_PCM_IOCTL_HW_PARAMS_OLD _IOWR('A', 0x11, struct snd_pcm_hw_params_old)
 #define SNDRV_PCM_IOCTL_HW_PARAMS_OLD _IOWR('A', 0x11, struct snd_pcm_hw_params_old)
 
 
@@ -62,6 +63,7 @@ static int snd_pcm_hw_refine_old_user(struct snd_pcm_substream *substream,
 				      struct snd_pcm_hw_params_old __user * _oparams);
 				      struct snd_pcm_hw_params_old __user * _oparams);
 static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream,
 static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream,
 				      struct snd_pcm_hw_params_old __user * _oparams);
 				      struct snd_pcm_hw_params_old __user * _oparams);
+#endif
 static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream);
 static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream);
 
 
 /*
 /*
@@ -2527,10 +2529,12 @@ static int snd_pcm_common_ioctl1(struct snd_pcm_substream *substream,
 		return snd_pcm_delay(substream, arg);
 		return snd_pcm_delay(substream, arg);
 	case SNDRV_PCM_IOCTL_SYNC_PTR:
 	case SNDRV_PCM_IOCTL_SYNC_PTR:
 		return snd_pcm_sync_ptr(substream, arg);
 		return snd_pcm_sync_ptr(substream, arg);
+#ifdef CONFIG_SND_SUPPORT_OLD_API
 	case SNDRV_PCM_IOCTL_HW_REFINE_OLD:
 	case SNDRV_PCM_IOCTL_HW_REFINE_OLD:
 		return snd_pcm_hw_refine_old_user(substream, arg);
 		return snd_pcm_hw_refine_old_user(substream, arg);
 	case SNDRV_PCM_IOCTL_HW_PARAMS_OLD:
 	case SNDRV_PCM_IOCTL_HW_PARAMS_OLD:
 		return snd_pcm_hw_params_old_user(substream, arg);
 		return snd_pcm_hw_params_old_user(substream, arg);
+#endif
 	case SNDRV_PCM_IOCTL_DRAIN:
 	case SNDRV_PCM_IOCTL_DRAIN:
 		return snd_pcm_drain(substream);
 		return snd_pcm_drain(substream);
 	case SNDRV_PCM_IOCTL_DROP:
 	case SNDRV_PCM_IOCTL_DROP:
@@ -3270,6 +3274,7 @@ static int snd_pcm_fasync(int fd, struct file * file, int on)
  *  To be removed helpers to keep binary compatibility
  *  To be removed helpers to keep binary compatibility
  */
  */
 
 
+#ifdef CONFIG_SND_SUPPORT_OLD_API
 #define __OLD_TO_NEW_MASK(x) ((x&7)|((x&0x07fffff8)<<5))
 #define __OLD_TO_NEW_MASK(x) ((x&7)|((x&0x07fffff8)<<5))
 #define __NEW_TO_OLD_MASK(x) ((x&7)|((x&0xffffff00)>>5))
 #define __NEW_TO_OLD_MASK(x) ((x&7)|((x&0xffffff00)>>5))
 
 
@@ -3379,6 +3384,7 @@ out:
 	kfree(oparams);
 	kfree(oparams);
 	return err;
 	return err;
 }
 }
+#endif /* CONFIG_SND_SUPPORT_OLD_API */
 
 
 /*
 /*
  *  Register section
  *  Register section