diff options
author | Bjorn Andersson <bjorn.andersson@sonymobile.com> | 2015-07-27 23:20:30 -0400 |
---|---|---|
committer | Andy Gross <agross@codeaurora.org> | 2015-07-29 15:13:48 -0400 |
commit | f2ab3298fb4932358d27fc4c7ea1a1891ad7e042 (patch) | |
tree | 4dbc38e8e14b28cf2751baf4a0286378d22646e8 /include/linux/soc/qcom/smd.h | |
parent | 72c10fef98fc3b3c924ee022e451872517e61ecf (diff) |
soc: qcom: Add Shared Memory Driver
This adds the Qualcomm Shared Memory Driver (SMD) providing
communication channels to remote processors, ontop of SMEM.
Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Andy Gross <agross@codeaurora.org>
Diffstat (limited to 'include/linux/soc/qcom/smd.h')
-rw-r--r-- | include/linux/soc/qcom/smd.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/include/linux/soc/qcom/smd.h b/include/linux/soc/qcom/smd.h new file mode 100644 index 000000000000..d7e50aa6a4ac --- /dev/null +++ b/include/linux/soc/qcom/smd.h | |||
@@ -0,0 +1,46 @@ | |||
1 | #ifndef __QCOM_SMD_H__ | ||
2 | #define __QCOM_SMD_H__ | ||
3 | |||
4 | #include <linux/device.h> | ||
5 | #include <linux/mod_devicetable.h> | ||
6 | |||
7 | struct qcom_smd; | ||
8 | struct qcom_smd_channel; | ||
9 | struct qcom_smd_lookup; | ||
10 | |||
11 | /** | ||
12 | * struct qcom_smd_device - smd device struct | ||
13 | * @dev: the device struct | ||
14 | * @channel: handle to the smd channel for this device | ||
15 | */ | ||
16 | struct qcom_smd_device { | ||
17 | struct device dev; | ||
18 | struct qcom_smd_channel *channel; | ||
19 | }; | ||
20 | |||
21 | /** | ||
22 | * struct qcom_smd_driver - smd driver struct | ||
23 | * @driver: underlying device driver | ||
24 | * @probe: invoked when the smd channel is found | ||
25 | * @remove: invoked when the smd channel is closed | ||
26 | * @callback: invoked when an inbound message is received on the channel, | ||
27 | * should return 0 on success or -EBUSY if the data cannot be | ||
28 | * consumed at this time | ||
29 | */ | ||
30 | struct qcom_smd_driver { | ||
31 | struct device_driver driver; | ||
32 | int (*probe)(struct qcom_smd_device *dev); | ||
33 | void (*remove)(struct qcom_smd_device *dev); | ||
34 | int (*callback)(struct qcom_smd_device *, const void *, size_t); | ||
35 | }; | ||
36 | |||
37 | int qcom_smd_driver_register(struct qcom_smd_driver *drv); | ||
38 | void qcom_smd_driver_unregister(struct qcom_smd_driver *drv); | ||
39 | |||
40 | #define module_qcom_smd_driver(__smd_driver) \ | ||
41 | module_driver(__smd_driver, qcom_smd_driver_register, \ | ||
42 | qcom_smd_driver_unregister) | ||
43 | |||
44 | int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len); | ||
45 | |||
46 | #endif | ||