ソースを参照

Merge 345e2d0cba6143e0a5f1f36dca56c6ac097da58f on remote branch

Change-Id: I55c2386dbf2a160cf9d7a221cf7a55e79e3ccda0
Linux Build Service Account 2 年 前
コミット
d97580171a

+ 86 - 0
Android.mk

@@ -11,6 +11,9 @@ ifeq ($(TOUCH_DLKM_ENABLE),  true)
        TOUCH_SELECT := CONFIG_MSM_TOUCH=m
 
        LOCAL_PATH := $(call my-dir)
+       ifeq ($(TARGET_BOARD_PLATFORM), pineapple)
+              LOCAL_MODULE_DDK_BUILD := true
+       endif
        include $(CLEAR_VARS)
 
        # This makefile is only for DLKM
@@ -129,6 +132,89 @@ else ifeq ($(TARGET_BOARD_PLATFORM), pineapple)
        include $(DLKM_DIR)/Build_external_kernelmodule.mk
        ###########################################################
 
+else ifeq ($(TARGET_BOARD_PLATFORM), kalama)
+
+       ###########################################################
+       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              := 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
+       ###########################################################
+
+       ###########################################################
+       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
+       ###########################################################
+
+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 ifeq ($(TARGET_BOARD_PLATFORM), crow)
+
+       ###########################################################
+       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
+       ###########################################################
+
 else
 
        ###########################################################

+ 40 - 0
BUILD.bazel

@@ -0,0 +1,40 @@
+load("//build/kernel/kleaf:kernel.bzl", "ddk_headers")
+
+package(
+    default_visibility = [
+        "//visibility:public"],
+)
+
+ddk_headers(
+    name = "goodix_ts_headers",
+    hdrs = glob([
+            "goodix_berlin_driver/*.h",
+            "qts/*.h"
+        ]
+    )
+)
+
+ddk_headers(
+    name = "nt36xxx_headers",
+    hdrs = glob([
+            "nt36xxx/*.h"
+        ]
+    )
+)
+
+ddk_headers(
+    name = "config_headers",
+    hdrs = glob([
+            "config/*.h"
+        ]
+    ),
+    includes = ["config"]
+)
+
+ddk_headers(
+    name = "touch_drivers_headers",
+    hdrs = [":goodix_ts_headers", ":nt36xxx_headers", ":config_headers"]
+)
+
+load(":target.bzl", "define_pineapple")
+define_pineapple()

+ 10 - 0
Kbuild

@@ -31,6 +31,16 @@ 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
+
+ifeq ($(CONFIG_ARCH_CROW), y)
+        include $(TOUCH_ROOT)/config/gki_crowtouch.conf
+        LINUX_INC += -include $(TOUCH_ROOT)/config/gki_crowtouchconf.h
+endif
+
 LINUX_INC +=	-Iinclude/linux \
 		-Iinclude/linux/drm \
 		-Iinclude/linux/gunyah \

+ 1 - 1
atmel_mxt/atmel_mxt_ts.c

@@ -1377,7 +1377,7 @@ static int mxt_check_retrigen(struct mxt_data *data)
 {
 	struct i2c_client *client = data->client;
 	int error;
-	int val;
+	int val = 0;
 	struct irq_data *irqd;
 
 	data->use_retrigen_workaround = false;

+ 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"

+ 2 - 0
config/gki_crowtouch.conf

@@ -0,0 +1,2 @@
+export CONFIG_MSM_TOUCH=m
+export CONFIG_TOUCHSCREEN_GOODIX_BRL=y

+ 6 - 0
config/gki_crowtouchconf.h

@@ -0,0 +1,6 @@
+/*
+* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+* SPDX-License-Identifier: GPL-2.0-only
+*/
+
+#define CONFIG_TOUCHSCREEN_GOODIX_BRL 1

+ 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[] = {

+ 2 - 2
goodix_berlin_driver/goodix_brl_hw.c

@@ -1,7 +1,7 @@
  /*
   * Goodix Touchscreen Driver
   * Copyright (C) 2020 - 2021 Goodix, Inc.
-  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+  * Copyright (c) 2022 - 2023 Qualcomm Innovation Center, Inc. All rights reserved.
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
@@ -205,7 +205,7 @@ static int brl_reset_after(struct goodix_ts_core *cd)
 }
 
 #define REG_SUSPEND_CURRENT 20
-#define REG_RESUME_CURRENT 14000
+#define REG_RESUME_CURRENT 30000
 static int brl_power_on(struct goodix_ts_core *cd, bool on)
 {
 	int ret = 0;

+ 1 - 3
raydium/raydium_driver.c

@@ -2533,8 +2533,6 @@ if (active_panel)
 	drm_panel_notifier_unregister(active_panel, &g_raydium_ts->fb_notif);
 #endif/*end of CONFIG_FB*/
 	input_unregister_device(g_raydium_ts->input_dev);
-	if (g_raydium_ts->input_dev)
-		input_free_device(g_raydium_ts->input_dev);
 	g_raydium_ts->input_dev = NULL;
 	gpio_free(g_raydium_ts->rst_gpio);
 
@@ -2583,7 +2581,7 @@ if (active_panel)
 	drm_panel_notifier_unregister(active_panel, &g_raydium_ts->fb_notif);
 #endif/*end of CONFIG_FB*/
 	input_unregister_device(g_raydium_ts->input_dev);
-	input_free_device(g_raydium_ts->input_dev);
+	g_raydium_ts->input_dev = NULL;
 	gpio_free(g_raydium_ts->rst_gpio);
 
 #ifdef CONFIG_RM_SYSFS_DEBUG

+ 23 - 0
target.bzl

@@ -0,0 +1,23 @@
+load(":touch_modules.bzl", "touch_driver_modules")
+load(":touch_modules_build.bzl", "define_consolidate_gki_modules")
+
+def define_pineapple():
+    define_consolidate_gki_modules(
+        target = "pineapple",
+        registry = touch_driver_modules,
+        modules = [
+            "nt36xxx-i2c",
+            "atmel_mxt_ts",
+            "dummy_ts",
+            "goodix_ts"
+        ],
+        config_options = [
+            "TOUCH_DLKM_ENABLE",
+            "CONFIG_ARCH_PINEAPPLE",
+            "CONFIG_MSM_TOUCH",
+            "CONFIG_TOUCHSCREEN_GOODIX_BRL",
+            "CONFIG_TOUCHSCREEN_NT36XXX_I2C",
+            "CONFIG_TOUCHSCREEN_ATMEL_MXT",
+            "CONFIG_TOUCHSCREEN_DUMMY"
+        ],
+)

+ 10 - 0
touch_driver_board.mk

@@ -19,6 +19,16 @@ 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), kalama)
+                                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 ifeq ($(TARGET_BOARD_PLATFORM), crow)
+                                BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/goodix_ts.ko
                         else
                                 BOARD_VENDOR_KERNEL_MODULES += $(KERNEL_MODULES_OUT)/nt36xxx-i2c.ko \
                                         $(KERNEL_MODULES_OUT)/goodix_ts.ko \

+ 10 - 0
touch_driver_product.mk

@@ -17,6 +17,16 @@ 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), kalama)
+                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 ifeq ($(TARGET_BOARD_PLATFORM), crow)
+                PRODUCT_PACKAGES += $(KERNEL_MODULES_OUT)/goodix_ts.ko
         else
                 PRODUCT_PACKAGES += $(KERNEL_MODULES_OUT)/nt36xxx-i2c.ko \
                         $(KERNEL_MODULES_OUT)/goodix_ts.ko \

+ 59 - 0
touch_modules.bzl

@@ -0,0 +1,59 @@
+# Importing to touch module entry api from touch_modules_build.bzl to define module entried for touch drivers
+load(":touch_modules_build.bzl", "touch_module_entry")
+
+# Importing the touch driver headers defined in BUILD.bazel
+touch_driver_modules = touch_module_entry([":touch_drivers_headers"])
+
+#Including the headers in the modules to be declared
+module_entry = touch_driver_modules.register
+
+#--------------- TOUCH-DRIVERS MODULES ------------------
+
+#define ddk_module() for goodix_ts
+module_entry(
+    name = "goodix_ts",
+    config_option = "CONFIG_TOUCHSCREEN_GOODIX_BRL",
+    srcs = [
+            "goodix_berlin_driver/goodix_brl_fwupdate.c",
+            "goodix_berlin_driver/goodix_brl_hw.c",
+            "goodix_berlin_driver/goodix_brl_i2c.c",
+            "goodix_berlin_driver/goodix_brl_spi.c",
+            "goodix_berlin_driver/goodix_cfg_bin.c",
+            "goodix_berlin_driver/goodix_ts_core.c",
+            "goodix_berlin_driver/goodix_ts_gesture.c",
+            "goodix_berlin_driver/goodix_ts_inspect.c",
+            "goodix_berlin_driver/goodix_ts_tools.c",
+            "goodix_berlin_driver/goodix_ts_utils.c",
+            "qts/qts_core.c"
+    ]
+)
+
+#define ddk_module() for nt36xxx
+module_entry(
+    name = "nt36xxx-i2c",
+    config_option = "CONFIG_TOUCHSCREEN_NT36XXX_I2C",
+    srcs = [
+            "nt36xxx/nt36xxx_ext_proc.c",
+            "nt36xxx/nt36xxx_fw_update.c",
+            "nt36xxx/nt36xxx_mp_ctrlram.c",
+            "nt36xxx/nt36xxx.c"
+    ]
+)
+
+#define ddk_module() for atmel_mxt_ts
+module_entry(
+    name = "atmel_mxt_ts",
+    config_option = "CONFIG_TOUCHSCREEN_ATMEL_MXT",
+    srcs = [
+            "atmel_mxt/atmel_mxt_ts.c",
+    ]
+)
+
+#define ddk_module() for dummy_ts
+module_entry(
+    name = "dummy_ts",
+    config_option = "CONFIG_TOUCHSCREEN_DUMMY",
+    srcs = [
+            "dummy_touch/dummy_touch.c"
+    ]
+)

+ 86 - 0
touch_modules_build.bzl

@@ -0,0 +1,86 @@
+load("//build/kernel/kleaf:kernel.bzl", "ddk_module","ddk_submodule")
+load("//build/bazel_common_rules/dist:dist.bzl", "copy_to_dist_dir")
+
+def _register_module_to_map(module_map, name, path, config_option, srcs):
+    module = struct(
+        name = name,
+        path = path,
+        srcs = srcs,
+        config_option = config_option
+    )
+
+    module_map[name] = module
+
+def _get_config_choices(map, options):
+    choices = []
+    for option in map:
+        choices.extend(map[option].get(option in options,[]))
+    return choices
+
+def _get_kernel_build_options(modules, config_options):
+    all_options = {option: True for option in config_options}
+    all_options = all_options | {module.config_option: True for module in modules if module.config_option}
+    return all_options
+
+def _get_kernel_build_module_srcs(module, options, formatter):
+    srcs = module.srcs
+    print("-",module.name,",",module.config_option,",srcs =",srcs)
+    module_path = "{}/".format(module.path) if module.path else ""
+    return ["{}{}".format(module_path, formatter(src)) for src in srcs]
+
+def touch_module_entry(hdrs = []):
+    module_map = {}
+
+    def register(name, path = None, config_option = [], srcs = [], config_srcs = None, deps = None):
+        _register_module_to_map(module_map, name, path, config_option, srcs)
+    return struct(
+        register = register,
+        get = module_map.get,
+        hdrs = hdrs
+    )
+
+def define_target_variant_modules(target, variant, registry, modules, config_options = []):
+    kernel_build = "{}_{}".format(target, variant)
+    kernel_build_label = "//msm-kernel:{}".format(kernel_build)
+    modules = [registry.get(module_name) for module_name in modules]
+    options = _get_kernel_build_options(modules, config_options)
+    build_print = lambda message : print("{}: {}".format(kernel_build, message))
+    formatter = lambda s : s.replace("%b", kernel_build).replace("%t", target)
+    headers = ["//msm-kernel:all_headers"] + registry.hdrs
+    all_module_rules = []
+
+    for module in modules:
+        rule_name = "{}_{}".format(kernel_build, module.name)
+        module_srcs = _get_kernel_build_module_srcs(module, options, formatter)
+
+        if not module_srcs:
+            continue
+
+        ddk_submodule(
+            name = rule_name,
+            srcs = module_srcs,
+            out = "{}.ko".format(module.name),
+            deps =  headers,
+            local_defines = options.keys(),
+        )
+        all_module_rules.append(rule_name)
+
+    ddk_module(
+        name = "{}_touch_drivers".format(kernel_build),
+        kernel_build = kernel_build_label,
+        deps = all_module_rules,
+    )
+    copy_to_dist_dir(
+        name = "{}_touch_drivers_dist".format(kernel_build),
+        data = [":{}_touch_drivers".format(kernel_build)],
+        dist_dir = "out/target/product/{}/dlkm/lib/modules".format(target),
+        flat = True,
+        wipe_dist_dir = False,
+        allow_duplicate_filenames = False,
+        mode_overrides = {"**/*": "644"},
+        log = "info",
+    )
+
+def define_consolidate_gki_modules(target, registry, modules, config_options = []):
+        define_target_variant_modules(target, "gki", registry, modules, config_options)
+        define_target_variant_modules(target, "consolidate", registry, modules, config_options)