diff --git a/drivers/input/touchscreen/goodix_berlin_mmi/Android.mk b/drivers/input/touchscreen/goodix_berlin_mmi/Android.mk index e80d79b73cb1..6dc4ac6e2cb5 100644 --- a/drivers/input/touchscreen/goodix_berlin_mmi/Android.mk +++ b/drivers/input/touchscreen/goodix_berlin_mmi/Android.mk @@ -42,8 +42,12 @@ ifeq ($(TOUCHSCREEN_LAST_TIME),true) endif ifeq ($(GTP_ENABLE_DDA_STYLUS),true) +ifeq ($(MOTO_DDA_PASSIVE_STYLUS),true) + KBUILD_OPTIONS += CONFIG_MOTO_DDA_PASSIVE_STYLUS=y +else KBUILD_OPTIONS += CONFIG_GTP_DDA_STYLUS=y endif +endif ifeq ($(BOARD_USES_DOUBLE_TAP_CTRL),true) KBUILD_OPTIONS += CONFIG_BOARD_USES_DOUBLE_TAP_CTRL=y diff --git a/drivers/input/touchscreen/goodix_berlin_mmi/Kbuild b/drivers/input/touchscreen/goodix_berlin_mmi/Kbuild index 83424714ee09..65bf4824597e 100644 --- a/drivers/input/touchscreen/goodix_berlin_mmi/Kbuild +++ b/drivers/input/touchscreen/goodix_berlin_mmi/Kbuild @@ -60,6 +60,10 @@ ifneq ($(filter m y,$(CONFIG_GTP_DDA_STYLUS)),) goodix_brl_mmi-objs += goodix_ts_dda.o endif +ifneq ($(filter m y,$(CONFIG_MOTO_DDA_PASSIVE_STYLUS)),) + EXTRA_CFLAGS += -DCONFIG_MOTO_DDA_PASSIVESTYLUS +endif + ifneq ($(filter m y,$(CONFIG_INPUT_TOUCHSCREEN_MMI)),) EXTRA_CFLAGS += -DCONFIG_INPUT_TOUCHSCREEN_MMI goodix_brl_mmi-objs += goodix_ts_mmi.o diff --git a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_core.c b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_core.c index 06a2f830ab72..63e3b76c6a12 100644 --- a/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_core.c +++ b/drivers/input/touchscreen/goodix_berlin_mmi/goodix_ts_core.c @@ -1266,6 +1266,10 @@ static void goodix_ts_report_finger(struct input_dev *dev, touch_data->coords[i].y); input_report_abs(dev, ABS_MT_TOUCH_MAJOR, touch_data->coords[i].w); +#ifdef CONFIG_MOTO_DDA_PASSIVESTYLUS + input_report_abs(dev, ABS_MT_PRESSURE, + touch_data->coords[i].w); +#endif } else { if (touchdown[i] == 1) { ts_debug("TOUCH: [%d] release\n", i); @@ -1715,6 +1719,10 @@ static int goodix_ts_input_dev_config(struct goodix_ts_core *core_data) 0, ts_bdata->panel_max_y, 0, 0); input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, ts_bdata->panel_max_w, 0, 0); +#ifdef CONFIG_MOTO_DDA_PASSIVESTYLUS + input_set_abs_params(input_dev, ABS_MT_PRESSURE, + 0, ts_bdata->panel_max_w, 0, 0); +#endif #ifdef CONFIG_ENABLE_GTP_PALM_CANCEL input_set_abs_params(input_dev, ABS_MT_TOOL_TYPE, MT_TOOL_FINGER, MT_TOOL_PALM, 0, 0);