aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-23 14:36:27 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-23 14:36:27 +0100
commit2297e15ab1cb5d5408e64b93018e491ea50d3bf8 (patch)
tree372dd1856e696844b8f065e1d9a5515bb819f336
parentb1a30c35276447304bcb521717b132b6fff0a698 (diff)
downloadhda-emu-2297e15ab1cb5d5408e64b93018e491ea50d3bf8.tar.gz
Fix the build with old kernels
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--configure.ac2
-rw-r--r--hda-emu.c7
-rw-r--r--kernel/Makefile.am7
-rw-r--r--snd-wrapper.c7
4 files changed, 21 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index fecbb3a..c7172cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,6 +115,8 @@ AC_DEFUN([CHECK_HELPER], [
CHECK_HELPER([hda_auto_parser.c], [HAVE_HDA_AUTO_PARSER])
CHECK_HELPER([hda_jack.c], [HAVE_HDA_JACK])
+CHECK_HELPER([hda_eld.c], [HAVE_HDA_ELD])
+CHECK_HELPER([hda_beep.c], [HAVE_HDA_BEEP])
AC_ARG_ENABLE(own-proc,
AS_HELP_STRING([--enable-own-proc],
diff --git a/hda-emu.c b/hda-emu.c
index 0445ce8..1e9776a 100644
--- a/hda-emu.c
+++ b/hda-emu.c
@@ -39,7 +39,9 @@
#include <sound/pcm.h>
#include "hda/hda_codec.h"
#include "hda/hda_local.h"
+#ifdef HAVE_HDA_BEEP
#include "hda/hda_beep.h"
+#endif
#ifndef HAVE_POWER_SAVE
#define snd_hda_power_up(x)
@@ -1054,6 +1056,7 @@ static int override_pincfg(struct xhda_codec *codec, char *pincfg)
static int load_init_hints(struct xhda_codec *codec, char *hints)
{
+#ifdef CONFIG_SND_HDA_RECONFIG
FILE *fp;
char buf[256];
struct xhda_sysfs_list *sys;
@@ -1080,6 +1083,10 @@ static int load_init_hints(struct xhda_codec *codec, char *hints)
_parse_hints(_codec, buf);
fclose(fp);
return 0;
+#else
+ hda_log(HDA_LOG_ERR, "-H option isn't supported for this kernel\n");
+ return -EINVAL;
+#endif
}
/*
diff --git a/kernel/Makefile.am b/kernel/Makefile.am
index 59bc8db..41203b5 100644
--- a/kernel/Makefile.am
+++ b/kernel/Makefile.am
@@ -58,9 +58,12 @@ if HAVE_HDA_JACK
HELPERS += hda_jack.c
endif
+if HAVE_HDA_ELD
+HELPERS += hda_eld.c
+endif
+
noinst_LIBRARIES = libhda.a
-libhda_a_SOURCES = hda_codec.c hda_generic.c \
- hda_eld.c misc_wrapper.c \
+libhda_a_SOURCES = hda_codec.c hda_generic.c misc_wrapper.c \
$(PATCHES) $(HELPERS)
noinst_HEADERS = init_hooks.h
diff --git a/snd-wrapper.c b/snd-wrapper.c
index ebca9f0..78ed28f 100644
--- a/snd-wrapper.c
+++ b/snd-wrapper.c
@@ -45,6 +45,8 @@ int snd_pcm_format_width(int format)
}
}
+#ifdef CONFIG_SND_HDA_RECONFIG
+
/* hint string pair */
struct hda_hint {
const char *key;
@@ -192,14 +194,19 @@ int snd_hda_get_int_hint(struct hda_codec *codec, const char *key, int *valp)
return ret;
}
+#endif /* CONFIG_SND_HDA_RECONFIG */
+
int snd_hda_create_hwdep(struct hda_codec *codec)
{
+#ifdef CONFIG_SND_HDA_RECONFIG
+
#ifdef HAVE_CODEC_USER_MUTEX
mutex_init(&codec->user_mutex);
#endif
snd_array_init(&codec->init_verbs, sizeof(struct hda_verb), 32);
snd_array_init(&codec->hints, sizeof(struct hda_hint), 32);
snd_array_init(&codec->user_pins, sizeof(struct hda_pincfg), 16);
+#endif /* CONFIG_SND_HDA_RECONFIG */
return 0;
}