aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-04-29 12:55:56 +0200
committerTakashi Iwai <tiwai@suse.de>2015-04-29 12:55:56 +0200
commit3ce338f02d15dfc32a2fa4d0f5a71df5cb796c1f (patch)
treec7365eb35df5c735a64c3fe9e9d8e8222251a7d4
parent111d9bf773cfcf2c6af4a036b067bc3f59bea03b (diff)
downloadhda-emu-3ce338f02d15dfc32a2fa4d0f5a71df5cb796c1f.tar.gz
Add support for the new jack API with two more arguments
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--configure.ac12
-rw-r--r--include/sound/jack.h5
-rw-r--r--snd-wrapper.c5
3 files changed, 22 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index f58a184..07f7917 100644
--- a/configure.ac
+++ b/configure.ac
@@ -605,4 +605,16 @@ if test "$HAVE_CODEC_USER_MUTEX" = "1"; then
AC_DEFINE(HAVE_CODEC_USER_MUTEX)
fi
+AC_MSG_CHECKING(for new jack API)
+NEW_JACK_API=
+if grep -q 'phantom_jack' dist/include/sound/jack.h; then
+ AC_MSG_RESULT(yes)
+ NEW_JACK_API=1
+else
+ AC_MSG_RESULT(no)
+fi
+if test "$NEW_JACK_API" = "1"; then
+ AC_DEFINE(NEW_JACK_API)
+fi
+
AC_OUTPUT(Makefile lib/Makefile kernel/Makefile include/Makefile)
diff --git a/include/sound/jack.h b/include/sound/jack.h
index d94b4e3..0e8ed57 100644
--- a/include/sound/jack.h
+++ b/include/sound/jack.h
@@ -39,8 +39,13 @@ struct snd_jack {
struct device;
+#ifdef NEW_JACK_API
+int snd_jack_new(struct snd_card *card, const char *id, int type,
+ struct snd_jack **jack, bool initial_kctl, bool phantom_jack);
+#else
int snd_jack_new(struct snd_card *card, const char *id, int type,
struct snd_jack **jack);
+#endif
void snd_jack_set_parent(struct snd_jack *jack, struct device *parent);
diff --git a/snd-wrapper.c b/snd-wrapper.c
index e98fc30..1bd629e 100644
--- a/snd-wrapper.c
+++ b/snd-wrapper.c
@@ -353,8 +353,13 @@ void *__hda_strdup(const char *str, const char *file, int line, int gfp)
/* jack API */
#include <sound/jack.h>
+#ifdef NEW_JACK_API
+int snd_jack_new(struct snd_card *card, const char *id, int type,
+ struct snd_jack **jack, bool initial_kctl, bool phantom_jack)
+#else
int snd_jack_new(struct snd_card *card, const char *id, int type,
struct snd_jack **jack)
+#endif
{
struct snd_jack *jp;