Skip to content

Commit 58ea326

Browse files
Badhri Jagan Sridharangregkh
authored andcommitted
usb: typec: tcpci: Add a getter method to retrieve tcpm_port reference
Allow chip level drivers to retrieve reference to tcpm_port. Signed-off-by: Badhri Jagan Sridharan <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9e85868 commit 58ea326

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

drivers/usb/typec/tcpm/tcpci.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ struct tcpci_chip {
3838
struct tcpci_data data;
3939
};
4040

41+
struct tcpm_port *tcpci_get_tcpm_port(struct tcpci *tcpci)
42+
{
43+
return tcpci->port;
44+
}
45+
EXPORT_SYMBOL_GPL(tcpci_get_tcpm_port);
46+
4147
static inline struct tcpci *tcpc_to_tcpci(struct tcpc_dev *tcpc)
4248
{
4349
return container_of(tcpc, struct tcpci, tcpc);

drivers/usb/typec/tcpm/tcpci.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,6 @@ struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data);
150150
void tcpci_unregister_port(struct tcpci *tcpci);
151151
irqreturn_t tcpci_irq(struct tcpci *tcpci);
152152

153+
struct tcpm_port;
154+
struct tcpm_port *tcpci_get_tcpm_port(struct tcpci *tcpci);
153155
#endif /* __LINUX_USB_TCPCI_H */

0 commit comments

Comments
 (0)