blob: 0819d36a3a742f63670f4ae953c5a3a66a3fa9d0 [file] [log] [blame]
Samuel Ortize5354102013-03-27 17:29:53 +02001#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 Winkler1f180352014-09-29 16:31:46 +03006#include <linux/mod_devicetable.h>
Samuel Ortize5354102013-03-27 17:29:53 +02007
8struct mei_cl_device;
9
10struct 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 Ortiz333e4ee2013-03-27 17:29:54 +020021int __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
26void mei_cl_driver_unregister(struct mei_cl_driver *driver);
27
Tomas Winkler39db74c2014-11-27 14:07:28 +020028ssize_t mei_cl_send(struct mei_cl_device *device, u8 *buf, size_t length);
29ssize_t mei_cl_recv(struct mei_cl_device *device, u8 *buf, size_t length);
Samuel Ortiz3e833292013-03-27 17:29:55 +020030
31typedef void (*mei_cl_event_cb_t)(struct mei_cl_device *device,
32 u32 events, void *context);
33int 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 Ortizaa6aef22013-03-27 17:29:59 +020039void *mei_cl_get_drvdata(const struct mei_cl_device *device);
40void mei_cl_set_drvdata(struct mei_cl_device *device, void *data);
41
Samuel Ortize46980a2013-04-09 01:51:38 +030042int mei_cl_enable_device(struct mei_cl_device *device);
43int mei_cl_disable_device(struct mei_cl_device *device);
44
Samuel Ortize5354102013-03-27 17:29:53 +020045#endif /* _LINUX_MEI_CL_BUS_H */