goodix_v1510_mmi: check if panel is available

- Check if panel is available, if not, don't probe, save boot time
- Set avdd to 3v, same as other touch driver.

Change-Id: I34711276c2e5efcf1acc9421db2e347d95f2b41b
Signed-off-by: wangyq13 <wangyq13@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2131131
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
wangyq13 2021-11-30 21:43:43 +08:00 committed by Yeqing Wang
parent 77a63ee68c
commit aca37b7799
4 changed files with 15 additions and 3 deletions

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -25,6 +25,7 @@
#include <linux/interrupt.h>
#include "goodix_ts_core.h"
#include "goodix_cfg_bin.h"
#include <linux/mmi_device.h>
#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)