Skip to content

Commit

Permalink
usb: typec: tcpci: Add a getter method to retrieve tcpm_port reference
Browse files Browse the repository at this point in the history
Allow chip level drivers to retrieve reference to tcpm_port.

Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20201008061556.1402293-2-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Badhri Jagan Sridharan authored and Greg Kroah-Hartman committed Oct 8, 2020
1 parent 9e85868 commit 58ea326
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/usb/typec/tcpm/tcpci.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ struct tcpci_chip {
struct tcpci_data data;
};

struct tcpm_port *tcpci_get_tcpm_port(struct tcpci *tcpci)
{
return tcpci->port;
}
EXPORT_SYMBOL_GPL(tcpci_get_tcpm_port);

static inline struct tcpci *tcpc_to_tcpci(struct tcpc_dev *tcpc)
{
return container_of(tcpc, struct tcpci, tcpc);
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/typec/tcpm/tcpci.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,6 @@ struct tcpci *tcpci_register_port(struct device *dev, struct tcpci_data *data);
void tcpci_unregister_port(struct tcpci *tcpci);
irqreturn_t tcpci_irq(struct tcpci *tcpci);

struct tcpm_port;
struct tcpm_port *tcpci_get_tcpm_port(struct tcpci *tcpci);
#endif /* __LINUX_USB_TCPCI_H */

0 comments on commit 58ea326

Please sign in to comment.