Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5de04798 authored by Shantanu Jain's avatar Shantanu Jain Committed by Sudhakar Manapati
Browse files

input: touchscreen: Add virtual key support from dtsi



Add virtual key support from device tree node and
corrected the sequence of virtual keys defined in
dtsi for Goodix driver.

CRs-fixed: 567499

This patch is propagated from msm-3.10 kernel.
(commit: 5ba42fbc2361865df5374d3306533d71c443fbb2
input: touchscreen: Add virtual key support from dtsi)

Change-Id: Iee1db2eb07c00fd4338255b9648fac5e05aa9c6d
Signed-off-by: default avatarShantanu Jain <shjain@codeaurora.org>
Signed-off-by: default avatarSudhakar Manapati <smanap@codeaurora.org>
parent 6ac16410
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -490,18 +490,19 @@ static void goodix_ts_work_func(struct work_struct *work)
		memcpy(&point_data[12], &buf[2], 8 * (touch_num - 1));
	}

#if GTP_HAVE_TOUCH_KEY

	key_value = point_data[3 + 8 * touch_num];

	if (key_value || pre_key) {
		for (i = 0; i < GTP_MAX_KEY_NUM; i++) {
		for (i = 0; i < ts->pdata->num_button; i++) {
			input_report_key(ts->input_dev,
				touch_key_array[i], key_value & (0x01<<i));
				ts->pdata->button_map[i],
				key_value & (0x01<<i));
		}
		touch_num = 0;
		pre_touch = 0;
	}
#endif

	pre_key = key_value;

#if GTP_WITH_PEN
@@ -1215,12 +1216,12 @@ static int gtp_request_input_dev(struct goodix_ts_data *ts)
	/* in case of "out of memory" */
	input_mt_init_slots(ts->input_dev, 10, 0);

#if GTP_HAVE_TOUCH_KEY
	for (index = 0; index < GTP_MAX_KEY_NUM; index++) {

	for (index = 0; index < ts->pdata->num_button; index++) {
		input_set_capability(ts->input_dev,
				EV_KEY, touch_key_array[index]);
				EV_KEY, ts->pdata->button_map[index]);
	}
#endif


#if GTP_SLIDE_WAKEUP
	input_set_capability(ts->input_dev, EV_KEY, KEY_POWER);
@@ -1614,6 +1615,9 @@ static int goodix_parse_dt(struct device *dev,
			dev_err(dev, "Unable to read key codes\n");
			return rc;
		}
		pdata->num_button = num_buttons;
		memcpy(pdata->button_map, button_map,
			pdata->num_button * sizeof(u32));
	}

	read_cfg_num = 0;
+3 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@
#define GOODIX_SUSPEND_LEVEL 1
#endif

#define MAX_BUTTONS 4
#define GOODIX_MAX_CFG_GROUP	6
#define GTP_FW_NAME_MAXSIZE	50

@@ -67,6 +68,8 @@ struct goodix_ts_platform_data {
	bool i2c_pull_up;
	size_t config_data_len[GOODIX_MAX_CFG_GROUP];
	u8 *config_data[GOODIX_MAX_CFG_GROUP];
	u32 button_map[MAX_BUTTONS];
	u8 num_button;
};
struct goodix_ts_data {
	spinlock_t irq_lock;