From c886eb3e71d67ad2e1231158e44d3880e3821275 Mon Sep 17 00:00:00 2001 From: Amit Pundir Date: Fri, 30 Oct 2015 03:00:20 +0530 Subject: [PATCH] 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 --- drivers/usb/gadget/Kconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 221f2c50d7e2..5cf6802b02ae 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -407,6 +407,8 @@ config USB_CONFIGFS_F_ACC config USB_CONFIGFS_F_AUDIO_SRC boolean "Audio Source gadget" depends on USB_CONFIGFS && USB_CONFIGFS_F_ACC + depends on SND + select SND_PCM select USB_F_AUDIO_SRC help USB gadget Audio Source support -- 2.34.1