diff --git a/drivers/input/touchscreen/goodix_gtx8_v1430_mmi/Android.mk b/drivers/input/touchscreen/goodix_gtx8_v1430_mmi/Android.mk index 5b450ab95b03..0a5d7b52afd2 100644 --- a/drivers/input/touchscreen/goodix_gtx8_v1430_mmi/Android.mk +++ b/drivers/input/touchscreen/goodix_gtx8_v1430_mmi/Android.mk @@ -1,6 +1,10 @@ DLKM_DIR := motorola/kernel/modules LOCAL_PATH := $(call my-dir) +ifneq ($(findstring touchscreen_mmi.ko,$(BOARD_VENDOR_KERNEL_MODULES)),) + KERNEL_CFLAGS += CONFIG_INPUT_TOUCHSCREEN_MMI=y +endif + include $(CLEAR_VARS) LOCAL_MODULE := goodix_v1430_mmi.ko LOCAL_MODULE_TAGS := optional diff --git a/drivers/input/touchscreen/goodix_gtx8_v1430_mmi/Kbuild b/drivers/input/touchscreen/goodix_gtx8_v1430_mmi/Kbuild index 8d46291a22ca..0e3670599d36 100644 --- a/drivers/input/touchscreen/goodix_gtx8_v1430_mmi/Kbuild +++ b/drivers/input/touchscreen/goodix_gtx8_v1430_mmi/Kbuild @@ -4,6 +4,10 @@ EXTRA_CFLAGS += \ -I$(TOP)/motorola/kernel/modules/include \ -I$(TOP)/motorola/kernel/modules/drivers/input/touchscreen/goodix_gtx8_v1430_mmi +ifneq ($(filter m y,$(CONFIG_INPUT_TOUCHSCREEN_MMI)),) + EXTRA_CFLAGS += -DCONFIG_INPUT_TOUCHSCREEN_MMI +endif + obj-m := goodix_v1430_mmi.o goodix_v1430_mmi-objs = goodix_ts_i2c.o goodix_ts_core.o goodix_cfg_bin.o diff --git a/drivers/input/touchscreen/goodix_gtx8_v1430_mmi/goodix_ts_core.c b/drivers/input/touchscreen/goodix_gtx8_v1430_mmi/goodix_ts_core.c index f890c14ce6a0..01ebb24fa322 100644 --- a/drivers/input/touchscreen/goodix_gtx8_v1430_mmi/goodix_ts_core.c +++ b/drivers/input/touchscreen/goodix_gtx8_v1430_mmi/goodix_ts_core.c @@ -799,6 +799,7 @@ static const struct attribute_group sysfs_group = { }; +#ifndef CONFIG_INPUT_TOUCHSCREEN_MMI /****/ static ssize_t path_show(struct device *dev, struct device_attribute *pAttr, char *pBuf) { @@ -895,6 +896,7 @@ device_destroy: return -ENODEV; } +#endif static ssize_t goodix_sysfs_config_write(struct file *file, struct kobject *kobj, struct bin_attribute *attr, @@ -987,6 +989,7 @@ static int goodix_ts_sysfs_init(struct goodix_ts_core *core_data) return ret; } +#ifndef CONFIG_INPUT_TOUCHSCREEN_MMI ret = goodix_ts_sysfs_class(core_data->ts_dev, true); if (ret) { sysfs_remove_group(&core_data->pdev->dev.kobj, &sysfs_group); @@ -994,13 +997,16 @@ static int goodix_ts_sysfs_init(struct goodix_ts_core *core_data) &goodix_config_bin_attr); ts_err("sys class files creation failed"); } +#endif return ret; } static void goodix_ts_sysfs_exit(struct goodix_ts_core *core_data) { +#ifndef CONFIG_INPUT_TOUCHSCREEN_MMI goodix_ts_sysfs_class(core_data->ts_dev, false); +#endif sysfs_remove_bin_file(&core_data->pdev->dev.kobj, &goodix_config_bin_attr); sysfs_remove_group(&core_data->pdev->dev.kobj, &sysfs_group);