xref: /openbmc/linux/drivers/usb/typec/pd.h (revision 662a6010)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 #ifndef __USB_POWER_DELIVERY__
4 #define __USB_POWER_DELIVERY__
5 
6 #include <linux/device.h>
7 #include <linux/usb/typec.h>
8 
9 struct usb_power_delivery {
10 	struct device dev;
11 	int id;
12 	u16 revision;
13 	u16 version;
14 };
15 
16 struct usb_power_delivery_capabilities {
17 	struct device dev;
18 	struct usb_power_delivery *pd;
19 	enum typec_role role;
20 };
21 
22 #define to_usb_power_delivery_capabilities(o) container_of(o, struct usb_power_delivery_capabilities, dev)
23 #define to_usb_power_delivery(o) container_of(o, struct usb_power_delivery, dev)
24 
25 struct usb_power_delivery *usb_power_delivery_find(const char *name);
26 
27 int usb_power_delivery_init(void);
28 void usb_power_delivery_exit(void);
29 
30 #endif /* __USB_POWER_DELIVERY__ */
31