diff --git a/drivers/uwb/qm35/Android.mk b/drivers/uwb/qm35/Android.mk index 39a389e7355b..4a8551d17c26 100644 --- a/drivers/uwb/qm35/Android.mk +++ b/drivers/uwb/qm35/Android.mk @@ -1,6 +1,11 @@ DLKM_DIR := motorola/kernel/modules LOCAL_PATH := $(call my-dir) +ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) + KERNEL_CFLAGS += CONFIG_QM35_SPI_DEBUG_FW=y + KBUILD_OPTIONS += CONFIG_QM35_SPI_DEBUG_FW=y +endif + include $(CLEAR_VARS) LOCAL_MODULE := qm35.ko LOCAL_MODULE_TAGS := optional diff --git a/drivers/uwb/qm35/Kbuild b/drivers/uwb/qm35/Kbuild index cebb1632941f..992c67fa345c 100644 --- a/drivers/uwb/qm35/Kbuild +++ b/drivers/uwb/qm35/Kbuild @@ -2,6 +2,11 @@ EXTRA_CFLAGS += -Wall EXTRA_CFLAGS += -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/include + +ifneq ($(filter m y,$(CONFIG_QM35_SPI_DEBUG_FW)),) + EXTRA_CFLAGS += -DCONFIG_QM35_SPI_DEBUG_FW +endif + obj-m := qm35.o qm35-y := \ @@ -21,7 +26,9 @@ qm35-y := \ debug.o \ hsspi_test.o -qm35-y += debug_qmrom.o +ifneq ($(filter m y,$(CONFIG_QM35_SPI_DEBUG_FW)),) + qm35-y += debug_qmrom.o +endif qm35-y += qm35-trace.o KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../../mmi_info/Module.symvers diff --git a/drivers/uwb/qm35/debug.c b/drivers/uwb/qm35/debug.c index 2092babf6c6c..1d9f6d8c227d 100644 --- a/drivers/uwb/qm35/debug.c +++ b/drivers/uwb/qm35/debug.c @@ -36,9 +36,9 @@ #include "debug.h" #include "hsspi_test.h" -//#if IS_ENABLED(CONFIG_QM35_SPI_DEBUG_FW) +#if IS_ENABLED(CONFIG_QM35_SPI_DEBUG_FW) extern void debug_rom_code_init(struct debug *debug); -//#endif +#endif static const struct file_operations debug_enable_fops; static const struct file_operations debug_log_level_fops; @@ -318,8 +318,11 @@ int debug_create_module_entry(struct debug *debug, void debug_new_trace_available(struct debug *debug) { - if (debug->pv_filp) + if (debug->pv_filp) { +#if IS_ENABLED(CONFIG_QM35_SPI_DEBUG_FW) fsnotify_modify(debug->pv_filp); +#endif + } wake_up_interruptible(&debug->wq); } @@ -440,9 +443,9 @@ int debug_init(struct debug *debug) goto unregister; } -//#if IS_ENABLED(CONFIG_QM35_SPI_DEBUG_FW) +#if IS_ENABLED(CONFIG_QM35_SPI_DEBUG_FW) debug_rom_code_init(debug); -//#endif +#endif return 0;