msm: ipa: add api for getting IPA pdev
Add API intended for IPA kernel tests.
This API will allow kernel tests to use IPA driver
pdev struct by returning a pointer to this struct.
CRs-Fixed: 1077422
Change-Id: Ideeaa89f15b8895ce7256fed9f614d5c39ef105f
Signed-off-by: Amir Levy <alevy@codeaurora.org>
Signed-off-by: Gidon Studinski <gidons@codeaurora.org>
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h
index 4cb4d5a..461b720 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_i.h
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_i.h
@@ -2019,4 +2019,5 @@
int ipa3_get_ntn_stats(struct Ipa3HwStatsNTNInfoData_t *stats);
struct dentry *ipa_debugfs_get_root(void);
bool ipa3_is_msm_device(void);
+struct device *ipa3_get_pdev(void);
#endif /* _IPA3_I_H_ */
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c
index a6e462f6..c3f3cfa 100644
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_utils.c
@@ -3200,6 +3200,7 @@
api_ctrl->ipa_setup_uc_ntn_pipes = ipa3_setup_uc_ntn_pipes;
api_ctrl->ipa_tear_down_uc_offload_pipes =
ipa3_tear_down_uc_offload_pipes;
+ api_ctrl->ipa_get_pdev = ipa3_get_pdev;
return 0;
}
@@ -3637,3 +3638,17 @@
return false;
}
+
+/**
+ * ipa3_get_pdev() - return a pointer to IPA dev struct
+ *
+ * Return value: a pointer to IPA dev struct
+ *
+ */
+struct device *ipa3_get_pdev(void)
+{
+ if (!ipa3_ctx)
+ return NULL;
+
+ return ipa3_ctx->pdev;
+}