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