Revert "drivers: input: add switch for ForceTouch handler"
This reverts commit 0323920c62
.
This commit is contained in:
parent
cec028d9b3
commit
29db836c37
6 changed files with 34 additions and 118 deletions
|
@ -1424,28 +1424,26 @@ static void sec_ts_read_event(struct sec_ts_data *ts)
|
|||
}
|
||||
#else
|
||||
if (ts->power_status == SEC_TS_STATE_POWER_ON ) {
|
||||
if (ts->pressure_status) {
|
||||
if (p_gesture_status->gesture_id == SEC_TS_EVENT_PRESSURE_RELEASED) {
|
||||
input_report_key(ts->input_dev, KEY_HOMEPAGE, 0);
|
||||
input_report_key(ts->input_dev, KEY_BLACK_UI_GESTURE, 1);
|
||||
ts->scrub_id = SPONGE_EVENT_TYPE_AOD_HOMEKEY_RELEASE_NO_HAPTIC;
|
||||
input_sync(ts->input_dev);
|
||||
if (p_gesture_status->gesture_id == SEC_TS_EVENT_PRESSURE_RELEASED) {
|
||||
input_report_key(ts->input_dev, KEY_HOMEPAGE, 0);
|
||||
input_report_key(ts->input_dev, KEY_BLACK_UI_GESTURE, 1);
|
||||
ts->scrub_id = SPONGE_EVENT_TYPE_AOD_HOMEKEY_RELEASE_NO_HAPTIC;
|
||||
input_sync(ts->input_dev);
|
||||
|
||||
haptic_homekey_release();
|
||||
} else {
|
||||
input_report_key(ts->input_dev, KEY_HOMEPAGE, 1);
|
||||
ts->scrub_id = SPONGE_EVENT_TYPE_AOD_HOMEKEY_PRESS;
|
||||
input_sync(ts->input_dev);
|
||||
haptic_homekey_release();
|
||||
} else {
|
||||
input_report_key(ts->input_dev, KEY_HOMEPAGE, 1);
|
||||
ts->scrub_id = SPONGE_EVENT_TYPE_AOD_HOMEKEY_PRESS;
|
||||
input_sync(ts->input_dev);
|
||||
|
||||
haptic_homekey_press();
|
||||
ts->all_force_count++;
|
||||
}
|
||||
|
||||
if (ts->pressure_setting_mode)
|
||||
input_dbg(true, &ts->client->dev, "%s: skip force events in pressure setting mode\n", __func__);
|
||||
else
|
||||
input_report_key(ts->input_dev, KEY_BLACK_UI_GESTURE, 1);
|
||||
haptic_homekey_press();
|
||||
ts->all_force_count++;
|
||||
}
|
||||
|
||||
if (ts->pressure_setting_mode)
|
||||
input_dbg(true, &ts->client->dev, "%s: skip force events in pressure setting mode\n", __func__);
|
||||
else
|
||||
input_report_key(ts->input_dev, KEY_BLACK_UI_GESTURE, 1);
|
||||
} else {
|
||||
if (p_gesture_status->gesture_id == SEC_TS_EVENT_PRESSURE_RELEASED) {
|
||||
input_report_key(ts->input_dev, KEY_HOMEPAGE, 0);
|
||||
|
|
|
@ -828,9 +828,6 @@ struct sec_ts_data {
|
|||
int irq_count;
|
||||
|
||||
#ifdef USE_PRESSURE_SENSOR
|
||||
#ifdef CONFIG_CUSTOM_FORCETOUCH
|
||||
bool pressure_status;
|
||||
#endif
|
||||
short pressure_left;
|
||||
short pressure_center;
|
||||
short pressure_right;
|
||||
|
|
|
@ -57,9 +57,6 @@ static void get_force_calibration(void *device_data);
|
|||
static void get_gap_data_x_all(void *device_data);
|
||||
static void get_gap_data_y_all(void *device_data);
|
||||
#ifdef USE_PRESSURE_SENSOR
|
||||
#ifdef CONFIG_CUSTOM_FORCETOUCH
|
||||
static void set_pressure_status_mode(void *device_data);
|
||||
#endif
|
||||
static void run_force_pressure_calibration(void *device_data);
|
||||
static void get_pressure_calibration_count(void *device_data);
|
||||
static void set_pressure_test_mode(void *device_data);
|
||||
|
@ -170,9 +167,6 @@ static struct sec_cmd sec_cmds[] = {
|
|||
{SEC_CMD("get_gap_data_x_all", get_gap_data_x_all),},
|
||||
{SEC_CMD("get_gap_data_y_all", get_gap_data_y_all),},
|
||||
#ifdef USE_PRESSURE_SENSOR
|
||||
#ifdef CONFIG_CUSTOM_FORCETOUCH
|
||||
{SEC_CMD("set_pressure_status_mode", set_pressure_status_mode),},
|
||||
#endif
|
||||
{SEC_CMD("run_force_pressure_calibration", run_force_pressure_calibration),},
|
||||
{SEC_CMD("get_pressure_calibration_count", get_pressure_calibration_count),},
|
||||
{SEC_CMD("set_pressure_test_mode", set_pressure_test_mode),},
|
||||
|
@ -5837,37 +5831,6 @@ static void get_force_calibration(void *device_data)
|
|||
}
|
||||
|
||||
#ifdef USE_PRESSURE_SENSOR
|
||||
#ifdef CONFIG_CUSTOM_FORCETOUCH
|
||||
static void set_pressure_status_mode(void *device_data)
|
||||
{
|
||||
struct sec_cmd_data *sec = (struct sec_cmd_data *)device_data;
|
||||
struct sec_ts_data *ts = container_of(sec, struct sec_ts_data, sec);
|
||||
char buff[SEC_CMD_STR_LEN] = {0};
|
||||
|
||||
sec_cmd_set_default_result(sec);
|
||||
|
||||
if (ts->power_status == SEC_TS_STATE_POWER_OFF) {
|
||||
input_err(true, &ts->client->dev, "%s: Touch is stopped!\n", __func__);
|
||||
snprintf(buff, sizeof(buff), "%s", "TSP turned off");
|
||||
sec_cmd_set_cmd_result(sec, buff, strnlen(buff, sizeof(buff)));
|
||||
sec->cmd_state = SEC_CMD_STATUS_NOT_APPLICABLE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sec->cmd_param[0] == 1)
|
||||
ts->pressure_status = 1;
|
||||
else
|
||||
ts->pressure_status = 0;
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s", "OK");
|
||||
sec->cmd_state = SEC_CMD_STATUS_OK;
|
||||
|
||||
sec_cmd_set_cmd_result(sec, buff, strnlen(buff, sizeof(buff)));
|
||||
|
||||
input_info(true, &ts->client->dev, "%s: %s\n", __func__, buff);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void run_force_pressure_calibration(void *device_data)
|
||||
{
|
||||
struct sec_cmd_data *sec = (struct sec_cmd_data *)device_data;
|
||||
|
|
|
@ -1434,28 +1434,26 @@ static void sec_ts_read_event(struct sec_ts_data *ts)
|
|||
}
|
||||
#else
|
||||
if (ts->power_status == SEC_TS_STATE_POWER_ON) {
|
||||
if (ts->pressure_status) {
|
||||
if (p_gesture_status->gesture_id == SEC_TS_EVENT_PRESSURE_RELEASED) {
|
||||
input_report_key(ts->input_dev, KEY_HOMEPAGE, 0);
|
||||
input_report_key(ts->input_dev, KEY_BLACK_UI_GESTURE, 1);
|
||||
ts->scrub_id = SPONGE_EVENT_TYPE_AOD_HOMEKEY_RELEASE_NO_HAPTIC;
|
||||
input_sync(ts->input_dev);
|
||||
if (p_gesture_status->gesture_id == SEC_TS_EVENT_PRESSURE_RELEASED) {
|
||||
input_report_key(ts->input_dev, KEY_HOMEPAGE, 0);
|
||||
input_report_key(ts->input_dev, KEY_BLACK_UI_GESTURE, 1);
|
||||
ts->scrub_id = SPONGE_EVENT_TYPE_AOD_HOMEKEY_RELEASE_NO_HAPTIC;
|
||||
input_sync(ts->input_dev);
|
||||
|
||||
haptic_homekey_release();
|
||||
} else {
|
||||
input_report_key(ts->input_dev, KEY_HOMEPAGE, 1);
|
||||
ts->scrub_id = SPONGE_EVENT_TYPE_AOD_HOMEKEY_PRESS;
|
||||
input_sync(ts->input_dev);
|
||||
haptic_homekey_release();
|
||||
} else {
|
||||
input_report_key(ts->input_dev, KEY_HOMEPAGE, 1);
|
||||
ts->scrub_id = SPONGE_EVENT_TYPE_AOD_HOMEKEY_PRESS;
|
||||
input_sync(ts->input_dev);
|
||||
|
||||
haptic_homekey_press();
|
||||
ts->all_force_count++;
|
||||
}
|
||||
|
||||
if (ts->pressure_setting_mode)
|
||||
input_dbg(true, &ts->client->dev, "%s: skip force events in pressure setting mode\n", __func__);
|
||||
else
|
||||
input_report_key(ts->input_dev, KEY_BLACK_UI_GESTURE, 1);
|
||||
haptic_homekey_press();
|
||||
ts->all_force_count++;
|
||||
}
|
||||
|
||||
if (ts->pressure_setting_mode)
|
||||
input_dbg(true, &ts->client->dev, "%s: skip force events in pressure setting mode\n", __func__);
|
||||
else
|
||||
input_report_key(ts->input_dev, KEY_BLACK_UI_GESTURE, 1);
|
||||
} else {
|
||||
if (p_gesture_status->gesture_id == SEC_TS_EVENT_PRESSURE_RELEASED) {
|
||||
input_report_key(ts->input_dev, KEY_HOMEPAGE, 0);
|
||||
|
|
|
@ -881,9 +881,6 @@ struct sec_ts_data {
|
|||
int irq_unhandled;
|
||||
|
||||
#ifdef USE_PRESSURE_SENSOR
|
||||
#ifdef CONFIG_CUSTOM_FORCETOUCH
|
||||
bool pressure_status;
|
||||
#endif
|
||||
short pressure_left;
|
||||
short pressure_center;
|
||||
short pressure_right;
|
||||
|
|
|
@ -59,9 +59,6 @@ static void get_force_calibration(void *device_data);
|
|||
static void get_gap_data_x_all(void *device_data);
|
||||
static void get_gap_data_y_all(void *device_data);
|
||||
#ifdef USE_PRESSURE_SENSOR
|
||||
#ifdef CONFIG_CUSTOM_FORCETOUCH
|
||||
static void set_pressure_status_mode(void *device_data);
|
||||
#endif
|
||||
static void run_force_pressure_calibration(void *device_data);
|
||||
static void get_pressure_calibration_count(void *device_data);
|
||||
static void set_pressure_test_mode(void *device_data);
|
||||
|
@ -176,9 +173,6 @@ static struct sec_cmd sec_cmds[] = {
|
|||
{SEC_CMD("get_gap_data_x_all", get_gap_data_x_all),},
|
||||
{SEC_CMD("get_gap_data_y_all", get_gap_data_y_all),},
|
||||
#ifdef USE_PRESSURE_SENSOR
|
||||
#ifdef CONFIG_CUSTOM_FORCETOUCH
|
||||
{SEC_CMD("set_pressure_status_mode", set_pressure_status_mode),},
|
||||
#endif
|
||||
{SEC_CMD("run_force_pressure_calibration", run_force_pressure_calibration),},
|
||||
{SEC_CMD("get_pressure_calibration_count", get_pressure_calibration_count),},
|
||||
{SEC_CMD("set_pressure_test_mode", set_pressure_test_mode),},
|
||||
|
@ -6171,37 +6165,6 @@ static void get_force_calibration(void *device_data)
|
|||
}
|
||||
|
||||
#ifdef USE_PRESSURE_SENSOR
|
||||
#ifdef CONFIG_CUSTOM_FORCETOUCH
|
||||
static void set_pressure_status_mode(void *device_data)
|
||||
{
|
||||
struct sec_cmd_data *sec = (struct sec_cmd_data *)device_data;
|
||||
struct sec_ts_data *ts = container_of(sec, struct sec_ts_data, sec);
|
||||
char buff[SEC_CMD_STR_LEN] = {0};
|
||||
|
||||
sec_cmd_set_default_result(sec);
|
||||
|
||||
if (ts->power_status == SEC_TS_STATE_POWER_OFF) {
|
||||
input_err(true, &ts->client->dev, "%s: Touch is stopped!\n", __func__);
|
||||
snprintf(buff, sizeof(buff), "%s", "TSP turned off");
|
||||
sec_cmd_set_cmd_result(sec, buff, strnlen(buff, sizeof(buff)));
|
||||
sec->cmd_state = SEC_CMD_STATUS_NOT_APPLICABLE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sec->cmd_param[0] == 1)
|
||||
ts->pressure_status = 1;
|
||||
else
|
||||
ts->pressure_status = 0;
|
||||
|
||||
snprintf(buff, sizeof(buff), "%s", "OK");
|
||||
sec->cmd_state = SEC_CMD_STATUS_OK;
|
||||
|
||||
sec_cmd_set_cmd_result(sec, buff, strnlen(buff, sizeof(buff)));
|
||||
|
||||
input_info(true, &ts->client->dev, "%s: %s\n", __func__, buff);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void run_force_pressure_calibration(void *device_data)
|
||||
{
|
||||
struct sec_cmd_data *sec = (struct sec_cmd_data *)device_data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue