diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/Android.mk b/drivers/input/touchscreen/goodix_gt96x_mmi/Android.mk new file mode 100644 index 000000000000..b8a5ff7cf855 --- /dev/null +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/Android.mk @@ -0,0 +1,23 @@ +DLKM_DIR := motorola/kernel/modules +LOCAL_PATH := $(call my-dir) + +ifeq ($(TOUCHSCREEN_GOODIX_BRL_SPI),true) +ifeq ($(call is-board-platform-in-list,taro kalama parrot crow pineapple), true) + KBUILD_OPTIONS += CONFIG_TOUCHSCREEN_GOODIX_BRL_SPI=y +else + KERNEL_CFLAGS += CONFIG_TOUCHSCREEN_GOODIX_BRL_SPI=y +endif +endif + + +include $(CLEAR_VARS) +LOCAL_MODULE := goodix_gt96x_mmi.ko +LOCAL_MODULE_TAGS := optional +LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) +ifneq ($(findstring touchscreen_mmi.ko,$(BOARD_VENDOR_KERNEL_MODULES)),) + KBUILD_OPTIONS += CONFIG_INPUT_TOUCHSCREEN_MMI=y + LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/touchscreen_mmi.ko +endif + +KBUILD_OPTIONS_GKI += GKI_OBJ_MODULE_DIR=gki +include $(DLKM_DIR)/AndroidKernelModule.mk diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/Kbuild b/drivers/input/touchscreen/goodix_gt96x_mmi/Kbuild new file mode 100644 index 000000000000..8d599929b010 --- /dev/null +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/Kbuild @@ -0,0 +1,23 @@ +# add -Wall to try to catch everything we can. +EXTRA_CFLAGS += -Wall +EXTRA_CFLAGS += \ + -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/include + +obj-m := goodix_gt96x_mmi.o +goodix_gt96x_mmi-objs := \ + goodix_brl_i2c.o \ + goodix_brl_spi.o \ + goodix_ts_core.o \ + goodix_brl_hw.o \ + goodix_cfg_bin.o \ + goodix_ts_utils.o \ + goodix_brl_fwupdate.o \ + goodix_ts_inspect.o \ + goodix_ts_tools.o \ + goodix_ts_gesture.o + +ifneq ($(filter m y,$(CONFIG_TOUCHSCREEN_GOODIX_BRL_SPI)),) + EXTRA_CFLAGS += -DCONFIG_TOUCHSCREEN_GOODIX_BRL_SPI +endif + +KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../touchscreen_mmi/$(GKI_OBJ_MODULE_DIR)/Module.symvers diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/Makefile b/drivers/input/touchscreen/goodix_gt96x_mmi/Makefile index 903a1cccb5f7..97bb0cc69699 100644 --- a/drivers/input/touchscreen/goodix_gt96x_mmi/Makefile +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/Makefile @@ -1,12 +1,16 @@ -obj-$(CONFIG_TOUCHSCREEN_GOODIX_BRL) += goodix_core.o -goodix_core-y := \ - goodix_brl_i2c.o \ - goodix_brl_spi.o \ - goodix_ts_core.o \ - goodix_brl_hw.o \ - goodix_cfg_bin.o \ - goodix_ts_utils.o \ - goodix_brl_fwupdate.o \ - goodix_ts_gesture.o \ - goodix_ts_inspect.o \ - goodix_ts_tools.o +all: modules + +modules: + $(MAKE) -C $(KERNEL_SRC) M=$(M) modules $(KBUILD_OPTIONS) + +modules_install: + $(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(M) modules_install + +%: + $(MAKE) -C $(KERNEL_SRC) M=$(M) $@ $(KBUILD_OPTIONS) + +clean: + rm -f *.o *.ko *.mod.c *.mod.o *~ .*.cmd Module.symvers + rm -rf .tmp_versions + +KBUILD_EXTRA_SYMBOLS += $(M)/../touchscreen_mmi/$(GKI_OBJ_MODULE_DIR)/Module.symvers diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_hw.c b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_hw.c index 1c3c46d6d313..a75f0947eb59 100644 --- a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_hw.c +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_brl_hw.c @@ -1454,7 +1454,7 @@ static int brld_get_framedata(struct goodix_ts_core *cd, int ret; unsigned char val; int retry = 20; - unsigned char frame_buf[GOODIX_MAX_FRAMEDATA_LEN]; + static unsigned char frame_buf[GOODIX_MAX_FRAMEDATA_LEN]; unsigned char *cur_ptr; unsigned int flag_addr = cd->ic_info.misc.frame_data_addr; int tx = cd->ic_info.parm.drv_num; diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_core.c b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_core.c index 70e863e69748..d04bf1352619 100644 --- a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_core.c +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_core.c @@ -14,18 +14,16 @@ * General Public License for more details. * */ -#include #include #include -#include #include +#include "goodix_ts_core.h" #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 38) #include #define INPUT_TYPE_B_PROTOCOL #endif -#include "goodix_ts_core.h" /* goodix fb test */ // #include "../../../video/fbdev/core/fb_firefly.h" @@ -1415,13 +1413,12 @@ void goodix_ts_esd_on(struct goodix_ts_core *cd) void goodix_ts_esd_off(struct goodix_ts_core *cd) { struct goodix_ts_esd *ts_esd = &cd->ts_esd; - int ret; if (!atomic_read(&ts_esd->esd_on)) return; atomic_set(&ts_esd->esd_on, 0); - ret = cancel_delayed_work_sync(&ts_esd->esd_work); + cancel_delayed_work_sync(&ts_esd->esd_work); ts_info("Esd off"); } diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_core.h b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_core.h index 0506c4393874..faafcca88bfc 100644 --- a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_core.h +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_core.h @@ -33,6 +33,11 @@ #include #include #include +#include +#include + +#include + #if IS_ENABLED(CONFIG_OF) #include #include @@ -66,6 +71,10 @@ #define TS_DEFAULT_FIRMWARE "goodix_firmware.bin" #define TS_DEFAULT_CFG_BIN "goodix_cfg_group.bin" +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)) +#define PDE_DATA(x) pde_data(x) +#endif + enum GOODIX_GESTURE_TYP { GESTURE_C = (1 << 0), GESTURE_E = (1 << 1), diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_gesture.c b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_gesture.c index 306784249f45..d8312aa9c52a 100644 --- a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_gesture.c +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_gesture.c @@ -217,7 +217,7 @@ const static struct attribute_group gesture_sysfs_group = { int gesture_module_init(struct goodix_ts_core *core_data) { - int ret; + int ret = 0; struct kobject *parent = &core_data->pdev->dev.kobj; /* gesture sysfs init */ diff --git a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_inspect.c b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_inspect.c index 5ab7eb6db739..26f0c9f41357 100644 --- a/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_inspect.c +++ b/drivers/input/touchscreen/goodix_gt96x_mmi/goodix_ts_inspect.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include @@ -2687,7 +2687,8 @@ static void *seq_start(struct seq_file *s, loff_t *pos) static int seq_show(struct seq_file *s, void *v) { - seq_printf(s, (u8 *)v); + //seq_printf(s, (u8 *)v); + seq_printf(s, "%s", (u8 *)v); return 0; }