mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 13:49:24 -04:00
input: goodix_v1510: add charging and gtp-tools node
- Add charging detection function - Add gtp-tools node for cqa test - Remove software esd check for touch, touch firmware itself to recover Change-Id: Id3b398f302370baddf56b5973813d5a09591460e Signed-off-by: wangyq13 <wangyq13@lenovo.com> Reviewed-on: https://gerrit.mot.com/2150842 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:
parent
06ca2a6c80
commit
df08fa99ef
5 changed files with 52 additions and 14 deletions
|
|
@ -4,7 +4,7 @@ EXTRA_CFLAGS += \
|
|||
-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 goodix_ts_gesture.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 goodix_ts_gesture.o goodix_ts_tools.o
|
||||
|
||||
ifneq ($(filter m y,$(CONFIG_DRM_PANEL_NOTIFICATIONS)),)
|
||||
EXTRA_CFLAGS += -DCONFIG_DRM_PANEL_NOTIFICATIONS
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@ extern int goodix_ts_mmi_dev_register(struct platform_device *ts_device);
|
|||
extern void goodix_ts_mmi_dev_unregister(struct platform_device *ts_device);
|
||||
extern int __init goodix_gsx_gesture_init(void);
|
||||
extern void __exit goodix_gsx_gesture_exit(void);
|
||||
extern int __init goodix_tools_init(void);
|
||||
extern void __exit goodix_tools_exit(void);
|
||||
|
||||
struct goodix_module goodix_modules;
|
||||
|
||||
|
|
@ -2222,7 +2224,8 @@ int goodix_ts_stage2_init(struct goodix_ts_core *core_data)
|
|||
goodix_ts_procfs_init(core_data);
|
||||
|
||||
/* esd protector */
|
||||
goodix_ts_esd_init(core_data);
|
||||
if (core_data->ts_dev->board_data.esd_default_on)
|
||||
goodix_ts_esd_init(core_data);
|
||||
return 0;
|
||||
exit:
|
||||
goodix_ts_pen_dev_remove(core_data);
|
||||
|
|
@ -2331,6 +2334,10 @@ static int goodix_ts_probe(struct platform_device *pdev)
|
|||
ts_err("Failed start cfg_bin_proc, %d", r);
|
||||
goto later_thread_err;
|
||||
}
|
||||
|
||||
/* debug node init */
|
||||
goodix_tools_init();
|
||||
|
||||
complete_all(&goodix_modules.core_comp);
|
||||
ts_info("goodix_ts_core probe success");
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -233,6 +233,11 @@ static int goodix_parse_dt(struct device_node *node,
|
|||
ts_debug("[DT]x:%d, y:%d, w:%d, p:%d", board_data->panel_max_x,
|
||||
board_data->panel_max_y, board_data->panel_max_w,
|
||||
board_data->panel_max_p);
|
||||
|
||||
board_data->esd_default_on= of_property_read_bool(node,
|
||||
"goodix,esd-default-on");
|
||||
if (board_data->esd_default_on)
|
||||
ts_info("goodix esd-default-on enabled");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -618,7 +623,7 @@ int goodix_i2c_write_trans_once(struct goodix_ts_device *dev, unsigned int reg,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void goodix_cmd_init(struct goodix_ts_device *dev,
|
||||
void goodix_cmd_init(struct goodix_ts_device *dev,
|
||||
struct goodix_ts_cmd *ts_cmd,
|
||||
u8 cmds, u16 cmd_data, u32 reg_addr)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,6 +29,11 @@
|
|||
}
|
||||
|
||||
extern int gsx_gesture_before_suspend_mmi(struct goodix_ts_core *core_data);
|
||||
extern void goodix_cmd_init(struct goodix_ts_device *dev,
|
||||
struct goodix_ts_cmd *ts_cmd,
|
||||
u8 cmds, u16 cmd_data, u32 reg_addr);
|
||||
extern int goodix_send_command(struct goodix_ts_device *dev,
|
||||
struct goodix_ts_cmd *cmd);
|
||||
|
||||
static int goodix_ts_mmi_methods_get_vendor(struct device *dev, void *cdata) {
|
||||
return scnprintf(TO_CHARP(cdata), TS_MMI_MAX_VENDOR_LEN, "%s", "goodix");
|
||||
|
|
@ -164,10 +169,38 @@ static int goodix_ts_mmi_methods_power(struct device *dev, int on) {
|
|||
}
|
||||
}
|
||||
|
||||
#define CHARGER_MODE_CMD 0xAF
|
||||
#define CHARGER_ENTER_MODE_CMD 0x06
|
||||
#define CHARGER_EXIT_MODE_CMD 0x07
|
||||
static int goodix_ts_mmi_charger_mode(struct device *dev, int mode)
|
||||
{
|
||||
return 0;
|
||||
int ret = 0;
|
||||
struct goodix_ts_device *ts_dev;
|
||||
struct platform_device *pdev;
|
||||
struct goodix_ts_core *core_data;
|
||||
struct goodix_ts_cmd charge_cmd;
|
||||
|
||||
GET_GOODIX_DATA(dev);
|
||||
ts_dev = core_data->ts_dev;
|
||||
|
||||
if (mode)
|
||||
goodix_cmd_init(ts_dev, &charge_cmd, CHARGER_ENTER_MODE_CMD,
|
||||
0, ts_dev->reg.command);
|
||||
else
|
||||
goodix_cmd_init(ts_dev, &charge_cmd, CHARGER_EXIT_MODE_CMD,
|
||||
0, ts_dev->reg.command);
|
||||
|
||||
if (charge_cmd.initialized) {
|
||||
ret= goodix_send_command(ts_dev, &charge_cmd);
|
||||
if (ret < 0)
|
||||
ts_err("Failed to set charger mode\n");
|
||||
} else {
|
||||
ts_err("Uninitialized charge command");
|
||||
}
|
||||
|
||||
msleep(16);
|
||||
ts_info("Success to %s charger mode\n", mode ? "Enable" : "Disable");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int goodix_ts_mmi_panel_state(struct device *dev,
|
||||
|
|
|
|||
|
|
@ -608,7 +608,7 @@ static struct goodix_ext_module_funcs goodix_tools_module_funcs = {
|
|||
*
|
||||
* return: 0 success, else failed
|
||||
*/
|
||||
static int __init goodix_tools_init(void)
|
||||
int __init goodix_tools_init(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
@ -637,16 +637,9 @@ static int __init goodix_tools_init(void)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void __exit goodix_tools_exit(void)
|
||||
void __exit goodix_tools_exit(void)
|
||||
{
|
||||
misc_deregister(&goodix_tools_miscdev);
|
||||
kfree(goodix_tools_dev);
|
||||
ts_info("Goodix tools miscdev exit");
|
||||
}
|
||||
|
||||
late_initcall(goodix_tools_init);
|
||||
module_exit(goodix_tools_exit);
|
||||
|
||||
MODULE_DESCRIPTION("Goodix tools Module");
|
||||
MODULE_AUTHOR("Goodix, Inc.");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
|
|
|
|||
Loading…
Reference in a new issue