summaryrefslogtreecommitdiff
path: root/v4l/compat.h
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2007-08-16 14:38:46 -0700
committerTrent Piepho <xyzzy@speakeasy.org>2007-08-16 14:38:46 -0700
commitc1e12d920074b82dfca2b1c1c50176bc94629593 (patch)
tree7bad8d04d5a35ec8ebf257abd9ab38b64d05c8ca /v4l/compat.h
parent9c6700a30c3bdf29513d2821d725d25e728b9d68 (diff)
downloadmediapointer-dvb-s2-c1e12d920074b82dfca2b1c1c50176bc94629593.tar.gz
mediapointer-dvb-s2-c1e12d920074b82dfca2b1c1c50176bc94629593.tar.bz2
compat: ALSA compat code
From: Trent Piepho <xyzzy@speakeasy.org> Removed some ALSA compat code from bt87x and put it into compat.h, then use this code in cx88-alsa and saa7134-alsa to avoid lots and lots of #ifs. All the kernel version checks in cx88-alsa and saa7134 were off by one too, which is now fixed. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Diffstat (limited to 'v4l/compat.h')
-rw-r--r--v4l/compat.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/v4l/compat.h b/v4l/compat.h
index 1162dadac..3910ae2aa 100644
--- a/v4l/compat.h
+++ b/v4l/compat.h
@@ -399,6 +399,32 @@ static inline u8 v4l_compat_pci_rev(struct pci_dev *pci)
{ u8 rev; pci_read_config_byte(pci, PCI_REVISION_ID, &rev); return rev; }
#endif
+/* ALSA removed a bunch of typedefs and renamed some structs in 2.6.16 */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
+# ifdef __SOUND_CORE_H
+# define snd_card _snd_card /* struct _snd_card became struct snd_card */
+# define snd_pcm _snd_pcm
+# undef snd_device
+# define snd_device _snd_device
+# endif
+# ifdef __SOUND_PCM_H
+# define snd_pcm_substream _snd_pcm_substream
+# define snd_pcm_hardware _snd_pcm_hardware
+# define snd_pcm_runtime _snd_pcm_runtime
+# define snd_pcm_ops _snd_pcm_ops
+# endif
+# ifdef __SOUND_ASOUND_H
+# define snd_pcm_hw_params sndrv_pcm_hw_params
+# define snd_ctl_elem_info sndrv_ctl_elem_info
+# define snd_ctl_elem_value sndrv_ctl_elem_value
+# endif
+# ifdef __SOUND_CONTROL_H
+# undef snd_kcontrol
+# define snd_kcontrol _snd_kcontrol
+# define snd_kcontrol_new _snd_kcontrol_new
+# endif
+#endif
+
#endif
/*
* Local variables: