[huawei-y530] Fix touchscreen (#552)

- Add patch to fix synaptics rmi touchscreen driver
- Disable not needed touchscreen drivers in kernel config
- Add udev rule to detect touchscreen device
This commit is contained in:
drebrez 2017-09-10 13:35:20 +02:00 committed by Oliver Smith
parent 5c3b5ba960
commit a1b840bb71
5 changed files with 96 additions and 28 deletions

View file

@ -0,0 +1,7 @@
# udev rules file
# All device names can be read from weston's logfile (/tmp/weston.log in postmarketOS)
# Touchscreen detection
SUBSYSTEM=="input", ATTRS{name}=="synaptics", \
ENV{ID_INPUT}="1", ENV{ID_INPUT_TOUCHSCREEN}="1"

View file

@ -9,7 +9,11 @@ depends="linux-huawei-y530 mkbootimg"
makedepends=""
install=""
subpackages=""
source="deviceinfo initfs-hook.sh"
source="
deviceinfo
initfs-hook.sh
90-touchscreen-dev.rules
"
options="!check"
package() {
@ -17,7 +21,10 @@ package() {
"$pkgdir"/etc/deviceinfo
install -D -m644 "$srcdir"/initfs-hook.sh \
"$pkgdir"/etc/postmarketos-mkinitfs/hooks/00-${pkgname}.sh
install -D -m644 "$srcdir"/90-touchscreen-dev.rules \
"$pkgdir"/etc/udev/rules.d/90-touchscreen-dev.rules
}
sha512sums="3d75ec32c6021bfe52239ab279899660553ebfcc81305a02750c91b7c3952f02cf9576fbed9f59ed03e5b0513c16924e4382b6fc176a2b359961892468290fb7 deviceinfo
8590967fa10388a890fdfafdb1070b9ab22dc89e06a3a8834806c772191e3b67de7b914b0d68e5ddf581cee715cb90f3f24abcb8762c415ff328c6da23e55d52 initfs-hook.sh"
8590967fa10388a890fdfafdb1070b9ab22dc89e06a3a8834806c772191e3b67de7b914b0d68e5ddf581cee715cb90f3f24abcb8762c415ff328c6da23e55d52 initfs-hook.sh
23414d84cbad63472372986c6ce7db0d98a56ab4c060434b62aef420ed3d6259a968fbbdbd4400663f712e33e6bb81a8424ec7667f9959a089b29b93e15156ea 90-touchscreen-dev.rules"

View file

@ -0,0 +1,74 @@
diff --git a/drivers/input/touchscreen/synaptics_rmi_hw/rmi_f11.c b/drivers/input/touchscreen/synaptics_rmi_hw/rmi_f11.c
index fc20c596..bd4c77ba 100644
--- a/drivers/input/touchscreen/synaptics_rmi_hw/rmi_f11.c
+++ b/drivers/input/touchscreen/synaptics_rmi_hw/rmi_f11.c
@@ -574,6 +574,7 @@ static void rmi_f11_abs_pos_report(struct f11_2d_sensor *sensor,
if (prev_state && !finger_state) {
/* this is a release */
x = y = z = w_max = w_min = orient = 0;
+ input_report_abs(sensor->input, ABS_MT_TRACKING_ID, -1);
} else if (!prev_state && !finger_state) {
/* nothing to report */
return;
@@ -627,38 +628,38 @@ static void rmi_f11_abs_pos_report(struct f11_2d_sensor *sensor,
if (axis_align->clip_Y_high)
y = min(axis_align->clip_Y_high, y);
- }
- x = x * x_lcd / sensor->max_x;
- x = check_scope_x(x);
- y = y * y_lcd_all / sensor->max_y;
- pr_debug("%s: f_state[%d]:%d - x:%d y:%d z:%d w_max:%d w_min:%d max_x:%d max_y:%d \n",
- __func__, n_finger, finger_state, x, y, z, w_max, w_min,sensor->max_x,sensor->max_y);
+ x = x * x_lcd / sensor->max_x;
+ x = check_scope_x(x);
+ y = y * y_lcd_all / sensor->max_y;
+ pr_debug("%s: f_state[%d]:%d - x:%d y:%d z:%d w_max:%d w_min:%d max_x:%d max_y:%d \n",
+ __func__, n_finger, finger_state, x, y, z, w_max, w_min,sensor->max_x,sensor->max_y);
#ifndef CONFIG_RMI4_F11_PEN
- /* Some UIs ignore W of zero, so we fudge it to 1 for pens. */
- if (sensor->sens_query.query9.has_pen &&
- get_tool_type(sensor, finger_state) == MT_TOOL_PEN) {
- w_max = max(1, w_max);
- w_min = max(1, w_min);
- }
+ /* Some UIs ignore W of zero, so we fudge it to 1 for pens. */
+ if (sensor->sens_query.query9.has_pen &&
+ get_tool_type(sensor, finger_state) == MT_TOOL_PEN) {
+ w_max = max(1, w_max);
+ w_min = max(1, w_min);
+ }
#endif
#ifdef ABS_MT_PRESSURE
- input_report_abs(sensor->input, ABS_MT_PRESSURE, z);
+ input_report_abs(sensor->input, ABS_MT_PRESSURE, z);
#endif
- input_report_abs(sensor->input, ABS_MT_TOUCH_MAJOR, w_max);
- input_report_abs(sensor->input, ABS_MT_TOUCH_MINOR, w_min);
- input_report_abs(sensor->input, ABS_MT_ORIENTATION, orient);
- input_report_abs(sensor->input, ABS_MT_POSITION_X, x);
- input_report_abs(sensor->input, ABS_MT_POSITION_Y, y);
- input_report_abs(sensor->input, ABS_MT_TRACKING_ID, n_finger);
+ input_report_abs(sensor->input, ABS_MT_TOUCH_MAJOR, w_max);
+ input_report_abs(sensor->input, ABS_MT_TOUCH_MINOR, w_min);
+ input_report_abs(sensor->input, ABS_MT_ORIENTATION, orient);
+ input_report_abs(sensor->input, ABS_MT_POSITION_X, x);
+ input_report_abs(sensor->input, ABS_MT_POSITION_Y, y);
+ input_report_abs(sensor->input, ABS_MT_TRACKING_ID, n_finger);
#ifdef CONFIG_RMI4_F11_PEN
- if (sensor->sens_query.query9.has_pen) {
- input_report_abs(sensor->input, ABS_MT_TOOL_TYPE,
- get_tool_type(sensor, finger_state));
- }
+ if (sensor->sens_query.query9.has_pen) {
+ input_report_abs(sensor->input, ABS_MT_TOOL_TYPE,
+ get_tool_type(sensor, finger_state));
+ }
#endif
+ }
/* MT sync between fingers */
input_mt_sync(sensor->input);
sensor->finger_tracker[n_finger] = finger_state;

View file

@ -42,6 +42,7 @@ source="
05_fix_mdp3_ctrl_off.patch
06_fix_mdss_fb_rgb_mode.patch
07_fix_mdss_fb_refresh_rate.patch
08_fix_touchscreen.patch
"
subpackages=""
license="GPL2"
@ -123,7 +124,7 @@ package() {
}
sha512sums="e01b96331dbb4d43fb067ecfff1d35b0985cc708f3e8b7fe649c889a6815945e7d5581aa2bb534c7c835562f79d8732ba41279f4712766128d763759a0e1fb0a linux-huawei-y530-1880463bf10c4c2d2b348698614a613902184e22.tar.gz
a19de0f1ee541d29a7721f9d45221d517b063790b8cede3ecf4b2cd86996f6abb9dfe1e0c0399cf5f67f46c61505351ad1d27817af98a4a1e3d86231e5baeaec config-huawei-y530.armhf
cd782099e7174fc132aa35b96e9ffa5ee25f12821eaaecbcfafbd79d8a954ee2ae6d98caf4a6838de64e1f64253eebeacd6176c0478f517f9956d6fa9279c809 config-huawei-y530.armhf
d80980e9474c82ba0ef1a6903b434d8bd1b092c40367ba543e72d2c119301c8b2d05265740e4104ca1ac5d15f6c4aa49e8776cb44264a9a28dc551e0d1850dcc compiler-gcc6.h
ea1d3b5a234fa565e3c1a792de48f4fc4e6023d281d303c8e319c7ef28edc5739ab0e4dea0139a41f0a5c7d03e27921ccaa214fd0ac5c72245a094ce60128864 00_fix_return_address.patch
a2bb98fb8d988bbb659cae00fbaca360828300e9b98b90aed5ee0dd839c3f740696df4094a9021b813cbada06820d115aabed581a47cdd2c947e8d853c20b145 01_timeconst_fix.patch
@ -132,4 +133,5 @@ a2bb98fb8d988bbb659cae00fbaca360828300e9b98b90aed5ee0dd839c3f740696df4094a9021b8
42716cf894445fe02a46a1f26b2faa4d45ffea35e2dfc15acf5ce66fdd67d5faf8201b07ea10716c61c7f900561262731771c7b655f9e95ff7a9273de5746244 04_add_missing_dtb.patch
fbc61e379403990167853f4c4fbdfa22d7e9661a7eedecf2a75eec2a8008991a82d0a61be844ab4b1c88383f3fa79b43eff10b1039e44ad5a758a173cbf6386b 05_fix_mdp3_ctrl_off.patch
384ae0bf2f5d7e15b0b60655693fd600b52c0f5bfcaa4ba7336d0ebeb224e84b99b597f77d26a1249e14a4e7bbc1629be00556b393bb9dd2266cb4bd67c3cfea 06_fix_mdss_fb_rgb_mode.patch
1f743d3e7f4ac7401167ea35edc7d7e113bd80824c4d53631d7500f33557ff486163f8244786c16506b2e21db6ccbcd8a0f7b26fcf4937efee50b62c074f9a22 07_fix_mdss_fb_refresh_rate.patch"
1f743d3e7f4ac7401167ea35edc7d7e113bd80824c4d53631d7500f33557ff486163f8244786c16506b2e21db6ccbcd8a0f7b26fcf4937efee50b62c074f9a22 07_fix_mdss_fb_refresh_rate.patch
f83e9b6549155a2f32c89dffbab3ad6fba7b8d93976dfccb1232833244ed6e064e28105a321eaa934c5bb326384730d03f3d3141227a7258a30045fa12573268 08_fix_touchscreen.patch"

View file

@ -1512,9 +1512,7 @@ CONFIG_INPUT_TOUCHSCREEN=y
# CONFIG_TOUCHSCREEN_FT5X06 is not set
# CONFIG_HUAWEI_FEATURE_RMI_TOUCH is not set
# CONFIG_TOUCHSCREEN_GEN_VKEYS is not set
CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4=y
CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_RMI4_DEV=y
CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE=y
# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set
# CONFIG_TOUCHSCREEN_GT9XX is not set
CONFIG_HUAWEI_SYNAPTICS_RMI_TOUCH=y
CONFIG_RMI4_BUS=y
@ -1532,27 +1530,7 @@ CONFIG_RMI4_F34=y
CONFIG_RMI4_F54=y
CONFIG_RMI4_DEV=y
# CONFIG_GT9XX_TOUCHPANEL_DRIVER is not set
CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4=y
CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEVICETREE_SUPPORT=y
# CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_PROXIMITY is not set
# CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEVICE_ACCESS_API is not set
# CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEBUG is not set
# CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_VDEBUG is not set
# CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_PLATFORM_FW_UPGRADE is not set
CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_BINARY_FW_UPGRADE=y
CONFIG_TOUCHSCREEN_HUAWEI_CYTTSP4_RECOVERY_FW_UPDATE=y
CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_PLATFORM_TTCONFIG_UPGRADE=y
CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_MANUAL_TTCONFIG_UPGRADE=y
CONFIG_CYPRESS_CYTTSP4_BUS=y
CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_USE_FW_BIN_FILE=y
CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_I2C=y
# CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_SPI is not set
# CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_MT_A is not set
CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_MT_B=y
# CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_BUTTON is not set
CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEVICE_ACCESS=y
CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_LOADER=y
CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4_DEBUG_MODULE=y
# CONFIG_TOUCHSCREEN_CYPRESS_CYTTSP4 is not set
CONFIG_TOUCHSCREEN_HUAWEI_DSX_I2C=y
CONFIG_TOUCHSCREEN_HUAWEI_DSX_RMI_DEV=y
CONFIG_TOUCHSCREEN_HUAWEI_DSX_FW_UPDATE=y