greybus: audio: Build audio module conditionally

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>
This commit is contained in:
Vaibhav Agarwal
2016-01-13 14:07:49 -07:00
committed by Greg Kroah-Hartman
parent 8db00736d3
commit 7885342cc2
3 changed files with 7 additions and 7 deletions

View 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

View 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)

View 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 */