greybus: audio: Build audio module conditionally
authorVaibhav Agarwal <vaibhav.agarwal@linaro.org>
Wed, 13 Jan 2016 21:07:49 +0000 (14:07 -0700)
committerGreg Kroah-Hartman <gregkh@google.com>
Thu, 14 Jan 2016 00:15:57 +0000 (16:15 -0800)
Added CONFIG_XXX flag check before compiling audio module.
Once we add dynamic DAI link registration from audio driver,
this check wil be required to avoid compilation failures with
other kernel revisions.

Also, renamed header file to better align with .c file name.

Signed-off-by: Vaibhav Agarwal <vaibhav.agarwal@linaro.org>
Signed-off-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/Makefile
drivers/staging/greybus/audio_codec.c
drivers/staging/greybus/audio_codec.h [moved from drivers/staging/greybus/audio.h with 97% similarity]

index 4ebdc6b..6759d68 100644 (file)
@@ -47,6 +47,9 @@ obj-m += gb-raw.o
 obj-m += gb-es2.o
 obj-m += gb-arche.o
 obj-m += gb-audio-codec.o
+ifeq ($(CONFIG_SND_SOC_DYNAMIC_DAILINK),y)
+ obj-m += gb-audio-codec.o
+endif
 obj-m += gb-camera.o
 obj-m += gb-audio-gb.o
 obj-m += gb-audio-apbridgea.o
index 2bc2309..826604a 100644 (file)
@@ -7,7 +7,7 @@
  */
 #include <linux/module.h>
 
-#include "audio.h"
+#include "audio_codec.h"
 
 static int gbcodec_event_spk(struct snd_soc_dapm_widget *w,
                                        struct snd_kcontrol *k, int event)
similarity index 97%
rename from drivers/staging/greybus/audio.h
rename to drivers/staging/greybus/audio_codec.h
index fca60af..f8597b3 100644 (file)
@@ -6,10 +6,8 @@
  * Released under the GPLv2 only.
  */
 
-#ifndef __LINUX_GBAUDIO_H
-#define __LINUX_GBAUDIO_H
-
-#ifdef __KERNEL__
+#ifndef __LINUX_GBAUDIO_CODEC_H
+#define __LINUX_GBAUDIO_CODEC_H
 
 #include <sound/soc.h>
 
@@ -145,5 +143,4 @@ extern int gb_audio_apbridgea_start_rx(struct gb_connection *connection,
 extern int gb_audio_apbridgea_stop_rx(struct gb_connection *connection,
                                      __u16 i2s_port);
 
-#endif /* __KERNEL__ */
-#endif /* __LINUX_GBAUDIO_H */
+#endif /* __LINUX_GBAUDIO_CODEC_H */