diff options
author | davidycchen <davidycchen@google.com> | 2022-03-01 15:43:39 +0800 |
---|---|---|
committer | davidycchen <davidycchen@google.com> | 2022-03-02 10:42:12 +0800 |
commit | c7d2ef4eb0422da47f881aa773fa78757855a8e2 (patch) | |
tree | 634feafd009c358c06dab3f046becbf6c5bee11a /syna_tcm2.c | |
parent | df62c0c6d6af7052fcbd62f270fe9224daad34f2 (diff) | |
download | synaptics_touch-c7d2ef4eb0422da47f881aa773fa78757855a8e2.tar.gz |
synaptics: report major and minor in display pixels
Read the resolution from device tree and report touch major and minor
in display pixels.
Bug: 221383103
Test: adb shell getevelt -lt
Signed-off-by: davidycchen <davidycchen@google.com>
Change-Id: I17f095509c36501f65f3428f98a6fb10328d40d9
Diffstat (limited to 'syna_tcm2.c')
-rw-r--r-- | syna_tcm2.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/syna_tcm2.c b/syna_tcm2.c index 61d98c8..53169e4 100644 --- a/syna_tcm2.c +++ b/syna_tcm2.c @@ -662,6 +662,10 @@ static void syna_dev_report_input_events(struct syna_tcm *tcm) wx = object_data[idx].x_width; wy = object_data[idx].y_width; + /* Report major and minor in display pixels. */ + wx = wx * tcm->hw_if->pixels_per_mm; + wy = wy * tcm->hw_if->pixels_per_mm; + if (object_data[idx].z == 0) { z = 1; LOGW("Get a touch coordinate with pressure = 0"); @@ -811,9 +815,9 @@ static int syna_dev_create_input_device(struct syna_tcm *tcm) #ifdef REPORT_TOUCH_WIDTH input_set_abs_params(input_dev, - ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); + ABS_MT_TOUCH_MAJOR, 0, tcm_dev->max_x, 0, 0); input_set_abs_params(input_dev, - ABS_MT_TOUCH_MINOR, 0, 255, 0, 0); + ABS_MT_TOUCH_MINOR, 0, tcm_dev->max_y, 0, 0); #endif tcm->input_dev_params.max_x = tcm_dev->max_x; |