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.

TPS65951 Linux driver availability?

Other Parts Discussed in Thread: TPS65950, TPS65951, TPS65921, BQ24073

Hi,

         Is there any reference driver available for TPS65951 on Linux? We are considering using this PMIC to replace TPS65950 on

DM37x EVM. I saw there are quite a bit of registers difference btw TPS65950 vs 65851. Are there any sample driver for TPS65951? Thanks for any info.

 

 

  • Hi,

    You can re-use the TPS65950 drivers. There are some differences but most of them are easy to look up and make the changes. Some changes do not really need any driver change.

    http://focus.ti.com/analog/docs/litabsmultiplefilelist.tsp?literatureNumber=swca090&docCategoryId=1&familyId=759

  • I am also using TPS65951 with BQ24073 charger. I would like to know if I can do USB detection (UBS to PC vs. USB to wall) using TPS65951's BCI interface. Looks like the TPS65951's BCI interface is different from TPS65950 and TPS65921. No Linux driver support yet.

    Since I have an external charger chip, all following charger related pins to TPS65951 are not connected.

    CHRG_DET_N (out)

    USBCHRG_EN (out)

    USBCHRG_STAT (in)

    MANU_BRIX (out)

     

    Also USB ID pin is floating.

     

    Q1) Do I need to have USBCHRG_STAT connection and USB ID pin connection to detect USB vs. USB wall charger correctly? Anything else?

    Q2) How do I program the BCI registers to detect USB vs. USB wall charger?

    Thanks

    Ryan

  • Hi, 

    You can detect USB100 (100mA) and USB500 (500mA) chargers. Please refer to section 8.3.1 in the data sheet. To monitor charger state you will need to have USBCHRG_STAT connected to BQ part.

    I will have to find if linux code is available for this. 

  • Gandhar,

     

    Thanks for the reply. I am reading the following register values from TPS65951 when USB is plugged in. No writes to these registers have been done yet.

     

    BCC_CTRL = 0x04

    BCC_CTRL2 = 0x01

    BCC_STS = 0x27

    USB_CHRG_CTRL1 = 0x60

    USB_CHRG_CTRL2 = 0x00

     

    I observe the following strange register values.

     

    BCC_CTRL2 value 0x01 indicates CHGMODE_SW is enabled. The default value is supposed to be zero, and I haven't written anything to it.

    BCC_STS value 0x27 indicates BATTERY_PRESENCE_STS is zero and USB_DET_STS is undefined.

     

    Currently the USBCHRG_STAT is not connected, so will it cause this kind of issue?

    Thanks

    Ryan

  • Hi,

    You see BCC_CTRL2[1]=1 because you have USB connected. If you insert a USB when TPS65951 is in ACTIVE then the FSM detects USB insertion and sets the SW mode. Hardware mode is possible when the device has low battery/dead battery or OFF state. 

    BCC_STS[2]=1, because of the same reason as above. Bits[21:0] in this are undefined because the device has not yet done the detection. You can start charger type detection by setting BCC_CTRL2[4]=1. This detection will then reflect the correct status in BCC_STS[1:0]

     

  •  

    Gandhar,

     

    1) I set the SW_USB_DET_EN bit during driver initialization (BCC[1]=0x11). But by the time, USB interrupt fires, it's cleared back to 0x01.

     

    <7>twl4030_usb twl4030_usb: BCC[0]=04

    <7>twl4030_usb twl4030_usb: BCC[1]=01 <--

    <7>twl4030_usb twl4030_usb: BCC[2]=27

    <7>twl4030_usb twl4030_usb: BCC[3]=e0 <--

    <7>twl4030_usb twl4030_usb: BCC[4]=00

     

    2) so I tried to set the SW_USB_DET_EN bit during init AND immediately after USB interrupt handler fires, before the charger detection. The value 0x11 stays, but the result is still the same.

     

    <7>twl4030_usb twl4030_usb: BCC[0]=04

    <7>twl4030_usb twl4030_usb: BCC[1]=11 <--

    <7>twl4030_usb twl4030_usb: BCC[2]=27

    <7>twl4030_usb twl4030_usb: BCC[3]=e0 <--

    <7>twl4030_usb twl4030_usb: BCC[4]=00

     

    Am I missing anything?

    Thanks

    Ryan

     

  • Ryan,

    I think you are missing USB_CHRG_CTRL1[0]=1.

    With the settings yo mentioned you are bypassing FSM detection, so you will have to set the above bit to '1'. FSM detection and software detection are two different detection methods.

    Hope this helps.

  • Ryan,

    I would recommend using FSM method for charger detection. In SW you may have to manually write/select USB charger type (USB500 or USB100). 

    This FSM mode is enabled when both of the following occur: the BCC_CTRL2[4] SW_USB_DET_EN bit is set to 1, and the USB_CHRG_CTRL1[0] USB_SW_CTRL_EN bit is set to 0. Dont bypass FSM mode by setting CHGMODE_SW=1.

    You can try both methods based on the last two updates I have.