diff --git a/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/Android.mk b/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/Android.mk index d07d3de94780..1f0a34839b8e 100644 --- a/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/Android.mk +++ b/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/Android.mk @@ -5,4 +5,6 @@ include $(CLEAR_VARS) LOCAL_MODULE := goodix_v1510_mmi.ko LOCAL_MODULE_TAGS := optional LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT) +LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/mmi_info.ko +KBUILD_OPTIONS_GKI += GKI_OBJ_MODULE_DIR=gki include $(DLKM_DIR)/AndroidKernelModule.mk diff --git a/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/Kbuild b/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/Kbuild index 631430719e22..7b231532872a 100644 --- a/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/Kbuild +++ b/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/Kbuild @@ -1,8 +1,9 @@ # add -Wall to try to catch everything we can. EXTRA_CFLAGS += -Wall EXTRA_CFLAGS += \ - -I$(TOP)/motorola/kernel/modules/include \ - -I$(TOP)/motorola/kernel/modules/drivers/input/touchscreen/goodix_gtx8_v1510_mmi + -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/include obj-m := goodix_v1510_mmi.o goodix_v1510_mmi-objs = goodix_ts_i2c.o goodix_ts_core.o goodix_ts_test.o goodix_cfg_bin.o goodix_gtx8_update.o + +KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../../../mmi_info/$(GKI_OBJ_MODULE_DIR)/Module.symvers diff --git a/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/goodix_ts_core.c b/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/goodix_ts_core.c index 30daafd7c6d7..be64e0a1af44 100644 --- a/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/goodix_ts_core.c +++ b/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/goodix_ts_core.c @@ -56,6 +56,9 @@ struct goodix_module goodix_modules; #define CORE_MODULE_REMOVED -2 int core_module_prob_sate = CORE_MODULE_UNPROBED; +#define GTP_VTG_MIN_UV 2800000 +#define GTP_VTG_MAX_UV 3300000 + /** * __do_register_ext_module - register external module * to register into touch core modules structure @@ -1360,7 +1363,7 @@ static int goodix_ts_power_init(struct goodix_ts_core *core_data) ts_err("set avdd load fail"); return r; } - r = regulator_set_voltage(core_data->avdd, 2960000, 2960000); + r = regulator_set_voltage(core_data->avdd, GTP_VTG_MIN_UV, GTP_VTG_MAX_UV); if (r) { ts_err("set avdd voltage fail"); return r; diff --git a/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/goodix_ts_i2c.c b/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/goodix_ts_i2c.c index 0a247cc080b9..24a45be5f733 100644 --- a/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/goodix_ts_i2c.c +++ b/drivers/input/touchscreen/goodix_gtx8_v1510_mmi/goodix_ts_i2c.c @@ -25,6 +25,7 @@ #include #include "goodix_ts_core.h" #include "goodix_cfg_bin.h" +#include #define TS_DRIVER_NAME "gtx8" #define I2C_MAX_TRANSFER_SIZE 60 @@ -1883,6 +1884,11 @@ static int goodix_i2c_probe(struct i2c_client *client, ts_info("goodix_i2c_probe IN"); + if (client->dev.of_node && !mmi_device_is_available(client->dev.of_node)) { + ts_err("mmi: device not supported\n"); + return -ENODEV; + } + r = i2c_check_functionality(client->adapter, I2C_FUNC_I2C); if (!r)