summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongwoo Lee <dwoo08.lee@samsung.com>2020-03-17 11:39:31 +0900
committerDongwoo Lee <dwoo08.lee@samsung.com>2020-03-17 11:59:52 +0900
commitc0dd00d92642d3ae650c69d413984e40277f2f84 (patch)
treefc555f76f13a8627e5252c24cc4d3bda1ff105f7
parentcaf02f3d74d92733aa14a3dac17bce0e8bf0d4f9 (diff)
downloademulator-kernel-c0dd00d92642d3ae650c69d413984e40277f2f84.tar.gz
emulator-kernel-c0dd00d92642d3ae650c69d413984e40277f2f84.tar.bz2
emulator-kernel-c0dd00d92642d3ae650c69d413984e40277f2f84.zip
Until Tizen 5.0, for detent/bezel input device, its event value was in between -2 and 2, but value 1, meant starting movement to counter clockwise or clockwise, and value -1, meant moving back to original position, never used. Change event value of the detent/bezel device for Tizen 5.5 and later version. It changes detent/bezel input driver event interface, so user input framework for detent/bezel input should be also changed. Ref: https://review.tizen.org/gerrit/#/c/platform/upstream/enlightenment/+/220346/ Change-Id: Iaa8e76de94eb4254820d93865dab9d4f7006f4e4 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com> Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
-rw-r--r--drivers/maru/maru_virtio_rotary.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/maru/maru_virtio_rotary.c b/drivers/maru/maru_virtio_rotary.c
index 6e193e198294..ff47408c8228 100644
--- a/drivers/maru/maru_virtio_rotary.c
+++ b/drivers/maru/maru_virtio_rotary.c
@@ -69,6 +69,14 @@ static struct virtio_device_id id_table[] = {
{ 0 },
};
+enum rotary_event_type {
+ ROTARY_EVENT_CCW = -1, /* Counter-ClockWise movement */
+ ROTARY_EVENT_RETURN = 0, /* ignore event for returning */
+ ROTARY_EVENT_NA = 0, /* not to send event */
+ ROTARY_EVENT_LEAVE = 0, /* ignore event for leaving */
+ ROTARY_EVENT_CW = 1, /* ClockWise movement */
+};
+
#define DETENT_UNIT (15)
#define REMAINDER(n, div) ({ \
typeof(n) _n = (n) % (div); \
@@ -128,20 +136,20 @@ static void vq_rotary_callback(struct virtqueue *vq)
for (i = 1; i <= abs(event->delta); i++) {
value = (event->delta > 0) ? last_pos + i : last_pos - i;
if ((value % DETENT_UNIT) == 0) {
- input_report_rel(vrtr->idev, REL_WHEEL, 1);
+ input_report_rel(vrtr->idev, REL_WHEEL, ROTARY_EVENT_LEAVE);
input_sync(vrtr->idev);
if (get_rotary_pos(value) != last_detent) {
last_detent = get_rotary_pos(value);
if (event->delta > 0) { /* CW */
input_report_rel(vrtr->idev,
- REL_WHEEL, 2);
+ REL_WHEEL, ROTARY_EVENT_CW);
} else { /* CCW */
input_report_rel(vrtr->idev,
- REL_WHEEL, -2);
+ REL_WHEEL, ROTARY_EVENT_CCW);
}
} else {
input_report_rel(vrtr->idev,
- REL_WHEEL, -1);
+ REL_WHEEL, ROTARY_EVENT_RETURN);
}
input_sync(vrtr->idev);