1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef _LINUX_ISHTP_CL_BUS_H
16#define _LINUX_ISHTP_CL_BUS_H
17
18#include <linux/device.h>
19#include <linux/mod_devicetable.h>
20
21struct ishtp_cl;
22struct ishtp_cl_device;
23struct ishtp_device;
24struct ishtp_msg_hdr;
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44struct ishtp_cl_device {
45 struct device dev;
46 struct ishtp_device *ishtp_dev;
47 struct ishtp_fw_client *fw_client;
48 struct list_head device_link;
49 struct work_struct event_work;
50 void *driver_data;
51 int reference_count;
52 void (*event_cb)(struct ishtp_cl_device *device);
53};
54
55
56
57
58
59
60
61
62
63
64struct ishtp_cl_driver {
65 struct device_driver driver;
66 const char *name;
67 int (*probe)(struct ishtp_cl_device *dev);
68 int (*remove)(struct ishtp_cl_device *dev);
69 int (*reset)(struct ishtp_cl_device *dev);
70 const struct dev_pm_ops *pm;
71};
72
73
74int ishtp_bus_new_client(struct ishtp_device *dev);
75void ishtp_remove_all_clients(struct ishtp_device *dev);
76int ishtp_cl_device_bind(struct ishtp_cl *cl);
77void ishtp_cl_bus_rx_event(struct ishtp_cl_device *device);
78
79
80int ishtp_send_msg(struct ishtp_device *dev,
81 struct ishtp_msg_hdr *hdr, void *msg,
82 void (*ipc_send_compl)(void *),
83 void *ipc_send_compl_prm);
84
85
86int ishtp_write_message(struct ishtp_device *dev,
87 struct ishtp_msg_hdr *hdr,
88 unsigned char *buf);
89
90
91int ishtp_use_dma_transfer(void);
92
93
94void ishtp_bus_remove_all_clients(struct ishtp_device *ishtp_dev,
95 bool warm_reset);
96
97void ishtp_recv(struct ishtp_device *dev);
98void ishtp_reset_handler(struct ishtp_device *dev);
99void ishtp_reset_compl_handler(struct ishtp_device *dev);
100
101void ishtp_put_device(struct ishtp_cl_device *);
102void ishtp_get_device(struct ishtp_cl_device *);
103
104int __ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
105 struct module *owner);
106#define ishtp_cl_driver_register(driver) \
107 __ishtp_cl_driver_register(driver, THIS_MODULE)
108void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);
109
110int ishtp_register_event_cb(struct ishtp_cl_device *device,
111 void (*read_cb)(struct ishtp_cl_device *));
112int ishtp_fw_cl_by_uuid(struct ishtp_device *dev, const uuid_le *cuuid);
113
114#endif
115