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.

Linux/BQ25883: USB PSY driver referenced in Linux driver

Part Number: BQ25883
Other Parts Discussed in Thread: BQSTUDIO, BQ25882

Tool/software: Linux

Hi, we are using BQ25883 to charge a Linux/Android device. The Linux driver references a usb_psy power_supply, that it -among other things- uses to set charging current depending the type of the usb supply. I find this a bit confusing. Do I need another part that does the USB charging type handshaking or does the BQ2588x do handshaking with the USB host to determine the charging type (SDP/CDP/DCP)?

We also have the EVM (with BQ25882) and this seems to do the handshaking without another part. but this is Windows, so I have insight into how it is done from within bqstudio. On a sidenote, the bq25882 evm completely stopped working with bqstudio ever since I had the evm hooked up to my Android/Linux board. Cannot reproduce the charging test any longer, it says Not Power Good (while the PG led is on) and No input, while I have a USB cable connected...

 

  • I realise I've asked the same question before,  so let me be a bit more specific this time. The datasheet states the part performs automatic USB handshaking on the charging level to determine SDP/CDP/DCP profiles. However, the Linux driver seems to be depending on a USB type power_supply device, to set the charging power:

    https://github.com/tibms/kernel-4.4/blob/release/drivers/power/bq2588x/bq2588x_charger.c line 1278 and onwards, which is in turn triggered by:

    https://github.com/tibms/kernel-4.4/blob/release/drivers/power/bq2588x/bq2588x_charger.c line 1344.

    Apart from the fact that I don't know which device or driver is responsible for giving me this usb_psy the driver uses, what does the auto-detect in the datasheet mean within the context of this driver:

    "Integrated USB D+/D- auto-detect USB SDP, CDP, DCP, and non-standard adapters"

    I'm in a bit of a strange position where I can't really hook up the D+/- lines to a USB host since we're adding this part to a single board computer that is meant to be run from mains power and it doesn't expose a USB host connection on its extension ports.

  • Hi Jan,

    Typically, D+/D- would be used to automatically detect the input source and set the input current limit accordingly. However, if you don't have the D+/D- lines available, then you will need another part to do this.

    Best regards,
    Angelo
  • Ok thanks this makes sense. We don't have the D+/- connected now, but should be able to make that happen. However with D+/- disconnected, it should be able to charge at 500mA right? We basically copied the EVM board layout onto our own board, but the STAT LED is blinking at 1Hz, yet the FAULT reg is clear. Charging register also says not charging (0b000) Where should I look for a cause?

  • Hi Jan,

    Yes, with the D+ and D- pins floating, the BQ25883 should still be able to charge. Upon adapter plug-in, the BQ25883 will automatically detect an unknown adapter and set the input current limit (not the charge current) to 500 mA. After input source type detection is complete, the host can set a different IINDPM value, as described in Section 8.3.3.2 of the datasheet:

    Can you please describe your test setup? What are all the things that you have connected to your board? It sounds like this may be a software issue (something related to the Linux driver) rather than a hardware issue (something related to your charger circuit), especially since you mentioned that the BQ25882 EVM stopped working with BQStudio once you connected it to your Android/Linux board.

    Best regards,

    Angelo

  • Hi,

    Thanks for your reply. We have resolved the issue. There was a typo in our schematic which caused a trace not to be routed, which resulted in a wrong temperature measurement which caused a default "TS Hot" state. This caused the chip to not start charging. I added a small wire where the trace should have been and then it started charging at 500mA.

    We also replaced the EVM board with a new one. The old one probably died from some severe case of ESD or short circuit, which also fried some of our other boards in the setup.

    Best,

    JW