Support loadding multiple config files

TP:
Support loading different configuration files according to
the panel name.

Change-Id: Ibe6d99c99f08951b35100921c4eaa587048aee1f
Reviewed-on: https://gerrit.mot.com/2062784
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong20 authored and litong committed 2021-09-10 05:47:38 -05:00
1 parent 605998546f
commit f243369174
7 files changed
+47 -15

No files matched your search

@@ -5,6 +5,10 @@ ifeq ($(DRM_PANEL_EVENT_NOTIFICATIONS),true)
KBUILD_OPTIONS += CONFIG_DRM_PANEL_EVENT_NOTIFICATIONS=y
endif
ifeq ($(GTP_LIMIT_USE_SUPPLIER),true)
KBUILD_OPTIONS += CONFIG_GTP_LIMIT_USE_SUPPLIER=y
endif
include $(CLEAR_VARS)
LOCAL_MODULE := goodix_brl_mmi.ko
LOCAL_MODULE_TAGS := optional
@@ -20,6 +20,10 @@ ifneq ($(filter m y, $(CONFIG_DRM_PANEL_EVENT_NOTIFICATIONS)),)
EXTRA_CFLAGS += -DCONFIG_DRM_PANEL_EVENT_NOTIFICATIONS
endif
ifneq ($(filter m y,$(CONFIG_GTP_LIMIT_USE_SUPPLIER)),)
EXTRA_CFLAGS += -DCONFIG_GTP_LIMIT_USE_SUPPLIER
endif
ifneq ($(filter m y,$(CONFIG_INPUT_TOUCHSCREEN_MMI)),)
EXTRA_CFLAGS += -DCONFIG_INPUT_TOUCHSCREEN_MMI
goodix_brl_mmi-objs += goodix_ts_mmi.o
@@ -15,6 +15,7 @@
*
*/
#include "goodix_ts_core.h"
#include "goodix_ts_mmi.h"
#define TS_BIN_VERSION_START_INDEX 5
#define TS_BIN_VERSION_LEN 4
@@ -323,6 +324,17 @@ err_out:
int goodix_get_config_proc(struct goodix_ts_core *cd)
{
#if defined(CONFIG_INPUT_TOUCHSCREEN_MMI) && defined(CONFIG_GTP_LIMIT_USE_SUPPLIER)
int ret;
const char* supplier = NULL;
if (cd->imports && cd->imports->get_supplier) {
ret = cd->imports->get_supplier(cd->bus->dev, &supplier);
if (!ret)
snprintf(cd->board_data.cfg_bin_name, GOODIX_MAX_STR_LABLE_LEN, "%s_%s",
supplier, TS_DEFAULT_CFG_BIN);
}
#endif
if (cd->hw_ops->read_version(cd, &cd->fw_version, true)) {
ts_info("version info abnormal, abort");
return -EINVAL;
@@ -2244,6 +2244,15 @@ static int goodix_ts_probe(struct platform_device *pdev)
core_data->ts_notifier.notifier_call = goodix_generic_noti_callback;
goodix_ts_register_notifier(&core_data->ts_notifier);
#ifdef CONFIG_INPUT_TOUCHSCREEN_MMI
ts_info("%s:goodix_ts_mmi_dev_register",__func__);
ret = goodix_ts_mmi_dev_register(pdev);
if (ret) {
ts_info("Failed register touchscreen mmi.");
goto err_out;
}
#endif
/* Try start a thread to get config-bin info */
ret = goodix_start_later_init(core_data);
if (ret) {
@@ -2254,15 +2263,6 @@ static int goodix_ts_probe(struct platform_device *pdev)
/* debug node init */
goodix_tools_init();
#ifdef CONFIG_INPUT_TOUCHSCREEN_MMI
ts_info("%s:goodix_ts_mmi_dev_register",__func__);
ret = goodix_ts_mmi_dev_register(pdev);
if (ret) {
ts_info("Failed register touchscreen mmi.");
goto err_out;
}
#endif
core_data->init_stage = CORE_INIT_STAGE1;
goodix_modules.core_data = core_data;
core_module_prob_sate = CORE_MODULE_PROB_SUCCESS;
@@ -468,6 +468,7 @@ struct goodix_ts_core {
#endif
/* touchscreen_mmi */
struct ts_mmi_class_methods *imports;
int (*set_fw_name)(char* fw_name);
int update_status;
int gesture_enabled;
@@ -11,8 +11,8 @@
* GNU General Public License for more details.
*/
#include <linux/touchscreen_mmi.h>
#include "goodix_ts_mmi.h"
#include "goodix_ts_core.h"
#include <linux/input/mt.h>
#define GET_GOODIX_DATA(dev) { \
@@ -181,9 +181,8 @@ static int goodix_ts_firmware_update(struct device *dev, char *fwname) {
if (core_data->set_fw_name)
core_data->set_fw_name(fwname);
ret = goodix_do_fw_update(NULL,
ret = goodix_do_fw_update(core_data->ic_configs[CONFIG_TYPE_NORMAL],
UPDATE_MODE_SRC_REQUEST | UPDATE_MODE_BLOCK | UPDATE_MODE_FORCE);
if (ret)
ts_err("failed do fw update");
@@ -321,6 +320,8 @@ int goodix_ts_mmi_dev_register(struct platform_device *pdev) {
dev_err(&pdev->dev, "Failed to register ts mmi\n");
return ret;
}
core_data->imports = &goodix_ts_mmi_methods.exports;
return 0;
}
@@ -13,9 +13,19 @@
#ifndef __GOODIX_TS_MMI_H__
#define __GOODIX_TS_MMI_H__
#include "goodix_ts_core.h"
#include <linux/platform_device.h>
#include <linux/touchscreen_mmi.h>
extern int goodix_ts_mmi_dev_register(struct platform_device *ts_device);
extern void goodix_ts_mmi_dev_unregister(struct platform_device *ts_device);
#ifdef CONFIG_INPUT_TOUCHSCREEN_MMI
int goodix_ts_mmi_dev_register(struct platform_device *ts_device);
void goodix_ts_mmi_dev_unregister(struct platform_device *ts_device);
#else
static int inline goodix_ts_mmi_dev_register(struct platform_device *ts_device) {
return -ENOSYS;
}
static void inline goodix_ts_mmi_dev_unregister(struct platform_device *ts_device) {
return -ENOSYS;
}
#endif
#endif