diff options
author | lsmin.lee <lsmin.lee@samsung.com> | 2020-01-03 18:31:42 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2020-03-23 10:10:59 +0900 |
commit | ecee731b00fad9dd97d883c82f13d7bef4e0ba33 (patch) | |
tree | 5174cb1e8cd1e0ce8c7dcccb04bdf11518a786be | |
parent | bfba65616636abf6a4d3029723c0cf3cc632a473 (diff) | |
download | linux-4.9-exynos9110-tizen_5.5_wearable_hotfix.tar.gz linux-4.9-exynos9110-tizen_5.5_wearable_hotfix.tar.bz2 linux-4.9-exynos9110-tizen_5.5_wearable_hotfix.zip |
Input: tizen_bezel: Change event value of the bezel devicesubmit/tizen_5.5_wearable_hotfix/20201027.114701submit/tizen_5.5_wearable_hotfix/20201026.1843010submit/tizen_5.5/20200323.012542accepted/tizen/5.5/unified/wearable/hotfix/20201027.091924accepted/tizen/5.5/unified/20200324.134452tizen_5.5_wearable_hotfixaccepted/tizen_5.5_unified_wearable_hotfixaccepted/tizen_5.5_unified
Until Tizen 5.0, for bezel input device, its event value was in
between -2 and 2, but value 1. meant starting movement to
counter clockwiseare or clockwise, and value -1, meant moving back
to original position, never used. Change event value of the bezel
device for Tizen 5.5 and later version.
It changes bezel input driver event interface, so user input
framework for bezel input should be also changed.
Ref: https://review.tizen.org/gerrit/#/c/platform/upstream/enlightenment/+/220346/
Signed-off-by: lsmin.lee <lsmin.lee@samsung.com>
[sw0312.kim: adjust commit-msg to public style]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I1293db138c71d2a5c4f52b827f3a441b47710449
-rw-r--r-- | drivers/input/misc/input_assistant.c | 17 | ||||
-rw-r--r-- | drivers/input/misc/tizen_bezel.c | 24 |
2 files changed, 22 insertions, 19 deletions
diff --git a/drivers/input/misc/input_assistant.c b/drivers/input/misc/input_assistant.c index 2630a4525b74..5a93e69bdb76 100644 --- a/drivers/input/misc/input_assistant.c +++ b/drivers/input/misc/input_assistant.c @@ -157,17 +157,16 @@ static void input_assistant_key_logger(struct input_handle *handle, } } +#define MAX_dir_str 3 static void input_assistant_bezel_logger(struct input_handle *handle, const struct input_value *vals, unsigned int count) { struct input_handler *handler = handle->handler; struct input_assistant_data *data = handler->private; - int i, wheel = 0, x = 0; - const char* direction_str[] = { + int i, wheel = 0, x = 0, update = 0; + const char* dir_str[MAX_dir_str] = { "ccw", - "return", "none", - "leave", "cw", }; @@ -179,7 +178,8 @@ static void input_assistant_bezel_logger(struct input_handle *handle, switch (vals[i].code) { case REL_WHEEL: - wheel = vals[i].value; + wheel = vals[i].value+1; + update = true; break; case REL_X: x = ~vals[i].value & 0x07; @@ -187,7 +187,12 @@ static void input_assistant_bezel_logger(struct input_handle *handle, } } - pr_info("%s: state:[%d][%s]\n", __func__, x, direction_str[wheel+2]); + if (update) { + if (((wheel) >= MAX_dir_str) || ((wheel) < 0)) + pr_err("%s: invalid state:[%d][%d]\n", __func__, x, wheel-1); + else + pr_info("%s: state:[%d][%s]\n", __func__, x, dir_str[wheel]); + } } static void input_assistant_events(struct input_handle *handle, diff --git a/drivers/input/misc/tizen_bezel.c b/drivers/input/misc/tizen_bezel.c index 3d879016f5ea..3dc15e247447 100644 --- a/drivers/input/misc/tizen_bezel.c +++ b/drivers/input/misc/tizen_bezel.c @@ -42,12 +42,10 @@ extern struct class *sec_class; #endif -enum direction_patten { - BZ_CC = -2, - BZ_RT = -1, +enum bezel_event { + BZ_CC = -1, BZ_NA = 0, - BZ_LV = 1, - BZ_CW = 2, + BZ_CW = 1, BZ_MAX, }; @@ -66,21 +64,21 @@ static void bezel_close(struct input_dev *input); static int bezel_get_direction(struct bezel_ddata *ddata, int value) { - const int magic_pattern[Status_MAX][Status_MAX] = { - {BZ_RT, BZ_LV, BZ_LV, BZ_NA, BZ_LV,}, - {BZ_LV, BZ_RT, BZ_CC, BZ_NA, BZ_CW,}, - {BZ_LV, BZ_CW, BZ_RT, BZ_NA, BZ_CC,}, + const int dir_ptrn[Status_MAX][Status_MAX] = { {BZ_NA, BZ_NA, BZ_NA, BZ_NA, BZ_NA,}, - {BZ_LV, BZ_CC, BZ_CW, BZ_NA, BZ_RT,} }; + {BZ_NA, BZ_NA, BZ_CC, BZ_NA, BZ_CW,}, + {BZ_NA, BZ_CW, BZ_NA, BZ_NA, BZ_CC,}, + {BZ_NA, BZ_NA, BZ_NA, BZ_NA, BZ_NA,}, + {BZ_NA, BZ_CC, BZ_CW, BZ_NA, BZ_NA,} }; if ((ddata->last_status >= Status_MAX) || (ddata->last_status <= Status_S)) - return BZ_RT; + return BZ_NA; if ((value >= Status_MAX) || (value < Status_S)) - return BZ_RT; + return BZ_NA; - return magic_pattern[value][ddata->last_status]; + return dir_ptrn[value][ddata->last_status]; } static int bezel_get_status(struct bezel_ddata *ddata) |