1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright (c) 2023, Linaro Ltd. All rights reserved.
4  */
5 
6 #ifndef __QCOM_PMIC_TYPEC_H__
7 #define __QCOM_PMIC_TYPEC_H__
8 
9 struct pmic_typec {
10 	struct device		*dev;
11 	struct tcpm_port	*tcpm_port;
12 	struct tcpc_dev		tcpc;
13 	struct pmic_typec_pdphy	*pmic_typec_pdphy;
14 	struct pmic_typec_port	*pmic_typec_port;
15 
16 	int (*pdphy_start)(struct pmic_typec *tcpm,
17 			   struct tcpm_port *tcpm_port);
18 	void (*pdphy_stop)(struct pmic_typec *tcpm);
19 
20 	int (*port_start)(struct pmic_typec *tcpm,
21 			  struct tcpm_port *tcpm_port);
22 	void (*port_stop)(struct pmic_typec *tcpm);
23 };
24 
25 #define tcpc_to_tcpm(_tcpc_) container_of(_tcpc_, struct pmic_typec, tcpc)
26 
27 #endif
28