4 #include <linux/device.h>
5 #include <linux/mod_devicetable.h>
8 struct qcom_smd_channel;
9 struct qcom_smd_lookup;
12 * struct qcom_smd_device - smd device struct
13 * @dev: the device struct
14 * @channel: handle to the smd channel for this device
16 struct qcom_smd_device {
18 struct qcom_smd_channel *channel;
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
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);
37 int qcom_smd_driver_register(struct qcom_smd_driver *drv);
38 void qcom_smd_driver_unregister(struct qcom_smd_driver *drv);
40 #define module_qcom_smd_driver(__smd_driver) \
41 module_driver(__smd_driver, qcom_smd_driver_register, \
42 qcom_smd_driver_unregister)
44 int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len);