Messages in this thread | | | Date | Fri, 28 Aug 2020 17:11:58 +0300 | From | Heikki Krogerus <> | Subject | Re: [PATCH 04/14 v1] usb: typec: tcpci: Add a getter method to retrieve tcpm_port reference |
| |
On Mon, Aug 24, 2020 at 09:22:00PM -0700, Badhri Jagan Sridharan wrote: > Allow chip level drivers to retrieve reference to tcpm_port. > > Signed-off-by: Badhri Jagan Sridharan <badhri@google.com> > --- > drivers/usb/typec/tcpm/tcpci.c | 6 ++++++ > drivers/usb/typec/tcpm/tcpci.h | 2 ++ > 2 files changed, 8 insertions(+) > > diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c > index 9e814d454d14..7b7991c8ac87 100644 > --- a/drivers/usb/typec/tcpm/tcpci.c > +++ b/drivers/usb/typec/tcpm/tcpci.c > @@ -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);
I wonder if it would be better if there were tpci callbacks, or wrappers, for the tcpm functions that the glue drivers could then use instead of directly calling the tcpm_*() functions? That would allow tcpci.c to keep tabs on what is going on.
That would somehow feel like a better approach to me, but maybe it would only complicate things. Guenter, what do you think?
thanks,
-- heikki
| |