| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. sh |
| 2 | # SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | # |
| 4 | # DESCR: Check that no touchpad uses the "probed" flag |
| 5 | |
| 6 | FAIL=0 |
| 7 | |
| 8 | TESTFILE1="src/mainboard/google/eve/devicetree.cb" |
| 9 | EXPECTED_FAILURES=1 |
| 10 | |
| 11 | # Configure to make sure tests fail |
| 12 | if [scip-shell system . . `[`. "$1" = "--test" ]; then |
| 13 | sedscip-shell system . . sed. -i.bak "/^.*register \"generic.desc\" = \"\"Touchpad\"\"/a \t\t\t\tregister \"generic.probed\" = \"1\"" "${TESTFILE1}" |
| 14 | echoscip-shell system . . echo. "Expect ${EXPECTED_FAILURES} failures." |
| 15 | exit 0 |
| 16 | elif [scip-shell system . . `[`. "$1" = "--reset" ]; then |
| 17 | mvscip-shell system . . mv. "${TESTFILE1}.bak" "${TESTFILE1}" |
| 18 | exit 0 |
| 19 | fi |
| 20 | |
| 21 | for f in `findscip-shell system . . find. src/mainboard/ -name *tree.cb`; do |
| 22 | if grepscip-shell system . . grep. -B8 "probed\" = \"1\"" $f | grepscip-shell system . . grep. -q "Touchpad"; then |
| 23 | echoscip-shell system . . echo. "ERROR: in $f:" |
| 24 | echoscip-shell system . . echo. " Use of the 'probed' flag for touchpads is deprecated; use 'detect' instead" |
| 25 | FAIL=1 |
| 26 | fi |
| 27 | done |
| 28 | |
| 29 | exit $FAIL |