1 // SPDX-License-Identifier: GPL-2.0
3 #ifndef __USB_TYPEC_MUX
4 #define __USB_TYPEC_MUX
6 #include <linux/list.h>
7 #include <linux/usb/typec.h>
12 * struct typec_switch - USB Type-C cable orientation switch
15 * @set: Callback to the driver for setting the orientation
17 * USB Type-C pin flipper switch routing the correct data pairs from the
18 * connector to the USB controller depending on the orientation of the cable
23 struct list_head entry;
25 int (*set)(struct typec_switch *sw, enum typec_orientation orientation);
29 * struct typec_switch - USB Type-C connector pin mux
32 * @set: Callback to the driver for setting the state of the mux
34 * Pin Multiplexer/DeMultiplexer switch routing the USB Type-C connector pins to
35 * different components depending on the requested mode of operation. Used with
36 * Accessory/Alternate modes.
40 struct list_head entry;
42 int (*set)(struct typec_mux *mux, int state);
45 struct typec_switch *typec_switch_get(struct device *dev);
46 void typec_switch_put(struct typec_switch *sw);
47 int typec_switch_register(struct typec_switch *sw);
48 void typec_switch_unregister(struct typec_switch *sw);
51 typec_mux_get(struct device *dev, const struct typec_altmode_desc *desc);
52 void typec_mux_put(struct typec_mux *mux);
53 int typec_mux_register(struct typec_mux *mux);
54 void typec_mux_unregister(struct typec_mux *mux);
56 #endif /* __USB_TYPEC_MUX */