summaryrefslogtreecommitdiff
path: root/include/linux/firmware/qcom/qcom_pas.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/firmware/qcom/qcom_pas.h')
-rw-r--r--include/linux/firmware/qcom/qcom_pas.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/firmware/qcom/qcom_pas.h b/include/linux/firmware/qcom/qcom_pas.h
index 65b1c9564458..fb2ec3be6a16 100644
--- a/include/linux/firmware/qcom/qcom_pas.h
+++ b/include/linux/firmware/qcom/qcom_pas.h
@@ -8,7 +8,9 @@
#ifndef __QCOM_PAS_H
#define __QCOM_PAS_H
+#include <linux/device.h>
#include <linux/err.h>
+#include <linux/io.h>
#include <linux/types.h>
struct qcom_pas_context {
@@ -22,6 +24,16 @@ struct qcom_pas_context {
bool use_tzmem;
};
+static inline void __iomem *qcom_pas_ctx_map(struct qcom_pas_context *ctx)
+{
+ void __iomem *ptr = ioremap_wc(ctx->mem_phys, ctx->mem_size);
+
+ if (!ptr)
+ dev_err(ctx->dev, "unable to map memory region: %pa+%zx\n",
+ &ctx->mem_phys, ctx->mem_size);
+ return ptr;
+}
+
bool qcom_pas_is_available(void);
struct qcom_pas_context *devm_qcom_pas_context_alloc(struct device *dev,
u32 pas_id,