forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/sound/soc/intel/common/sst-ipc.h
....@@ -1,17 +1,8 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Intel SST generic IPC Support
34 *
45 * Copyright (C) 2015, Intel Corporation. All rights reserved.
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public License version
8
- * 2 as published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
14
- *
156 */
167
178 #ifndef __SST_GENERIC_IPC_H
....@@ -24,17 +15,16 @@
2415 #include <linux/workqueue.h>
2516 #include <linux/sched.h>
2617
27
-#define IPC_MAX_MAILBOX_BYTES 256
18
+struct sst_ipc_message {
19
+ u64 header;
20
+ void *data;
21
+ size_t size;
22
+};
2823
2924 struct ipc_message {
3025 struct list_head list;
31
- u64 header;
32
-
33
- /* direction wrt host CPU */
34
- char *tx_data;
35
- size_t tx_size;
36
- char *rx_data;
37
- size_t rx_size;
26
+ struct sst_ipc_message tx;
27
+ struct sst_ipc_message rx;
3828
3929 wait_queue_head_t waitq;
4030 bool pending;
....@@ -44,6 +34,7 @@
4434 };
4535
4636 struct sst_generic_ipc;
37
+struct sst_dsp;
4738
4839 struct sst_plat_ipc_ops {
4940 void (*tx_msg)(struct sst_generic_ipc *, struct ipc_message *);
....@@ -74,14 +65,14 @@
7465 struct sst_plat_ipc_ops ops;
7566 };
7667
77
-int sst_ipc_tx_message_wait(struct sst_generic_ipc *ipc, u64 header,
78
- void *tx_data, size_t tx_bytes, void *rx_data, size_t rx_bytes);
68
+int sst_ipc_tx_message_wait(struct sst_generic_ipc *ipc,
69
+ struct sst_ipc_message request, struct sst_ipc_message *reply);
7970
80
-int sst_ipc_tx_message_nowait(struct sst_generic_ipc *ipc, u64 header,
81
- void *tx_data, size_t tx_bytes);
71
+int sst_ipc_tx_message_nowait(struct sst_generic_ipc *ipc,
72
+ struct sst_ipc_message request);
8273
83
-int sst_ipc_tx_message_nopm(struct sst_generic_ipc *ipc, u64 header,
84
- void *tx_data, size_t tx_bytes, void *rx_data, size_t rx_bytes);
74
+int sst_ipc_tx_message_nopm(struct sst_generic_ipc *ipc,
75
+ struct sst_ipc_message request, struct sst_ipc_message *reply);
8576
8677 struct ipc_message *sst_ipc_reply_find_msg(struct sst_generic_ipc *ipc,
8778 u64 header);
....@@ -89,7 +80,6 @@
8980 void sst_ipc_tx_msg_reply_complete(struct sst_generic_ipc *ipc,
9081 struct ipc_message *msg);
9182
92
-void sst_ipc_drop_all(struct sst_generic_ipc *ipc);
9383 int sst_ipc_init(struct sst_generic_ipc *ipc);
9484 void sst_ipc_fini(struct sst_generic_ipc *ipc);
9585