Samuel Ortiz | e535410 | 2013-03-27 17:29:53 +0200 | [diff] [blame] | 1 | #ifndef _LINUX_MEI_CL_BUS_H |
| 2 | #define _LINUX_MEI_CL_BUS_H |
| 3 | |
| 4 | #include <linux/device.h> |
| 5 | #include <linux/uuid.h> |
Tomas Winkler | 1f18035 | 2014-09-29 16:31:46 +0300 | [diff] [blame] | 6 | #include <linux/mod_devicetable.h> |
Samuel Ortiz | e535410 | 2013-03-27 17:29:53 +0200 | [diff] [blame] | 7 | |
| 8 | struct mei_cl_device; |
| 9 | |
| 10 | struct mei_cl_driver { |
| 11 | struct device_driver driver; |
| 12 | const char *name; |
| 13 | |
| 14 | const struct mei_cl_device_id *id_table; |
| 15 | |
| 16 | int (*probe)(struct mei_cl_device *dev, |
| 17 | const struct mei_cl_device_id *id); |
| 18 | int (*remove)(struct mei_cl_device *dev); |
| 19 | }; |
| 20 | |
Samuel Ortiz | 333e4ee | 2013-03-27 17:29:54 +0200 | [diff] [blame] | 21 | int __mei_cl_driver_register(struct mei_cl_driver *driver, |
| 22 | struct module *owner); |
| 23 | #define mei_cl_driver_register(driver) \ |
| 24 | __mei_cl_driver_register(driver, THIS_MODULE) |
| 25 | |
| 26 | void mei_cl_driver_unregister(struct mei_cl_driver *driver); |
| 27 | |
Tomas Winkler | 39db74c | 2014-11-27 14:07:28 +0200 | [diff] [blame] | 28 | ssize_t mei_cl_send(struct mei_cl_device *device, u8 *buf, size_t length); |
| 29 | ssize_t mei_cl_recv(struct mei_cl_device *device, u8 *buf, size_t length); |
Samuel Ortiz | 3e83329 | 2013-03-27 17:29:55 +0200 | [diff] [blame] | 30 | |
| 31 | typedef void (*mei_cl_event_cb_t)(struct mei_cl_device *device, |
| 32 | u32 events, void *context); |
| 33 | int mei_cl_register_event_cb(struct mei_cl_device *device, |
| 34 | mei_cl_event_cb_t read_cb, void *context); |
| 35 | |
| 36 | #define MEI_CL_EVENT_RX 0 |
| 37 | #define MEI_CL_EVENT_TX 1 |
| 38 | |
Samuel Ortiz | aa6aef2 | 2013-03-27 17:29:59 +0200 | [diff] [blame] | 39 | void *mei_cl_get_drvdata(const struct mei_cl_device *device); |
| 40 | void mei_cl_set_drvdata(struct mei_cl_device *device, void *data); |
| 41 | |
Samuel Ortiz | e46980a | 2013-04-09 01:51:38 +0300 | [diff] [blame] | 42 | int mei_cl_enable_device(struct mei_cl_device *device); |
| 43 | int mei_cl_disable_device(struct mei_cl_device *device); |
| 44 | |
Samuel Ortiz | e535410 | 2013-03-27 17:29:53 +0200 | [diff] [blame] | 45 | #endif /* _LINUX_MEI_CL_BUS_H */ |