blob: abc0b8122f07744613b8b64f295c9464dd4f99d2 [file] [log] [blame]
Srinivas Pandruvada7ab21842019-03-18 12:14:20 -07001/* 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
11struct ishtp_cl_device;
12
Srinivas Pandruvadae00a8642019-03-18 12:14:22 -070013/**
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 */
22struct 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
32int ishtp_cl_driver_register(struct ishtp_cl_driver *driver,
33 struct module *owner);
34void ishtp_cl_driver_unregister(struct ishtp_cl_driver *driver);
35int ishtp_register_event_cb(struct ishtp_cl_device *device,
36 void (*read_cb)(struct ishtp_cl_device *));
37
Srinivas Pandruvada7ab21842019-03-18 12:14:20 -070038/* Get the device * from ishtp device instance */
39struct device *ishtp_device(struct ishtp_cl_device *cl_device);
40/* Trace interface for clients */
41void *ishtp_trace_callback(struct ishtp_cl_device *cl_device);
42
43#endif /* _INTEL_ISH_CLIENT_IF_H_ */