[Concept,15/19] tkey: Allow using the selected TKey from luks

Message ID 20251208023229.3929910-16-sjg@u-boot.org
State New
Headers
Series bootctl: Continue development with TKey functionality |

Commit Message

Simon Glass Dec. 8, 2025, 2:32 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Export the function which sets the current TKey so that the luks command
can work with 'tkey connect'.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 cmd/tkey.c     | 2 +-
 include/tkey.h | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
  

Patch

diff --git a/cmd/tkey.c b/cmd/tkey.c
index 3a31712990a..a1a382bac0c 100644
--- a/cmd/tkey.c
+++ b/cmd/tkey.c
@@ -22,7 +22,7 @@ 
 /* Static device pointer set by tkey connect command */
 static struct udevice *tkey_dev;
 
-static struct udevice *tkey_get_device(void)
+struct udevice *tkey_get_device(void)
 {
 	struct udevice *dev;
 	int ret;
diff --git a/include/tkey.h b/include/tkey.h
index e610d91140c..418b6aca7d2 100644
--- a/include/tkey.h
+++ b/include/tkey.h
@@ -327,4 +327,11 @@  int tkey_emul_set_app_mode_for_test(struct udevice *dev, bool app_mode);
  */
 int tkey_emul_set_connected_for_test(struct udevice *dev, bool connected);
 
+/**
+ * tkey_get_device() - Get the current TKey device
+ *
+ * Return: Pointer to TKey device, or NULL if not found
+ */
+struct udevice *tkey_get_device(void);
+
 #endif /* _TKEY_UCLASS_H */