summaryrefslogtreecommitdiff
path: root/include/linux/soc
diff options
context:
space:
mode:
authorAsahi Lina <lina@asahilina.net>2023-01-21 10:41:35 +0300
committerHector Martin <marcan@marcan.st>2023-01-31 14:40:14 +0300
commitb3892860f50920ea46342d32bf51323877365082 (patch)
tree99cfe38a975e37bffe8394b683fa7313a569098d /include/linux/soc
parent4435d63f172851b57a6a0943b73a6b8055a9356f (diff)
downloadlinux-b3892860f50920ea46342d32bf51323877365082.tar.xz
soc: apple: rtkit: Export non-devm init/free functions
While we normally encourage devm usage by drivers, some consumers (and in particular the upcoming Rust abstractions) might want to manually manage memory. Export the raw functions to make this possible. Signed-off-by: Asahi Lina <lina@asahilina.net> Reviewed-by: Sven Peter <sven@svenpeter.dev> Reviewed-by: Eric Curtin <ecurtin@redhat.com> Signed-off-by: Hector Martin <marcan@marcan.st>
Diffstat (limited to 'include/linux/soc')
-rw-r--r--include/linux/soc/apple/rtkit.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/soc/apple/rtkit.h b/include/linux/soc/apple/rtkit.h
index 927b214ef1c6..fc456f75c131 100644
--- a/include/linux/soc/apple/rtkit.h
+++ b/include/linux/soc/apple/rtkit.h
@@ -80,6 +80,25 @@ struct apple_rtkit *devm_apple_rtkit_init(struct device *dev, void *cookie,
const struct apple_rtkit_ops *ops);
/*
+ * Non-devm version of devm_apple_rtkit_init. Must be freed with
+ * apple_rtkit_free.
+ *
+ * @dev: Pointer to the device node this coprocessor is assocated with
+ * @cookie: opaque cookie passed to all functions defined in rtkit_ops
+ * @mbox_name: mailbox name used to communicate with the co-processor
+ * @mbox_idx: mailbox index to be used if mbox_name is NULL
+ * @ops: pointer to rtkit_ops to be used for this co-processor
+ */
+struct apple_rtkit *apple_rtkit_init(struct device *dev, void *cookie,
+ const char *mbox_name, int mbox_idx,
+ const struct apple_rtkit_ops *ops);
+
+/*
+ * Free an instance of apple_rtkit.
+ */
+void apple_rtkit_free(struct apple_rtkit *rtk);
+
+/*
* Reinitialize internal structures. Must only be called with the co-processor
* is held in reset.
*/