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_high: Hot Plug Detect signal is high.
30 * @hpd_irq: Change in the status since last message
31 * @alt_mode_cfg_done: bool to specify alt mode status
32 * @debug_en: bool to specify debug mode
33 * @connect: simulate disconnect or connect for debug mode
36 enum plug_orientation orientation;
44 bool alt_mode_cfg_done;
47 int (*connect)(struct dp_usbpd *dp_usbpd, bool hpd);
51 * struct dp_usbpd_cb - callback functions provided by the client
53 * @configure: called by usbpd module when PD communication has
54 * been completed and the usb peripheral has been configured on
56 * @disconnect: notify the cable disconnect issued by usb.
57 * @attention: notify any attention message issued by usb.
60 int (*configure)(struct device *dev);
61 int (*disconnect)(struct device *dev);
62 int (*attention)(struct device *dev);
66 * dp_hpd_get() - setup hpd module
68 * @dev: device instance of the caller
69 * @cb: struct containing callback function pointers.
71 * This function allows the client to initialize the usbpd
72 * module. The module will communicate with HPD module.
74 struct dp_usbpd *dp_hpd_get(struct device *dev, struct dp_usbpd_cb *cb);
76 int dp_hpd_register(struct dp_usbpd *dp_usbpd);
77 void dp_hpd_unregister(struct dp_usbpd *dp_usbpd);
78 int dp_hpd_connect(struct dp_usbpd *dp_usbpd, bool hpd);
80 #endif /* _DP_HPD_H_ */