浏览代码

touch: add support to compile out touch modules

Add support to selective compile out touch module based
on compile flag.

Change-Id: I0525b7664576740acfeb7febce12e666a9a6c7ba
Signed-off-by: Shashank Babu Chinta Venkata <[email protected]>
Shashank Babu Chinta Venkata 2 年之前
父节点
当前提交
5567d48bac
共有 3 个文件被更改,包括 81 次插入68 次删除
  1. 57 58
      Android.mk
  2. 13 6
      touch_driver_board.mk
  3. 11 4
      touch_driver_product.mk

+ 57 - 58
Android.mk

@@ -1,71 +1,70 @@
 # Android makefile for display kernel modules
-TOUCH_SELECT := CONFIG_MSM_TOUCH=m
 
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
+TOUCH_DLKM_ENABLE := true
+ifeq ($(TARGET_KERNEL_DLKM_DISABLE), true)
+	ifeq ($(TARGET_KERNEL_DLKM_TOUCH_OVERRIDE), false)
+		TOUCH_DLKM_ENABLE := false
+	endif
+endif
 
-# This makefile is only for DLKM
-ifneq ($(findstring vendor,$(LOCAL_PATH)),)
+ifeq ($(TOUCH_DLKM_ENABLE),  true)
+	TOUCH_SELECT := CONFIG_MSM_TOUCH=m
 
-ifneq ($(findstring opensource,$(LOCAL_PATH)),)
-	TOUCH_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/touch-drivers
-endif # opensource
+	LOCAL_PATH := $(call my-dir)
+	include $(CLEAR_VARS)
 
-DLKM_DIR := $(TOP)/device/qcom/common/dlkm
+	# This makefile is only for DLKM
+	ifneq ($(findstring vendor,$(LOCAL_PATH)),)
 
-LOCAL_ADDITIONAL_DEPENDENCIES := $(wildcard $(LOCAL_PATH)/**/*) $(wildcard $(LOCAL_PATH)/*)
+	ifneq ($(findstring opensource,$(LOCAL_PATH)),)
+		TOUCH_BLD_DIR := $(shell pwd)/vendor/qcom/opensource/touch-drivers
+	endif # opensource
 
-# Build
-###########################################################
-# This is set once per LOCAL_PATH, not per (kernel) module
-KBUILD_OPTIONS := TOUCH_ROOT=$(TOUCH_BLD_DIR)
+	DLKM_DIR := $(TOP)/device/qcom/common/dlkm
 
-KBUILD_OPTIONS += MODNAME=touch_dlkm
-KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
-KBUILD_OPTIONS += $(TOUCH_SELECT)
+	LOCAL_ADDITIONAL_DEPENDENCIES := $(wildcard $(LOCAL_PATH)/**/*) $(wildcard $(LOCAL_PATH)/*)
 
-###########################################################
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES   := $(wildcard $(LOCAL_PATH)/**/*) $(wildcard $(LOCAL_PATH)/*)
-LOCAL_MODULE              := nt36xxx-i2c.ko
-LOCAL_MODULE_KBUILD_NAME  := nt36xxx-i2c.ko
-LOCAL_MODULE_TAGS         := optional
-#LOCAL_MODULE_DEBUG_ENABLE := true
-LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
-include $(DLKM_DIR)/Build_external_kernelmodule.mk
-###########################################################
+	# Build
+	###########################################################
+	# This is set once per LOCAL_PATH, not per (kernel) module
+	KBUILD_OPTIONS := TOUCH_ROOT=$(TOUCH_BLD_DIR)
 
-###########################################################
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES   := $(wildcard $(LOCAL_PATH)/**/*) $(wildcard $(LOCAL_PATH)/*)
-LOCAL_MODULE              := goodix_ts.ko
-LOCAL_MODULE_KBUILD_NAME  := goodix_ts.ko
-LOCAL_MODULE_TAGS         := optional
-#LOCAL_MODULE_DEBUG_ENABLE := true
-LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
-include $(DLKM_DIR)/Build_external_kernelmodule.mk
-###########################################################
+	KBUILD_OPTIONS += MODNAME=touch_dlkm
+	KBUILD_OPTIONS += BOARD_PLATFORM=$(TARGET_BOARD_PLATFORM)
+	KBUILD_OPTIONS += $(TOUCH_SELECT)
 
-###########################################################
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES   := $(wildcard $(LOCAL_PATH)/**/*) $(wildcard $(LOCAL_PATH)/*)
-LOCAL_MODULE              := atmel_mxt_ts.ko
-LOCAL_MODULE_KBUILD_NAME  := atmel_mxt_ts.ko
-LOCAL_MODULE_TAGS         := optional
-#LOCAL_MODULE_DEBUG_ENABLE := true
-LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
-include $(DLKM_DIR)/Build_external_kernelmodule.mk
-###########################################################
+	###########################################################
+	include $(CLEAR_VARS)
+	LOCAL_SRC_FILES   := $(wildcard $(LOCAL_PATH)/**/*) $(wildcard $(LOCAL_PATH)/*)
+	LOCAL_MODULE              := nt36xxx-i2c.ko
+	LOCAL_MODULE_KBUILD_NAME  := nt36xxx-i2c.ko
+	LOCAL_MODULE_TAGS         := optional
+	#LOCAL_MODULE_DEBUG_ENABLE := true
+	LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
+	include $(DLKM_DIR)/Build_external_kernelmodule.mk
+	###########################################################
 
-###########################################################
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES   := $(wildcard $(LOCAL_PATH)/**/*) $(wildcard $(LOCAL_PATH)/*)
-LOCAL_MODULE              := dummy_ts.ko
-LOCAL_MODULE_KBUILD_NAME  := dummy_ts.ko
-LOCAL_MODULE_TAGS         := optional
-#LOCAL_MODULE_DEBUG_ENABLE := true
-LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
-include $(DLKM_DIR)/Build_external_kernelmodule.mk
-###########################################################
+	###########################################################
+	include $(CLEAR_VARS)
+	LOCAL_SRC_FILES   := $(wildcard $(LOCAL_PATH)/**/*) $(wildcard $(LOCAL_PATH)/*)
+	LOCAL_MODULE              := goodix_ts.ko
+	LOCAL_MODULE_KBUILD_NAME  := goodix_ts.ko
+	LOCAL_MODULE_TAGS         := optional
+	#LOCAL_MODULE_DEBUG_ENABLE := true
+	LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
+	include $(DLKM_DIR)/Build_external_kernelmodule.mk
+	###########################################################
 
-endif # DLKM check
+	###########################################################
+	include $(CLEAR_VARS)
+	LOCAL_SRC_FILES   := $(wildcard $(LOCAL_PATH)/**/*) $(wildcard $(LOCAL_PATH)/*)
+	LOCAL_MODULE              := atmel_mxt_ts.ko
+	LOCAL_MODULE_KBUILD_NAME  := atmel_mxt_ts.ko
+	LOCAL_MODULE_TAGS         := optional
+	#LOCAL_MODULE_DEBUG_ENABLE := true
+	LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
+	include $(DLKM_DIR)/Build_external_kernelmodule.mk
+	###########################################################
+
+	endif # DLKM check
+endif

+ 13 - 6
touch_driver_board.mk

@@ -1,9 +1,16 @@
+TOUCH_DLKM_ENABLE := true
+ifeq ($(TARGET_KERNEL_DLKM_DISABLE), true)
+	ifeq ($(TARGET_KERNEL_DLKM_TOUCH_OVERRIDE), false)
+		TOUCH_DLKM_ENABLE := false
+	endif
+endif
 
-ifneq ($(TARGET_BOARD_AUTO),true)
-	ifeq ($(call is-board-platform-in-list,$(TARGET_BOARD_PLATFORM)),true)
-		BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/nt36xxx-i2c.ko \
-			$(KERNEL_MODULES_OUT)/goodix_ts.ko \
-			$(KERNEL_MODULES_OUT)/atmel_mxt_ts.ko \
-			$(KERNEL_MODULES_OUT)/dummy_ts.ko
+ifeq ($(TOUCH_DLKM_ENABLE),  true)
+	ifneq ($(TARGET_BOARD_AUTO),true)
+		ifeq ($(call is-board-platform-in-list,$(TARGET_BOARD_PLATFORM)),true)
+			BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/nt36xxx-i2c.ko \
+				$(KERNEL_MODULES_OUT)/goodix_ts.ko \
+				$(KERNEL_MODULES_OUT)/atmel_mxt_ts.ko
+		endif
 	endif
 endif

+ 11 - 4
touch_driver_product.mk

@@ -1,5 +1,12 @@
+TOUCH_DLKM_ENABLE := true
+ifeq ($(TARGET_KERNEL_DLKM_DISABLE), true)
+	ifeq ($(TARGET_KERNEL_DLKM_TOUCH_OVERRIDE), false)
+		TOUCH_DLKM_ENABLE := false
+	endif
+endif
 
-PRODUCT_PACKAGES += $(KERNEL_MODULES_OUT)/nt36xxx-i2c.ko \
-	$(KERNEL_MODULES_OUT)/goodix_ts.ko \
-	$(KERNEL_MODULES_OUT)/atmel_mxt_ts.ko \
-	$(KERNEL_MODULES_OUT)/dummy_ts.ko
+ifeq ($(TOUCH_DLKM_ENABLE),  true)
+	PRODUCT_PACKAGES += $(KERNEL_MODULES_OUT)/nt36xxx-i2c.ko \
+		$(KERNEL_MODULES_OUT)/goodix_ts.ko \
+		$(KERNEL_MODULES_OUT)/atmel_mxt_ts.ko
+endif