usb: gadget: build audio_source function only if SND is enabled
authorAmit Pundir <amit.pundir@linaro.org>
Thu, 29 Oct 2015 21:30:20 +0000 (03:00 +0530)
committerJohn Stultz <john.stultz@linaro.org>
Tue, 16 Feb 2016 21:52:15 +0000 (13:52 -0800)
commitc886eb3e71d67ad2e1231158e44d3880e3821275
treedbac14e64ba4f6c0d9a276c1607e0bfb570f4ade
parentfcabd00b4177edfcfd17606b268e10602267ba86
usb: gadget: build audio_source function only if SND is enabled

Also select SND_PCM while building f_audio_source
otherwise we run into following build error:

  LD      init/built-in.o
drivers/built-in.o: In function `audio_data_complete':
/linaro/android/kernel/linaro-android/drivers/usb/gadget/function/f_audio_source.c:458: undefined reference to `snd_pcm_period_elapsed'
drivers/built-in.o: In function `audio_pcm_hw_free':
/linaro/android/kernel/linaro-android/drivers/usb/gadget/function/f_audio_source.c:770: undefined reference to `snd_pcm_lib_free_vmalloc_buffer'
drivers/built-in.o: In function `snd_pcm_lib_alloc_vmalloc_buffer':
/linaro/android/kernel/linaro-android/include/sound/pcm.h:1179: undefined reference to `_snd_pcm_lib_alloc_vmalloc_buffer'
drivers/built-in.o: In function `audio_pcm_open':
/linaro/android/kernel/linaro-android/drivers/usb/gadget/function/f_audio_source.c:734: undefined reference to `snd_pcm_limit_hw_rates'
drivers/built-in.o: In function `snd_card_setup':
/linaro/android/kernel/linaro-android/drivers/usb/gadget/function/f_audio_source.c:888: undefined reference to `snd_pcm_new'
/linaro/android/kernel/linaro-android/drivers/usb/gadget/function/f_audio_source.c:898: undefined reference to `snd_pcm_set_ops'
/linaro/android/kernel/linaro-android/drivers/usb/gadget/function/f_audio_source.c:899: undefined reference to `snd_pcm_lib_preallocate_pages_for_all'
drivers/built-in.o:(.data+0x1fd28): undefined reference to `snd_pcm_lib_ioctl'
make: *** [vmlinux] Error 1

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
drivers/usb/gadget/Kconfig