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.

bq27541 driver ?

Other Parts Discussed in Thread: BQ27541-G1, BQ27541

Hi everybody,

i need to use bq27541-G1 Fuel gauge with my android custom board. So i'm using a kernel 3.2, i've got this driver inside : bq27X00_battery.c

But i've found some driver specific for bq27541 when i searched with google in github. Like this :

https://android.googlesource.com/kernel/tegra/+/6bd10ce1cc0ca433d12e0adf6e0c913066f1a8b6/drivers/power/bq27541_battery.c

So can i use the bq27X00_battery.c with my fuel gauge or i need to add additional things? Is it usable, i've seen more register config in bq27541_battery.c, if i compare both drivers.

In another post  :

http://e2e.ti.com/support/embedded/linux/f/354/t/318893.aspx

it's asking about this driver and someone is saying there some register different mapping.

Is someone have a complete answer about this? This is my first time with fuel gauge.

Thank you

  • Hi,

    In my understanding,

    If your device is bq27541 then you can use the "bq27541_battery.c"  located at "drivers/power"

    I think "bq27541_battery.c" file is specifically to  bq27541 IC and it is not generic as "bq27x00_battery.c"

    It seems the driver implemented for tegra devices (NVIDIA)

    So you need to add platform data for "bq27541" in your board file.

    What is your SOC name (processor) ?

  • thank for your answer,

    i'm using am335X Soc. Fuel gauge is bq27541 but i've no driver name
    bq27541-battery in my kernel.. That why i'm trying to understand if i can use generic driver or not?

    And if i can't, where can i find bq27541-battery.c? because i can't find a generic driver, this driver seem to be different each time i'm finding a new link on google.

    Thank you

  • Hi,

    In my understanding,

    bq27541-battery.c? because i can't find a generic driver, this driver seem to be different each time i'm finding a new link on google.


    For this, My suggestion would be download the driver file from good website,

    It seems to me the users can change the same driver file for their requirement to implement some features from bq27541 fuel gauge IC, then they were uploaded, So try to compare those files and confirm that it wont give any harmful (critical) affect for your requirement.

    They can change the same driver file for their different kernel version because, some time the kernel API will get deprecated, So you have to consider that too and consider your kernel version download appropriate driver file.

  • Thank you,

    i thin i'd found the correct driver.

    https://github.com/aneeshv/linux-bq27xxx/blob/glass-cherry-pick/drivers/power/bq27x00_battery.c

    it is the driver bq27x00_battery Patch to use different Fuel gauge. And Beaglebone Boardfile (we use the same SOC) is Patch to use this fuel gauge.

    So i think i can use this one, but i will check all registers en functionnalities.

    Thank you for your help.

  • Hi,

    I am also referring the same driver for bq27541. But i am using linux 3.12. have you found the right driver.

    Did you solve the issue and got the results using this fuel gauge ic. While i loaded my driver it is giving the below response.

     [    1.855310] bq27x00-battery 0-0055: Gas Guage fw version 0xffffff87; df version 0xffffff87

    [    1.863989] bq27x00-battery 0-0055: Unkown Gas Guage fw version: 0xffffff87

    [    1.871547] power_supply bq27500-0: driver failed to report `voltage_now' property: -121

    [    1.880515] bq27x00-battery 0-0055: support ver. 1.2.0 enabled

    [    1.886774] power_supply bq27500-0: driver failed to report `voltage_now' property: -121

    After system booted up system commands are showing but it is not giving any results. could you suggest me where should i refer the right driver.

    Regards,

    Anil