Browse Source

touch: blair: enable touch drivers for blair

Add touch config files and enable for blair platform.

Change-Id: I16e3fcdc3a5e8faab0804db24f10563e873bd594
Signed-off-by: Jyothi bommidi <[email protected]>
Signed-off-by: Ritesh Kumar <[email protected]>
Ritesh Kumar 1 year ago
parent
commit
18444e7144

+ 35 - 0
Android.mk

@@ -164,6 +164,41 @@ else ifeq ($(TARGET_BOARD_PLATFORM), kalama)
        include $(DLKM_DIR)/Build_external_kernelmodule.mk
        ###########################################################
 
+else ifeq ($(TARGET_BOARD_PLATFORM), blair)
+
+       ###########################################################
+       include $(CLEAR_VARS)
+       LOCAL_SRC_FILES   := $(wildcard $(LOCAL_PATH)/**/*) $(wildcard $(LOCAL_PATH)/*)
+       LOCAL_MODULE              := focaltech_fts.ko
+       LOCAL_MODULE_KBUILD_NAME  := focaltech_fts.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              := synaptics_tcm_ts.ko
+       LOCAL_MODULE_KBUILD_NAME  := synaptics_tcm_ts.ko
+       LOCAL_MODULE_TAGS         := optional
+       #LOCAL_MODULE_DEBUG_ENABLE := true
+       LOCAL_MODULE_PATH         := $(KERNEL_MODULES_OUT)
+       include $(DLKM_DIR)/Build_external_kernelmodule.mk
+       ###########################################################
+
 else
 
        ###########################################################

+ 5 - 0
Kbuild

@@ -31,6 +31,11 @@ ifeq ($(CONFIG_ARCH_KONA), y)
         LINUX_INC += -include $(TOUCH_ROOT)/config/gki_konatouchconf.h
 endif
 
+ifeq ($(CONFIG_ARCH_BLAIR), y)
+        include $(TOUCH_ROOT)/config/gki_blairtouch.conf
+        LINUX_INC += -include $(TOUCH_ROOT)/config/gki_blairtouchconf.h
+endif
+
 LINUX_INC +=	-Iinclude/linux \
 		-Iinclude/linux/drm \
 		-Iinclude/linux/gunyah \

+ 9 - 0
config/gki_blairtouch.conf

@@ -0,0 +1,9 @@
+export CONFIG_MSM_TOUCH=m
+export CONFIG_TOUCH_FOCALTECH=y
+export CONFIG_TOUCHSCREEN_NT36XXX_I2C=y
+export CONFIG_TOUCHSCREEN_SYNAPTICS_TCM=y
+export CONFIG_TOUCHSCREEN_SYNAPTICS_TCM_I2C=y
+export CONFIG_TOUCHSCREEN_SYNAPTICS_TCM_CORE=y
+export CONFIG_TOUCHSCREEN_SYNAPTICS_TCM_TOUCH=y
+export CONFIG_TOUCHSCREEN_FTS_DIRECTORY="focaltech_touch"
+export CONFIG_FTS_TRUSTED_TOUCH=n

+ 12 - 0
config/gki_blairtouchconf.h

@@ -0,0 +1,12 @@
+/*
+* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+* SPDX-License-Identifier: GPL-2.0-only
+*/
+
+#define CONFIG_TOUCH_FOCALTECH 1
+#define CONFIG_TOUCHSCREEN_NT36XXX_I2C 1
+#define CONFIG_TOUCHSCREEN_SYNAPTICS_TCM 1
+#define CONFIG_TOUCHSCREEN_SYNAPTICS_TCM_I2C 1
+#define CONFIG_TOUCHSCREEN_SYNAPTICS_TCM_CORE 1
+#define CONFIG_TOUCHSCREEN_SYNAPTICS_TCM_TOUCH 1
+#define CONFIG_TOUCHSCREEN_FTS_DIRECTORY "focaltech_touch"

+ 23 - 2
focaltech_touch/focaltech_core.c

@@ -3193,9 +3193,19 @@ static int fts_ts_i2c_probe(struct i2c_client *client, const struct i2c_device_i
 	return 0;
 }
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
+static void fts_ts_i2c_remove(struct i2c_client *client)
+#else
 static int fts_ts_i2c_remove(struct i2c_client *client)
+#endif
 {
-	return fts_ts_remove_entry(i2c_get_clientdata(client));
+	int rc = 0;
+
+	rc = fts_ts_remove_entry(i2c_get_clientdata(client));
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0))
+	return rc;
+#endif
 }
 
 static const struct i2c_device_id fts_ts_i2c_id[] = {
@@ -3292,9 +3302,20 @@ static int fts_ts_spi_probe(struct spi_device *spi)
 	return 0;
 }
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
+static void fts_ts_spi_remove(struct spi_device *spi)
+#else
 static int fts_ts_spi_remove(struct spi_device *spi)
+#endif
 {
-	return fts_ts_remove_entry(spi_get_drvdata(spi));
+	int rc = 0;
+
+	rc = fts_ts_remove_entry(spi_get_drvdata(spi));
+
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0))
+	return rc;
+#endif
 }
 
 static const struct spi_device_id fts_ts_spi_id[] = {

+ 4 - 0
touch_driver_board.mk

@@ -23,6 +23,10 @@ ifeq ($(TOUCH_DLKM_ENABLE),  true)
                                 BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/nt36xxx-i2c.ko \
                                         $(KERNEL_MODULES_OUT)/goodix_ts.ko \
                                         $(KERNEL_MODULES_OUT)/atmel_mxt_ts.ko
+                        else ifeq ($(TARGET_BOARD_PLATFORM), blair)
+                                BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/focaltech_fts.ko \
+                                        $(KERNEL_MODULES_OUT)/nt36xxx-i2c.ko \
+                                        $(KERNEL_MODULES_OUT)/synaptics_tcm_ts.ko
                         else
                                 BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/nt36xxx-i2c.ko \
                                         $(KERNEL_MODULES_OUT)/goodix_ts.ko \

+ 4 - 0
touch_driver_product.mk

@@ -21,6 +21,10 @@ 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
+        else ifeq ($(TARGET_BOARD_PLATFORM), blair)
+                PRODUCT_PACKAGES += $(KERNEL_MODULES_OUT)/focaltech_fts.ko \
+                        $(KERNEL_MODULES_OUT)/nt36xxx-i2c.ko \
+                        $(KERNEL_MODULES_OUT)/synaptics_tcm_ts.ko
         else
                 PRODUCT_PACKAGES += $(KERNEL_MODULES_OUT)/nt36xxx-i2c.ko \
                         $(KERNEL_MODULES_OUT)/goodix_ts.ko \