What changed, and why it matters
This commit adds a new 'mock' touch driver for Trezor hardware wallets that have no touch screen, such as bare development boards. The driver simply reports 'no touch activity' so the software can compile and run without real touch hardware. There is no indication this change fixes or introduces a security issue.
No security action required. Treat as normal feature addition for hardware abstraction.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The change introduces a touch_none feature and a touch/none/touch.c stub implementing the touch API with no-op/inactive behavior. It is gated by a feature flag and intended for headless boards. The code does not alter existing drivers, remove safety checks, or handle secrets.
Changed components
core/embed/io/touch/none/touch.ccore/embed/io/touch/build.rscore/embed/io/Cargo.tomlInspect captured patch +74 / −1
diff --git a/core/embed/io/Cargo.toml b/core/embed/io/Cargo.toml
index 3eb53f04..da425ed3 100644
--- a/core/embed/io/Cargo.toml
+++ b/core/embed/io/Cargo.toml
@@ -92,7 +92,7 @@ backlight_tps61043 = []
backlight_tps61062 = []
backlight_pin = []
-# touch drivers
+touch_none = []
touch_ft6x36 = []
touch_ft3168 = []
touch_stmpe811 = []
diff --git a/core/embed/io/touch/build.rs b/core/embed/io/touch/build.rs
index 8478ba03..b6808735 100644
--- a/core/embed/io/touch/build.rs
+++ b/core/embed/io/touch/build.rs
@@ -23,6 +23,9 @@ pub fn def_module(lib: &mut CLibrary) -> Result<()> {
// builds the unix driver instead of the HW one. The unix driver does no
// panel correction, so the selected panel feature is ignored here.
lib.add_source("touch/unix/touch.c");
+ } else if cfg!(feature = "touch_none") {
+ // Headless boards: touch API present but never reports activity.
+ lib.add_source("touch/none/touch.c");
} else if cfg!(feature = "touch_ft3168") {
add_driver_ft3168(lib)?;
} else if cfg!(feature = "touch_ft6x36") {
diff --git a/core/embed/io/touch/none/touch.c b/core/embed/io/touch/none/touch.c
new file mode 100644
index 00000000..28ed42b7
--- /dev/null
+++ b/core/embed/io/touch/none/touch.c
@@ -0,0 +1,70 @@
+/*
+ * This file is part of the Trezor project, https://trezor.io/
+ *
+ * Copyright (c) SatoshiLabs
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Headless ("none") touch driver.
+//
+// Used by boards that have no touch panel (e.g. bare development boards). It
+// satisfies the touch API but never reports any touch activity. This lets the
+// touch-based UI (and the `touch_get_event()` helper in `touch_poll.c`) link
+// and run without touch hardware; the interface simply stays idle.
+
+#include <trezor_rtl.h>
+
+#include <io/touch.h>
+
+#include "../touch_poll.h"
+
+#ifdef KERNEL_MODE
+
+secbool touch_init(void) {
+ // Initialize the polling layer so touch_get_event() works (and always
+ // returns "no event").
+ if (!touch_poll_init()) {
+ return secfalse;
+ }
+ return sectrue;
+}
+
+void touch_deinit(void) { touch_poll_deinit(); }
+
+void touch_power_set(bool on) {}
+
+#ifdef USE_SUSPEND
+void touch_suspend(void) {}
+
+void touch_resume(void) {}
+#endif
+
+secbool touch_ready(void) { return sectrue; }
+
+uint8_t touch_get_version(void) { return 0; }
+
+secbool touch_set_sensitivity(uint8_t value) { return sectrue; }
+
+secbool touch_activity(void) { return secfalse; }
+
+uint32_t touch_get_state(void) { return 0; }
+
+#if defined(USE_SUSPEND) && defined(USE_TOUCH_WAKEUP)
+void touch_wakeup_set_enabled(bool enabled) {}
+
+bool touch_wakeup_get_enabled(void) { return false; }
+#endif
+
+#endif // KERNEL_MODE
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.