1/* SPDX-License-Identifier: GPL-2.0-only */
2
3#ifndef __CROS_TYPEC_ALTMODE_H__
4#define __CROS_TYPEC_ALTMODE_H__
5
6#include <linux/kconfig.h>
7#include <linux/usb/typec.h>
8
9struct cros_typec_port;
10struct typec_altmode;
11struct typec_altmode_desc;
12struct typec_displayport_data;
13
14#if IS_ENABLED(CONFIG_TYPEC_DP_ALTMODE)
15struct typec_altmode *
16cros_typec_register_displayport(struct cros_typec_port *port,
17 struct typec_altmode_desc *desc,
18 bool ap_mode_entry);
19
20int cros_typec_displayport_status_update(struct typec_altmode *altmode,
21 struct typec_displayport_data *data);
22#else
23static inline struct typec_altmode *
24cros_typec_register_displayport(struct cros_typec_port *port,
25 struct typec_altmode_desc *desc,
26 bool ap_mode_entry)
27{
28 return typec_port_register_altmode(port->port, desc);
29}
30
31static inline int cros_typec_displayport_status_update(struct typec_altmode *altmode,
32 struct typec_displayport_data *data)
33{
34 return 0;
35}
36#endif
37
38#if IS_ENABLED(CONFIG_TYPEC_TBT_ALTMODE)
39struct typec_altmode *
40cros_typec_register_thunderbolt(struct cros_typec_port *port,
41 struct typec_altmode_desc *desc);
42#else
43static inline struct typec_altmode *
44cros_typec_register_thunderbolt(struct cros_typec_port *port,
45 struct typec_altmode_desc *desc)
46{
47 return typec_port_register_altmode(port->port, desc);
48}
49#endif
50
51#endif /* __CROS_TYPEC_ALTMODE_H__ */
52

source code of linux/drivers/platform/chrome/cros_typec_altmode.h