Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4222c96 authored by Amir Levy's avatar Amir Levy
Browse files

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: default avatarAmir Levy <alevy@codeaurora.org>
Signed-off-by: default avatarGidon Studinski <gidons@codeaurora.org>
parent e6910562
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -2903,6 +2903,22 @@ int ipa_tear_down_uc_offload_pipes(int ipa_ep_idx_ul,
	return ret;
}

/**
 * ipa_get_pdev() - return a pointer to IPA dev struct
 *
 * Return value: a pointer to IPA dev struct
 *
 */
struct device *ipa_get_pdev(void)
{
	struct device *ret;

	IPA_API_DISPATCH_RETURN_PTR(ipa_get_pdev);

	return ret;
}
EXPORT_SYMBOL(ipa_get_pdev);

static const struct dev_pm_ops ipa_pm_ops = {
	.suspend_noirq = ipa_ap_suspend,
	.resume_noirq = ipa_ap_resume,
+2 −0
Original line number Diff line number Diff line
@@ -369,6 +369,8 @@ struct ipa_api_controller {

	int (*ipa_tear_down_uc_offload_pipes)(int ipa_ep_idx_ul,
		int ipa_ep_idx_dl);

	struct device *(*ipa_get_pdev)(void);
};

#ifdef CONFIG_IPA
+1 −0
Original line number Diff line number Diff line
@@ -1835,4 +1835,5 @@ int ipa_ntn_init(void);
int ipa2_get_ntn_stats(struct IpaHwStatsNTNInfoData_t *stats);
int ipa2_register_ipa_ready_cb(void (*ipa_ready_cb)(void *),
				void *user_data);
struct device *ipa2_get_pdev(void);
#endif /* _IPA_I_H_ */
+15 −0
Original line number Diff line number Diff line
@@ -5104,6 +5104,7 @@ int ipa2_bind_api_controller(enum ipa_hw_type ipa_hw_type,
	api_ctrl->ipa_setup_uc_ntn_pipes = ipa2_setup_uc_ntn_pipes;
	api_ctrl->ipa_tear_down_uc_offload_pipes =
		ipa2_tear_down_uc_offload_pipes;
	api_ctrl->ipa_get_pdev = ipa2_get_pdev;

	return 0;
}
@@ -5183,3 +5184,17 @@ void ipa_suspend_apps_pipes(bool suspend)
		}
	}
}

/**
 * ipa2_get_pdev() - return a pointer to IPA dev struct
 *
 * Return value: a pointer to IPA dev struct
 *
 */
struct device *ipa2_get_pdev(void)
{
	if (!ipa_ctx)
		return NULL;

	return ipa_ctx->pdev;
}
+1 −0
Original line number Diff line number Diff line
@@ -2019,4 +2019,5 @@ int ipa3_ntn_init(void);
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_ */
Loading