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_id - struct used for matching a smd device
13 * @name: name of the channel
20 * struct qcom_smd_device - smd device struct
21 * @dev: the device struct
22 * @channel: handle to the smd channel for this device
24 struct qcom_smd_device {
26 struct qcom_smd_channel *channel;
29 typedef int (*qcom_smd_cb_t)(struct qcom_smd_device *, const void *, size_t);
32 * struct qcom_smd_driver - smd driver struct
33 * @driver: underlying device driver
34 * @smd_match_table: static channel match table
35 * @probe: invoked when the smd channel is found
36 * @remove: invoked when the smd channel is closed
37 * @callback: invoked when an inbound message is received on the channel,
38 * should return 0 on success or -EBUSY if the data cannot be
39 * consumed at this time
41 struct qcom_smd_driver {
42 struct device_driver driver;
43 const struct qcom_smd_id *smd_match_table;
45 int (*probe)(struct qcom_smd_device *dev);
46 void (*remove)(struct qcom_smd_device *dev);
47 qcom_smd_cb_t callback;
50 int qcom_smd_driver_register(struct qcom_smd_driver *drv);
51 void qcom_smd_driver_unregister(struct qcom_smd_driver *drv);
53 #define module_qcom_smd_driver(__smd_driver) \
54 module_driver(__smd_driver, qcom_smd_driver_register, \
55 qcom_smd_driver_unregister)
57 int qcom_smd_send(struct qcom_smd_channel *channel, const void *data, int len);
59 struct qcom_smd_channel *qcom_smd_open_channel(struct qcom_smd_device *sdev,