mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
input: touchscreen: chipone_tddi_v2_mmi: Rework gesture node
Make gesture_show actually report the current enabled gestures and move away from supported_gesture_type since that is just hardcoded in dts. Rewrite gesture_store so that we are can toggle dt2w from userspace with a simple 0/1 write. Change-Id: I54b5f813fbed4466d2a89e6acdb07ecab65585be
This commit is contained in:
parent
fae4566d40
commit
1b6d988183
4 changed files with 5 additions and 29 deletions
|
|
@ -467,7 +467,6 @@ struct chipone_ts_data {
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL
|
||||
unsigned char gesture_mode_type;
|
||||
bool d_tap_flag;
|
||||
bool s_tap_flag;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -652,10 +652,6 @@ static int cts_plat_parse_dt(struct cts_platform_data *pdata,
|
|||
cts_info("panel supplier=%s", (char *)pdata->panel_supplier);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL
|
||||
if (!of_property_read_u32(dev_node, "chipone,supported_gesture_type", &pdata->supported_gesture_type))
|
||||
cts_info("chipone,supported_gesture_type=%02x\n", pdata->supported_gesture_type);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_CTS_OF */
|
||||
|
|
|
|||
|
|
@ -152,10 +152,6 @@ struct cts_platform_data {
|
|||
u32 spi_speed;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL
|
||||
int supported_gesture_type;
|
||||
#endif
|
||||
|
||||
#ifdef CTS_STOWED_MODE_EN
|
||||
int stowed_set;
|
||||
int stowed_get;
|
||||
|
|
|
|||
|
|
@ -3128,7 +3128,7 @@ static ssize_t gesture_show(struct device *dev,
|
|||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct chipone_ts_data *cts_data = dev_get_drvdata(dev);
|
||||
return scnprintf(buf, PAGE_SIZE, "%02x\n", cts_data->pdata->supported_gesture_type);
|
||||
return scnprintf(buf, PAGE_SIZE, "%u\n", cts_data->d_tap_flag);
|
||||
}
|
||||
|
||||
static ssize_t gesture_store(struct device *dev,
|
||||
|
|
@ -3147,29 +3147,14 @@ static ssize_t gesture_store(struct device *dev,
|
|||
}
|
||||
|
||||
switch (value) {
|
||||
case 0x10:
|
||||
cts_info("[%s %d]: zero tap disable", __func__, __LINE__);
|
||||
break;
|
||||
case 0x11:
|
||||
break;
|
||||
case 0x20:
|
||||
cts_info("[%s %d]: single tap disable", __func__, __LINE__);
|
||||
case 1:
|
||||
cts_data->s_tap_flag = 0;
|
||||
break;
|
||||
case 0x21:
|
||||
cts_info("[%s %d]: single tap enable", __func__, __LINE__);
|
||||
cts_data->s_tap_flag = 1;
|
||||
break;
|
||||
case 0x30:
|
||||
cts_info("[%s %d]: double tap disable", __func__, __LINE__);
|
||||
cts_data->d_tap_flag = 0;
|
||||
break;
|
||||
case 0x31:
|
||||
cts_info("[%s %d]: double tap enable", __func__, __LINE__);
|
||||
cts_data->d_tap_flag = 1;
|
||||
break;
|
||||
default:
|
||||
cts_info("[%s %d]: unsupport gesture mode type", __func__, __LINE__);
|
||||
cts_data->s_tap_flag = 0;
|
||||
cts_data->d_tap_flag = 0;
|
||||
break;
|
||||
}
|
||||
cts_unlock_device(&cts_data->cts_dev);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue