2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-27 14:43:58 +08:00
linux-next/include/linux/mei_cl_bus.h
Samuel Ortiz e46980a10a mei: bus: Add device enabling and disabling API
It should be left to the drivers to enable and disable the device on the
MEI bus when e.g getting probed.
For drivers to be able to safely call the enable and disable hooks, the
mei_cl_ops must be set before it's probed and thus this should happen
before registering the device on the MEI bus. Hence the mei_cl_add_device()
prototype change.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-08 16:57:15 -07:00

45 lines
1.3 KiB
C

#ifndef _LINUX_MEI_CL_BUS_H
#define _LINUX_MEI_CL_BUS_H
#include <linux/device.h>
#include <linux/uuid.h>
struct mei_cl_device;
struct mei_cl_driver {
struct device_driver driver;
const char *name;
const struct mei_cl_device_id *id_table;
int (*probe)(struct mei_cl_device *dev,
const struct mei_cl_device_id *id);
int (*remove)(struct mei_cl_device *dev);
};
int __mei_cl_driver_register(struct mei_cl_driver *driver,
struct module *owner);
#define mei_cl_driver_register(driver) \
__mei_cl_driver_register(driver, THIS_MODULE)
void mei_cl_driver_unregister(struct mei_cl_driver *driver);
int mei_cl_send(struct mei_cl_device *device, u8 *buf, size_t length);
int mei_cl_recv(struct mei_cl_device *device, u8 *buf, size_t length);
typedef void (*mei_cl_event_cb_t)(struct mei_cl_device *device,
u32 events, void *context);
int mei_cl_register_event_cb(struct mei_cl_device *device,
mei_cl_event_cb_t read_cb, void *context);
#define MEI_CL_EVENT_RX 0
#define MEI_CL_EVENT_TX 1
void *mei_cl_get_drvdata(const struct mei_cl_device *device);
void mei_cl_set_drvdata(struct mei_cl_device *device, void *data);
int mei_cl_enable_device(struct mei_cl_device *device);
int mei_cl_disable_device(struct mei_cl_device *device);
#endif /* _LINUX_MEI_CL_BUS_H */