lkml.org 
[lkml]   [2020]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2020-08-28 16:12    [W:0.569 / U:0.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site