1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved.
9 //#include <linux/usb/usbpd.h>
11 #include <linux/types.h>
12 #include <linux/device.h>
14 enum plug_orientation {
21 * struct dp_usbpd - DisplayPort status
23 * @orientation: plug orientation configuration
24 * @low_pow_st: low power state
25 * @adaptor_dp_en: adaptor functionality enabled
26 * @multi_func: multi-function preferred
27 * @usb_config_req: request to switch to usb
28 * @exit_dp_mode: request exit from displayport mode
29 * @hpd_irq: Change in the status since last message
30 * @alt_mode_cfg_done: bool to specify alt mode status
31 * @debug_en: bool to specify debug mode
32 * @connect: simulate disconnect or connect for debug mode
35 enum plug_orientation orientation;
42 bool alt_mode_cfg_done;
45 int (*connect)(struct dp_usbpd *dp_usbpd, bool hpd);
49 * struct dp_usbpd_cb - callback functions provided by the client
51 * @configure: called by usbpd module when PD communication has
52 * been completed and the usb peripheral has been configured on
54 * @disconnect: notify the cable disconnect issued by usb.
55 * @attention: notify any attention message issued by usb.
58 int (*configure)(struct device *dev);
59 int (*disconnect)(struct device *dev);
60 int (*attention)(struct device *dev);
64 * dp_hpd_get() - setup hpd module
66 * @dev: device instance of the caller
67 * @cb: struct containing callback function pointers.
69 * This function allows the client to initialize the usbpd
70 * module. The module will communicate with HPD module.
72 struct dp_usbpd *dp_hpd_get(struct device *dev, struct dp_usbpd_cb *cb);
74 int dp_hpd_register(struct dp_usbpd *dp_usbpd);
75 void dp_hpd_unregister(struct dp_usbpd *dp_usbpd);
76 int dp_hpd_connect(struct dp_usbpd *dp_usbpd, bool hpd);
78 #endif /* _DP_HPD_H_ */