Commit 59d48582508c6e3ed6f60bdd7d13e3e2893416b4

Authored by Takashi Iwai
Committed by Jaroslav Kysela
1 parent adf1b3d25e

[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>

Showing 2 changed files with 14 additions and 0 deletions Side-by-side Diff

... ... @@ -122,6 +122,14 @@
122 122  
123 123 If you are unsure about this, say N here.
124 124  
  125 +config 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 +
125 133 config SND_VERBOSE_PRINTK
126 134 bool "Verbose printk"
127 135 depends on SND
sound/core/pcm_native.c
... ... @@ -55,6 +55,7 @@
55 55 unsigned char reserved[64];
56 56 };
57 57  
  58 +#ifdef CONFIG_SND_SUPPORT_OLD_API
58 59 #define SNDRV_PCM_IOCTL_HW_REFINE_OLD _IOWR('A', 0x10, struct snd_pcm_hw_params_old)
59 60 #define SNDRV_PCM_IOCTL_HW_PARAMS_OLD _IOWR('A', 0x11, struct snd_pcm_hw_params_old)
60 61  
... ... @@ -62,6 +63,7 @@
62 63 struct snd_pcm_hw_params_old __user * _oparams);
63 64 static int snd_pcm_hw_params_old_user(struct snd_pcm_substream *substream,
64 65 struct snd_pcm_hw_params_old __user * _oparams);
  66 +#endif
65 67 static int snd_pcm_open(struct file *file, struct snd_pcm *pcm, int stream);
66 68  
67 69 /*
68 70  
... ... @@ -2527,10 +2529,12 @@
2527 2529 return snd_pcm_delay(substream, arg);
2528 2530 case SNDRV_PCM_IOCTL_SYNC_PTR:
2529 2531 return snd_pcm_sync_ptr(substream, arg);
  2532 +#ifdef CONFIG_SND_SUPPORT_OLD_API
2530 2533 case SNDRV_PCM_IOCTL_HW_REFINE_OLD:
2531 2534 return snd_pcm_hw_refine_old_user(substream, arg);
2532 2535 case SNDRV_PCM_IOCTL_HW_PARAMS_OLD:
2533 2536 return snd_pcm_hw_params_old_user(substream, arg);
  2537 +#endif
2534 2538 case SNDRV_PCM_IOCTL_DRAIN:
2535 2539 return snd_pcm_drain(substream);
2536 2540 case SNDRV_PCM_IOCTL_DROP:
... ... @@ -3270,6 +3274,7 @@
3270 3274 * To be removed helpers to keep binary compatibility
3271 3275 */
3272 3276  
  3277 +#ifdef CONFIG_SND_SUPPORT_OLD_API
3273 3278 #define __OLD_TO_NEW_MASK(x) ((x&7)|((x&0x07fffff8)<<5))
3274 3279 #define __NEW_TO_OLD_MASK(x) ((x&7)|((x&0xffffff00)>>5))
3275 3280  
... ... @@ -3379,6 +3384,7 @@
3379 3384 kfree(oparams);
3380 3385 return err;
3381 3386 }
  3387 +#endif /* CONFIG_SND_SUPPORT_OLD_API */
3382 3388  
3383 3389 /*
3384 3390 * Register section