From 564ee15679bc0e1ae7367be4158b71addd5595a0 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Thu, 18 Jul 2019 22:36:41 +0200 Subject: [PATCH] Auto-detect the touchscreen input device on the PW4 (#5113) Once again, LTE devices have an extra proximity sensors that shifts the evdev path by one... Fix #5110 --- frontend/device/kindle/device.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend/device/kindle/device.lua b/frontend/device/kindle/device.lua index 7ff51ad97..6a98abd4d 100644 --- a/frontend/device/kindle/device.lua +++ b/frontend/device/kindle/device.lua @@ -347,6 +347,9 @@ local KindlePaperWhite4 = Kindle:new{ isTouchDevice = yes, hasFrontlight = yes, display_dpi = 300, + -- NOTE: LTE devices once again have a mysterious extra SX9310 proximity sensor... + -- Except this time, we can't rely on by-path, because there's no entry for the TS :/. + -- Should be event2 on WiFi, event3 on LTE, we'll fix it in init. touch_dev = "/dev/input/event2", } @@ -740,6 +743,16 @@ function KindlePaperWhite4:init() Kindle.init(self) + -- So, look for a goodix TS input device (c.f., #5110)... + local std_out = io.popen("grep -e 'Handlers\\|Name=' /proc/bus/input/devices | grep -A1 'goodix-ts' | grep -o 'event[0-9]'", "r") + if std_out then + local goodix_dev = std_out:read() + std_out:close() + if goodix_dev then + self.touch_dev = "/dev/input/" .. goodix_dev + end + end + self.input.open(self.touch_dev) self.input.open("fake_events") end