Re: Adding tps65986 to your tps6598x driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



+linux-usb ml

On Wed, Apr 22, 2020 at 12:17:14PM +0100, Bryan O'Donoghue wrote:
> On 14/04/2020 16:15, Heikki Krogerus wrote:
> > Hi Bryan,
> > 
> > On Tue, Apr 14, 2020 at 03:42:24PM +0100, Bryan O'Donoghue wrote:
> > > Hi Heikki.
> > > 
> > > I'm Bryan working with Linaro on a Qualcomm project.
> > > 
> > > We have a tps65986, which needs some upstreaming work.
> > > 
> > > http://www.ti.com/lit/gpn/tps65982
> > > http://www.ti.com/lit/gpn/tps65986
> > > 
> > > As you can see the two parts are very similar except the 65986 does data
> > > role switching but unlike the 65982 doesn't support 20v 5a power.
> > > 
> > > I was going to add
> > > 
> > > - OF probe support
> > > - USB role switching support
> > 
> > By USB role switching you mean the USB role switch class, right?
> > 
> > > to your existing driver. Do you know of anybody who has done any work for
> > > the tps65986 already ? Also does the above extension seem right/sensible to
> > > you ?
> > 
> > There isn't anybody adding support for tps65986 to the driver that I
> > know of, so please go for it. Both tasks make sense to me.
> > 
> > thanks,
> > 
> 
> What about tcpm ?

What about it?

> As I understand it for your platform, you just want the power controller
> stuff in the chip, without the data role.

Role swapping is actually the only thing that we need the driver for
on our platforms.

> In my case - we have a point-of-sale terminal, which basically looks like a
> phone - we want to be able to do data role switching.
> 
> What's your feeling. Add role switch into the driver you have here, or try
> to get that driver working with tcpm ?

So what you are proposing here is that you want to use tps65986 as
just a port controller (so PHY), right? I don't think that's possible.

TCPM (port manager) is the software that implements the USB Type-C and
PD state machines. The USB PD controllers are running their own state
machines, and the thing is that you can't turn off that part of them.
So basically the USB PD controllers are supplying the TCPM
functionality internally.

> Something else ? It's important we get the changes upstream, so I'd
> appreciate any thoughts you have on the right way to go about this.

So what exactly is the problem here?

Which USB controller are you using? Is it dual-role capable, or do you
have separate xHCI controller and separate USB device controller plus
a mux between them?

Is it clear to you that the Type-C driver, so tps6598x.c in this case,
is the consumer of the USB role switch? If you have a dual-role
capable USB controller, then that will be the supplier of the switch.
If you have separate USB host and devices IPs on your board, then the
mux between them is the switch supplier.

I'm attaching a diff that has all the changes that you should need to
do to the tps6598x.c in order to get the role swapping working on your
board.

The next step is to figure out how to describe the connection between
your USB role switch (which I'm guessing is the USB controller on your
board) and the USB PD controller. You are using devicetree, right?

> Could you recommend an Intel platform I could pick up to validate my changes
> don't break existing code ?

All -S variants of our SOCs can be used for testing the tps6598x.c,
for example Coffee Lake -S, but unfortunately I don't know which
products on the market actually use those SOCs. I do my development
with the reference boards.


thanks,

-- 
heikki



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux