aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-10-24 16:26:28 +0200
committerTakashi Iwai <tiwai@suse.de>2018-10-24 16:26:28 +0200
commit05438c09124ec2bf62a1c0317905dcef0cbfe5c5 (patch)
treefa729fe629bf6f8456dbec4f498018e5aa104793
parent930cbf43864c1f1d364108a28844737d2a6d27b1 (diff)
downloadhda-emu-05438c09124ec2bf62a1c0317905dcef0cbfe5c5.tar.gz
Fix the build with 4.20
hda_codec.h is moved to the common include/sound, so we need to add the check in configure script and change the relevant codes accordingly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--.gitignore1
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac57
-rw-r--r--hda-decode-pincfg.c2
-rw-r--r--hda-emu.c4
-rw-r--r--hda_own_proc.c2
-rw-r--r--include/asm/io.h1
-rw-r--r--include/sound/hda_i915.h2
-rw-r--r--kernel/Makefile.am2
-rw-r--r--lib/Makefile.am2
-rw-r--r--misc_wrapper.c2
-rw-r--r--snd-wrapper.c2
12 files changed, 47 insertions, 32 deletions
diff --git a/.gitignore b/.gitignore
index 763df25..e18f201 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,6 +20,7 @@ config.status
config.sub
configure
depcomp
+include/sound/hda_codec.h
install-sh
libtool
ltmain.sh
diff --git a/Makefile.am b/Makefile.am
index 30f8ce7..cad6b97 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -22,7 +22,7 @@ hda_encode_verb_SOURCES =
hda_decode_pincfg_SOURCES = hda-decode-pincfg.c hda-log.c
hda_encode_pincfg_SOURCES =
-INCLUDES = -I$(top_srcdir)/include
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/dist/include
EXTRA_DIST = README AUTHORS codecs/*
diff --git a/configure.ac b/configure.ac
index d10d6c7..4d6e564 100644
--- a/configure.ac
+++ b/configure.ac
@@ -150,9 +150,20 @@ cat hda/*_*.c | grep '^module_hda_codec_driver(' | \
echo '}' >> kernel/init_hooks.h
+AC_MSG_CHECKING(for local hda_codec.h)
+if test -f hda/hda_codec.h; then
+ AC_MSG_RESULT(yes)
+ rm -f include/sound/hda_codec.h
+ ln -s ../../hda/hda_codec.h include/sound/hda_codec.h
+else
+ AC_MSG_RESULT(no)
+ rm -f include/sound/hda_codec.h
+ ln -s ../../dist/include/sound/hda_codec.h include/sound/hda_codec.h
+fi
+
AC_MSG_CHECKING(for presence of power_save option)
HAVE_POWER_SAVE=
-if grep -q 'snd_hda_power_up' hda/hda_codec.h; then
+if grep -q 'snd_hda_power_up' include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_POWER_SAVE=1
else
@@ -179,7 +190,7 @@ fi
NEW_HDA_INFRA=
AC_MSG_CHECKING(for new hda structure)
-if grep -q hda_bus_template hda/hda_codec.h; then
+if grep -q hda_bus_template include/sound/hda_codec.h; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
@@ -190,7 +201,7 @@ if test "$NEW_HDA_INFRA" = "yes"; then
fi
AC_MSG_CHECKING(for hda_bus_ops)
-if grep -q 'struct hda_bus_ops ' hda/hda_codec.h; then
+if grep -q 'struct hda_bus_ops ' include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_BUS_OPS=yes
else
@@ -210,7 +221,7 @@ AC_TRY_COMPILE([
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
],[
extern struct hda_bus_ops *ops;
ops->command(NULL, 0, 0, 0, 0);
@@ -234,7 +245,7 @@ AC_TRY_COMPILE([
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
],[
extern struct hda_bus_ops *ops;
ops->pm_notify(NULL, 0);
@@ -258,7 +269,7 @@ AC_TRY_COMPILE([
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
],[
extern struct hda_bus_ops *ops;
ops->attach_pcm(NULL, NULL, NULL);
@@ -283,7 +294,7 @@ AC_TRY_COMPILE([
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
],[
extern struct hda_bus_ops *ops;
ops->get_response(NULL, 1);
@@ -315,7 +326,7 @@ AC_TRY_COMPILE([
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
],[
int err = snd_hda_codec_new(NULL, 0, NULL);
],
@@ -331,7 +342,7 @@ fi
HAVE_HDA_PATCH_LOADER=
if test "$OLD_HDA_CODEC_NEW" = "1"; then
AC_MSG_CHECKING(for hda-patch)
-if grep -q snd_hda_load_patch hda/hda_codec.h; then
+if grep -q snd_hda_load_patch include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_HDA_PATCH_LOADER=yes
AC_DEFINE(CONFIG_SND_HDA_RECONFIG)
@@ -355,7 +366,7 @@ AC_TRY_COMPILE([
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
],[
struct hda_pcm pcm;
pcm.pcm_type = 0;
@@ -370,7 +381,7 @@ if test "$OLD_HDA_PCM" = "1"; then
fi
AC_MSG_CHECKING(for hda-reconfigure)
-if grep -q snd_hda_codec_configure hda/hda_*.h; then
+if grep -q snd_hda_codec_configure hda/hda_*.h include/sound/hda_*.h; then
AC_MSG_RESULT(yes)
HAVE_RECONFIG=yes
AC_DEFINE(CONFIG_SND_HDA_RECONFIG)
@@ -381,7 +392,7 @@ fi
if test "$HAVE_RECONFIG" = "yes"; then
AC_MSG_CHECKING(for user pin configs)
- if grep -q user_pins hda/hda_codec.h; then
+ if grep -q user_pins include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_USER_PINCFGS)
else
@@ -411,7 +422,7 @@ AC_TRY_COMPILE([
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
],[
struct hda_codec codec;
codec.pin_amp_workaround = 1;
@@ -435,7 +446,7 @@ AC_TRY_COMPILE([
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
],[
struct hda_codec codec;
codec.function_id = 1;
@@ -449,7 +460,7 @@ if test "$HDA_CODEC_FUNCTION_ID" = "1"; then
AC_DEFINE(HDA_CODEC_FUNCTION_ID)
fi
-AC_MSG_CHECKING(for snd_ctl_boolean_mono_info definition)
+AC_MSG_CHECKING(for local snd_ctl_boolean_mono_info definition)
HAVE_BOOLEAN_INFO=
if grep -q snd_ctl_boolean_mono_info hda/hda_local.h; then
AC_MSG_RESULT(yes)
@@ -472,7 +483,7 @@ AC_TRY_COMPILE([
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
],[
snd_hda_suspend(NULL);
],
@@ -488,7 +499,7 @@ fi # !NEW_HDA_INFRA
HAVE_SND_HDA_JACK=
AC_MSG_CHECKING(for snd_hda_jack_xxx)
-if grep -q snd_hda_jack_free hda/hda_codec.h; then
+if grep -q snd_hda_jack_free include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_SND_HDA_JACK=yes
else
@@ -508,7 +519,7 @@ AC_TRY_COMPILE([
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
],[
struct hda_spdif_out *spdif = snd_hda_spdif_out_of_nid(0, 0);
],
@@ -532,7 +543,7 @@ AC_TRY_COMPILE([
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
],[
snd_hda_calc_stream_format(0, 0, 0, 0, 0);
],
@@ -556,7 +567,7 @@ AC_TRY_COMPILE([
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
],[
snd_hda_calc_stream_format(0, 0, 0, 0, 0, 0);
],
@@ -571,7 +582,7 @@ fi
HAVE_COMMON_PREPARE=
AC_MSG_CHECKING(for common snd_hda_codec_prepare/cleanup)
-if grep -q snd_hda_codec_prepare hda/hda_codec.h; then
+if grep -q snd_hda_codec_prepare include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_COMMON_PREPARE=yes
else
@@ -583,7 +594,7 @@ fi
AC_MSG_CHECKING(for snd_hda_codec_get_pincfg)
HAVE_SND_HDA_CODEC_GET_PINCFG=
-if grep -q 'snd_hda_codec_get_pincfg' hda/hda_codec.h; then
+if grep -q 'snd_hda_codec_get_pincfg' include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_SND_HDA_CODEC_GET_PINCFG=1
else
@@ -595,7 +606,7 @@ fi
AC_MSG_CHECKING(for codec user_mutex)
HAVE_CODEC_USER_MUTEX=
-if grep -q 'user_mutex' hda/hda_codec.h; then
+if grep -q 'user_mutex' include/sound/hda_codec.h; then
AC_MSG_RESULT(yes)
HAVE_CODEC_USER_MUTEX=1
else
diff --git a/hda-decode-pincfg.c b/hda-decode-pincfg.c
index 4e9a7a6..bc54682 100644
--- a/hda-decode-pincfg.c
+++ b/hda-decode-pincfg.c
@@ -29,7 +29,7 @@
#include "hda-types.h"
#include "hda-log.h"
#include <sound/core.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
enum { DECODE, ENCODE };
diff --git a/hda-emu.c b/hda-emu.c
index 60d33bc..3f0bad5 100644
--- a/hda-emu.c
+++ b/hda-emu.c
@@ -37,7 +37,7 @@
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
#include "hda/hda_local.h"
#ifdef HAVE_HDA_BEEP
#include "hda/hda_beep.h"
@@ -1130,11 +1130,13 @@ static void set_pincfg(struct xhda_codec *codec, int nid, int val, int user)
{
struct xhda_node *node;
+#ifdef HAVE_USER_PINCFGS
if (user) {
hda_log_set_user_pin_configs(nid, val);
hda_log(HDA_LOG_INFO, " User Pin 0x%02x to 0x%08x\n", nid, val);
return;
}
+#endif
node = find_node(codec, nid);
if (node) {
diff --git a/hda_own_proc.c b/hda_own_proc.c
index ae3ee15..429d496 100644
--- a/hda_own_proc.c
+++ b/hda_own_proc.c
@@ -29,7 +29,7 @@
#include <linux/init.h>
#include <sound/core.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
#include "hda/hda_local.h"
#include "hda-missing-const.h"
diff --git a/include/asm/io.h b/include/asm/io.h
new file mode 100644
index 0000000..2997587
--- /dev/null
+++ b/include/asm/io.h
@@ -0,0 +1 @@
+/* dummy */
diff --git a/include/sound/hda_i915.h b/include/sound/hda_i915.h
index 1579430..bf7ae13 100644
--- a/include/sound/hda_i915.h
+++ b/include/sound/hda_i915.h
@@ -1 +1 @@
-#include "../../dist/include/sound/hda_i915.h"
+#include_next <sound/hda_i915.h>
diff --git a/kernel/Makefile.am b/kernel/Makefile.am
index f9aea79..54ed0f4 100644
--- a/kernel/Makefile.am
+++ b/kernel/Makefile.am
@@ -76,7 +76,7 @@ libhda_a_SOURCES = hda_codec.c hda_generic.c misc_wrapper.c \
$(PATCHES) $(HELPERS)
noinst_HEADERS = init_hooks.h
-INCLUDES = -I$(top_srcdir)/include
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/dist/include
misc_wrapper.c: ../misc_wrapper.c
ln -s ../misc_wrapper.c
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 4719eaa..b15ac9e 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,4 +1,4 @@
noinst_LIBRARIES = libhdacore.a
libhdacore_a_SOURCES = hda_bus_type.c hdac_bus.c hdac_device.c hdac_sysfs.c \
hdac_regmap.c array.c hdac_stream.c hdmi_chmap.c
-INCLUDES = -I$(top_srcdir)/include
+INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/dist/include
diff --git a/misc_wrapper.c b/misc_wrapper.c
index c04d5bf..ad605ef 100644
--- a/misc_wrapper.c
+++ b/misc_wrapper.c
@@ -1,5 +1,5 @@
#include <sound/core.h>
-#include "../hda/hda_codec.h"
+#include <sound/hda_codec.h>
#include "../hda/hda_local.h"
#if defined(CONFIG_SND_HDA_POWER_SAVE) && defined(CONFIG_SND_HDA_HWDEP)
diff --git a/snd-wrapper.c b/snd-wrapper.c
index cc1df46..4badf25 100644
--- a/snd-wrapper.c
+++ b/snd-wrapper.c
@@ -25,7 +25,7 @@
#include <sound/core.h>
#include <sound/pcm.h>
#include <assert.h>
-#include "hda/hda_codec.h"
+#include <sound/hda_codec.h>
#include "hda-types.h"
#include "hda-log.h"