]>
git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blob - include/linux/remoteproc/qcom_q6v5_ipa_notify.h
1 /* SPDX-License-Identifier: GPL-2.0 */
3 /* Copyright (C) 2019 Linaro Ltd. */
5 #ifndef __QCOM_Q6V5_IPA_NOTIFY_H__
6 #define __QCOM_Q6V5_IPA_NOTIFY_H__
8 #if IS_ENABLED(CONFIG_QCOM_Q6V5_IPA_NOTIFY)
10 #include <linux/remoteproc.h>
12 enum qcom_rproc_event
{
13 MODEM_STARTING
= 0, /* Modem is about to be started */
14 MODEM_RUNNING
= 1, /* Startup complete; modem is operational */
15 MODEM_STOPPING
= 2, /* Modem is about to shut down */
16 MODEM_CRASHED
= 3, /* Modem has crashed (implies stopping) */
17 MODEM_OFFLINE
= 4, /* Modem is now offline */
18 MODEM_REMOVING
= 5, /* Modem is about to be removed */
21 typedef void (*qcom_ipa_notify_t
)(void *data
, enum qcom_rproc_event event
);
23 struct qcom_rproc_ipa_notify
{
24 struct rproc_subdev subdev
;
26 qcom_ipa_notify_t notify
;
31 * qcom_add_ipa_notify_subdev() - Register IPA notification subdevice
32 * @rproc: rproc handle
33 * @ipa_notify: IPA notification subdevice handle
35 * Register the @ipa_notify subdevice with the @rproc so modem events
36 * can be sent to IPA when they occur.
38 * This is defined in "qcom_q6v5_ipa_notify.c".
40 void qcom_add_ipa_notify_subdev(struct rproc
*rproc
,
41 struct qcom_rproc_ipa_notify
*ipa_notify
);
44 * qcom_remove_ipa_notify_subdev() - Remove IPA SSR subdevice
45 * @rproc: rproc handle
46 * @ipa_notify: IPA notification subdevice handle
48 * This is defined in "qcom_q6v5_ipa_notify.c".
50 void qcom_remove_ipa_notify_subdev(struct rproc
*rproc
,
51 struct qcom_rproc_ipa_notify
*ipa_notify
);
54 * qcom_register_ipa_notify() - Register IPA notification function
55 * @rproc: Remote processor handle
56 * @notify: Non-null IPA notification callback function pointer
57 * @data: Data supplied to IPA notification callback function
59 * @Return: 0 if successful, or a negative error code otherwise
61 * This is defined in "qcom_q6v5_mss.c".
63 int qcom_register_ipa_notify(struct rproc
*rproc
, qcom_ipa_notify_t notify
,
66 * qcom_deregister_ipa_notify() - Deregister IPA notification function
67 * @rproc: Remote processor handle
69 * This is defined in "qcom_q6v5_mss.c".
71 void qcom_deregister_ipa_notify(struct rproc
*rproc
);
73 #else /* !IS_ENABLED(CONFIG_QCOM_Q6V5_IPA_NOTIFY) */
75 struct qcom_rproc_ipa_notify
{ /* empty */ };
77 #define qcom_add_ipa_notify_subdev(rproc, ipa_notify) /* no-op */
78 #define qcom_remove_ipa_notify_subdev(rproc, ipa_notify) /* no-op */
80 #endif /* !IS_ENABLED(CONFIG_QCOM_Q6V5_IPA_NOTIFY) */
82 #endif /* !__QCOM_Q6V5_IPA_NOTIFY_H__ */