This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TPS65988: notify the CPU about what is plugged in

Part Number: TPS65988


Hi, my customer would like to implement TPS65988 in the configuration below:

There are 2 type C connector in the system and MTK CPU support only one pair USB2.0 D+/D- signal.

So they need TPS65988 to notify MTK CPU which port is plugged in and whether a DFP or a UFP is plugged in.

I wonder if it's possible, and how can TPS65988 tell CPU such things? Through reading TPS65988 I2C register?

Besides, the type C connector may be connected to a dongle or a PC.

There are 3 cases:

1. Connected to PC, PC is host (similar to DFP in USB3.0?) and PC will be source.

2. Connected to a dongle, dongle is device(similar to UFP in USB3.0?) and dongle will be sink.

3. Connected to a dongle, dongle is device and dongle will be source when adaptor is connected to dongle.

Can TPS65988 support it? Should we configure TPS65988 to be DRP? How does TPS65988 knows it should be sink or source?

  • Hello Howard,

    This is a good question. For this type of functionality, you will need to use the I2C_IRQ line and the IRQ events within the configuration tool.

    Registers 0x14 through 0x19 are the interrupt registers that trigger the IRQ line low whenever that specific event occurs. This is the typical flow for enabling the IRQ functionality. I will use register 0x3F and determining the type of device being connected as my example. 

    1. Using the application configuration tool, enable the relevant bits that you want the PD controller to trigger on and notify the embedded controller (EC). For this specific example, your best event would the event 'PlugInsertOrRemoval' 
    2. Once you have updated the configuration using the application configuration tool, load the updated binary onto the external flash for the PD controller to load
    3. With the updated configuration loaded, the IRQ line will trigger low whenever a device has been inserted or removed
    4. When the IRQ line goes low, read register 0x14 to determine which IRQ event was triggered. If the 'PlugInsertOrRemoval'  event was triggered, you can have your EC read register 0x3F to determine what type of device is connected.
    5. use the interrupt clear (0x18) to clear the IRQ regsiter and bring the IRQ line back high. This was the EC will know when a new event comes in based on IRQ going low

    You use the port address to determine which port has the device connected. In the above example, the IRQ line will go low regardless of which port is connected since there is two ports and one I2C_IRQ line going to the embedded controller. All of the registers are shared between the two ports so the flow of the EC to determine which port is connected should also look like this

    1. EC sees IRQ line go low
    2. Read interrupt register for port 1
    3. If port 1 IRQ register is 0, read IRQ register for port 2
    4. Clear IRQ register
    5. Process read interrupt

    Hope this helps answer your question

  • Adam,

    I searched 0x3F and it seems only tells if the plugged in thing is a source or sink, but not DFP or UFP.

    It seems that 0x5F will tell if the plugged in thing is a DFP or UFP, right?

    My understanding is: DFP or UFP is only related to data, and is irrelevant to source or sink.

    There may be a device which is DFP but also a sink, right?

    I described the 3 situation TPS65988 may face:

    1. Connected to PC, PC is host (similar to DFP in USB3.0?) and PC will be source.

    2. Connected to a dongle, dongle is device(similar to UFP in USB3.0?) and dongle will be sink.

    3. Connected to a dongle, dongle is device and dongle will be source when adaptor is connected to dongle.

    My proposal is:

    TPS65988 is configured as DRP as default (no preference to be DFP or UFP), and prefer to be sink.

    Then CPU could read 0x3F and 0x5F to know what is plugged in, and configure TPS65988 accordingly, right?

  • Howard,

    The description of register 0x3F is only an example. I was walking through how the IRQ system works.

    You are correct that DFP and UFP are related to data and irrelevant of power. You may have a Type-C PD system that is both a sink and DFP 

    Yes, the CPU could read 0x3F and 0x5F to know what is plugged in, but you will still need to use the IRQ events so that the CPU knows when to read those registers.