1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Intel ISH client Interface definitions
4  *
5  * Copyright (c) 2019, Intel Corporation.
6  */
7 
8 #ifndef _INTEL_ISH_CLIENT_IF_H_
9 #define _INTEL_ISH_CLIENT_IF_H_
10 
11 struct ishtp_cl_device;
12 
13 /**
14  * struct ishtp_cl_device - ISHTP device handle
15  * @driver:	driver instance on a bus
16  * @name:	Name of the device for probe
17  * @probe:	driver callback for device probe
18  * @remove:	driver callback on device removal
19  *
20  * Client drivers defines to get probed/removed for ISHTP client device.
21  */
22 struct ishtp_cl_driver {
23 	struct device_driver driver;
24 	const char *name;
25 	const guid_t *guid;
26 	int (*probe)(struct ishtp_cl_device *dev);
27 	int (*remove)(struct ishtp_cl_device *dev);
28 	int (*reset)(struct ishtp_cl_device *dev);
29 	const struct dev_pm_ops *pm;
30 };
31 
32 int ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
33 			     struct module *owner);
34 void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);
35 int ishtp_register_event_cb(struct ishtp_cl_device *device,
36 			    void (*read_cb)(struct ishtp_cl_device *));
37 
38 /* Get the device * from ishtp device instance */
39 struct device *ishtp_device(struct ishtp_cl_device *cl_device);
40 /* Trace interface for clients */
41 void *ishtp_trace_callback(struct ishtp_cl_device *cl_device);
42 
43 #endif /* _INTEL_ISH_CLIENT_IF_H_ */
44