-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
guess: add guessing touchscreen modules
Signed-off-by: Egor Shestakov <ved@altlinux.org>
- Loading branch information
Egor Shestakov
committed
Jul 26, 2024
1 parent
b2850a6
commit 66ce1b7
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Guess module: touchscreen | ||
|
||
This module tries to guess modules for touchscreen devices. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash -eu | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
. guess-functions | ||
|
||
$TRACE_SOURCE "Processing ..." | ||
|
||
# The idea comes from tslib. Touchscreen devices have | ||
# the INPUT_PROP_DIRECT property, which is determined | ||
# by the first from zero bit of the property number | ||
|
||
INPUT_PROP_DIRECT=1 | ||
bitmask=$((1 << $INPUT_PROP_DIRECT)) | ||
|
||
for i in "$SYSFS_PATH"/class/input/event*/device/ ; do | ||
readline prop "$i"/properties | ||
|
||
if (($prop & $bitmask)); then | ||
p="$(readlink -e "$i")" | ||
|
||
while [ "$p" != "$SYSFS_PATH"/devices ]; do | ||
if [ -f "$p"/modalias ]; then | ||
readline alias "$p"/modalias | ||
guess_modalias "$alias" | ||
fi | ||
p="${p%/*}" | ||
done | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
.PHONY: guess-touchscreen | ||
|
||
guess-touchscreen: | ||
$V echo "Processing $@ ..." | ||
@ GUESS_SUFFIX=rescue:$@ \ | ||
$(DETECTDIR)/touchscreen/action | ||
|
||
guess: guess-touchscreen |