[PATCH 1/3] firmware: qcom: pas: Expose the active PAS backend name
From: Sumit Garg
Date: Fri Sep 11 2026 - 08:47:07 EST
From: Jorge Ramirez-Ortiz <jorge.ramirez@xxxxxxxxxxxxxxxx>
Consumers may need to know which PAS backend is active, e.g. to decide
whether SCM-specific calls apply.
Add qcom_pas_get_backend() returning the active backend name (or NULL),
and define QCOM_PAS_BACKEND_SCM/QCOM_PAS_BACKEND_TEE for consumers to
match against. Use them in the SCM and OP-TEE backends too.
Assisted-by: Copilot:claude-opus-4.8
Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez.ortiz@xxxxxxxxx>
Co-developed-by: Sumit Garg <sumit.garg@xxxxxxxxxxxxxxxx>
Signed-off-by: Sumit Garg <sumit.garg@xxxxxxxxxxxxxxxx>
---
drivers/firmware/qcom/qcom_pas.c | 8 ++++++++
drivers/firmware/qcom/qcom_pas_tee.c | 2 +-
drivers/firmware/qcom/qcom_scm.c | 2 +-
include/linux/firmware/qcom/qcom_pas.h | 5 +++++
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/drivers/firmware/qcom/qcom_pas.c b/drivers/firmware/qcom/qcom_pas.c
index 24485dd0fa10..eb9e8ac85860 100644
--- a/drivers/firmware/qcom/qcom_pas.c
+++ b/drivers/firmware/qcom/qcom_pas.c
@@ -253,6 +253,14 @@ bool qcom_pas_supported(u32 pas_id)
}
EXPORT_SYMBOL_GPL(qcom_pas_supported);
+const char *qcom_pas_get_backend(void)
+{
+ struct qcom_pas_ops *ops = ops_ptr;
+
+ return ops ? ops->drv_name : NULL;
+}
+EXPORT_SYMBOL_GPL(qcom_pas_get_backend);
+
/**
* qcom_pas_is_available() - Check if the peripheral authentication service is
* available. Note that it is mandatory for any PAS
diff --git a/drivers/firmware/qcom/qcom_pas_tee.c b/drivers/firmware/qcom/qcom_pas_tee.c
index ac33a00687aa..397f11aea3b4 100644
--- a/drivers/firmware/qcom/qcom_pas_tee.c
+++ b/drivers/firmware/qcom/qcom_pas_tee.c
@@ -396,7 +396,7 @@ static void qcom_pas_tee_metadata_release(struct device *dev,
}
static struct qcom_pas_ops qcom_pas_ops_tee = {
- .drv_name = "qcom-pas-tee",
+ .drv_name = QCOM_PAS_BACKEND_TEE,
.supported = qcom_pas_tee_supported,
.init_image = qcom_pas_tee_init_image,
.mem_setup = qcom_pas_tee_mem_setup,
diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c
index 3eaa4c9ccf3c..d556f357fecb 100644
--- a/drivers/firmware/qcom/qcom_scm.c
+++ b/drivers/firmware/qcom/qcom_scm.c
@@ -1057,7 +1057,7 @@ bool qcom_scm_pas_supported(u32 pas_id)
EXPORT_SYMBOL_GPL(qcom_scm_pas_supported);
static struct qcom_pas_ops qcom_pas_ops_scm = {
- .drv_name = "qcom_scm",
+ .drv_name = QCOM_PAS_BACKEND_SCM,
.supported = __qcom_scm_pas_supported,
.init_image = __qcom_scm_pas_init_image2,
.mem_setup = __qcom_scm_pas_mem_setup,
diff --git a/include/linux/firmware/qcom/qcom_pas.h b/include/linux/firmware/qcom/qcom_pas.h
index fb2ec3be6a16..6e23b806259f 100644
--- a/include/linux/firmware/qcom/qcom_pas.h
+++ b/include/linux/firmware/qcom/qcom_pas.h
@@ -13,6 +13,10 @@
#include <linux/io.h>
#include <linux/types.h>
+/* Names reported by qcom_pas_get_backend() for the active PAS backend. */
+#define QCOM_PAS_BACKEND_SCM "qcom_scm"
+#define QCOM_PAS_BACKEND_TEE "qcom-pas-tee"
+
struct qcom_pas_context {
struct device *dev;
u32 pas_id;
@@ -34,6 +38,7 @@ static inline void __iomem *qcom_pas_ctx_map(struct qcom_pas_context *ctx)
return ptr;
}
+const char *qcom_pas_get_backend(void);
bool qcom_pas_is_available(void);
struct qcom_pas_context *devm_qcom_pas_context_alloc(struct device *dev,
u32 pas_id,
--
2.53.0