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.

Porting android Ice Cream sandwich (ICS 4.0) to DM3730x EVM (ARM Cortex A8 at 1GHz), battery integration ,

Other Parts Discussed in Thread: ADS7846

Hi Team,

i have build the kernel with  my battery driver and  the functions are listed under 

/sys/class/power_supply/bq27x00_battery-0 # ls

capacity
current_now
device
power
present
status
subsystem
temp
time_to_empty_avg
time_to_empty_now
time_to_full_now
type
uevent
voltage_now

i also edited the init.rc and set  

     setprop hw.nopm false 

but the battery status icon is not showing on my screen. is there any thing more to do??

regards,

dibin

  • Hi dibin,

    First make sure that your Battery driver generates valid values on all the "sys" entries you have mentioned in your mail.

    And to integrate your battery information to the Android, refer to the file "frameworks/base/services/jni/com_android_server_BatteryService.cpp". Modify the value of the macro "POWER_SUPPLY_PATH" to match to the directory containing all the battery info nodes, and in your case it is "sys/class/power_supply/bq27x00_battery-0".

    So, try this out.

    Hope this helps.

    Regards,

    Umakanta Patro

  • Hi Umakanta,

            i have made changes as per your reply ,but i getting a new error  now

           
    root@android:/ #
    [   83.303192] request_suspend_state: sleep (0->3) at 83683962216 (2000-01-01 00:22:13.455965388 UTC)
    [   83.413543] PM: Syncing filesystems ... done.
    [   83.433410] Freezing user space processes ... (elapsed 0.01 seconds) done.
    [   83.458374] Freezing remaining freezable tasks ... (elapsed 0.02 seconds) done.
    [   83.489868] Suspending console(s) (use no_console_suspend to debug)
    [   83.641174] To set duty cycle 0
    [   83.752777] ------------[ cut here ]------------
    [   83.752807] WARNING: at drivers/regulator/core.c:1371 _regulator_disable+0x68/0x170()
    [   83.752838] unbalanced disables for dummy
    [   83.752838] Modules linked in: omaplfb pvrsrvkm wl12xx mac80211 cfg80211 compat
    [   83.752868] Backtrace:
    [   83.752868] [<c004ee1c>] (dump_backtrace+0x0/0x110) from [<c047cebc>] (dump_stack+0x18/0x1c)
    [   83.752899]  r7:00000009 r6:0000055b r5:c022e9a4 r4:df033d18
    [   83.752899] [<c047cea4>] (dump_stack+0x0/0x1c) from [<c00794fc>] (warn_slowpath_common+0x54/0x6c)
    [   83.752929] [<c00794a8>] (warn_slowpath_common+0x0/0x6c) from [<c00795b8>] (warn_slowpath_fmt+0x38/0x40)
    [   83.752929]  r9:00000000 r8:c02a7dbc r7:df024400 r6:df033d5c r5:fffffffb
    [   83.752960] r4:df024400
    [   83.752960] [<c0079580>] (warn_slowpath_fmt+0x0/0x40) from [<c022e9a4>] (_regulator_disable+0x68/0x170)
    [   83.752960]  r3:c0590654 r2:c0590330
    [   83.752990] [<c022e93c>] (_regulator_disable+0x0/0x170) from [<c022eae8>] (regulator_disable+0x3c/0x7c)
    [   83.752990]  r7:df024400 r6:df033d5c r5:df033d5c r4:df024440
    [   83.753021] [<c022eaac>] (regulator_disable+0x0/0x7c) from [<c0315374>] (__ads7846_disable+0x1c/0x20)
    [   83.753021]  r7:00000000 r6:00000000 r5:df2723f0 r4:df272000
    [   83.753051] [<c0315358>] (__ads7846_disable+0x0/0x20) from [<c03153b8>] (ads7846_suspend+0x40/0x88)
    [   83.753051]  r5:df2723f0 r4:df272000
    [   83.753082] [<c0315378>] (ads7846_suspend+0x0/0x88) from [<c02a7dec>] (spi_suspend+0x30/0x70)
    [   83.753082]  r5:df0b6a00 r4:c0315378
    [   83.753112] [<c02a7dbc>] (spi_suspend+0x0/0x70) from [<c025b8d8>] (legacy_suspend+0x38/0x7c)
    [   83.753112]  r5:df0b6a00 r4:00000002
    [   83.753143] [<c025b8a0>] (legacy_suspend+0x0/0x7c) from [<c025c4a8>] (__device_suspend+0x1d0/0x23c)
    [   83.753143]  r8:c0621f44 r7:df033e00 r6:df0b6a34 r5:00000002 r4:df0b6a00
    [   83.753173] [<c025c2d8>] (__device_suspend+0x0/0x23c) from [<c025c8c0>] (dpm_suspend_start+0x360/0x490)
    [   83.753173]  r7:00000002 r6:df0b6a58 r5:00000000 r4:df0b6a00
    [   83.753204] [<c025c560>] (dpm_suspend_start+0x0/0x490) from [<c00ac220>] (suspend_devices_and_enter+0x48/0x1fc)
    [   83.753204] [<c00ac1d8>] (suspend_devices_and_enter+0x0/0x1fc) from [<c00ac498>] (enter_state+0xc4/0x128)
    [   83.753234]  r7:00000000 r6:00000000 r5:00000003 r4:c056eb92
    [   83.753234] [<c00ac3d4>] (enter_state+0x0/0x128) from [<c00ac51c>] (pm_suspend+0x20/0x24)
    [   83.753265]  r7:00000000 r6:c060f228 r5:c060f228 r4:00000016
    [   83.753265] [<c00ac4fc>] (pm_suspend+0x0/0x24) from [<c00adaac>] (suspend+0x68/0x12c)
    [   83.753295] [<c00ada44>] (suspend+0x0/0x12c) from [<c008ee90>] (process_one_work+0x278/0x3f8)
    [   83.753295]  r6:c00ada44 r5:df024a00 r4:df01dfc0
    [   83.753326] [<c008ec18>] (process_one_work+0x0/0x3f8) from [<c0090ca0>] (worker_thread+0x218/0x410)
    [   83.753326] [<c0090a88>] (worker_thread+0x0/0x410) from [<c0094524>] (kthread+0x8c/0x94)
    [   83.753356] [<c0094498>] (kthread+0x0/0x94) from [<c007c85c>] (do_exit+0x0/0x638)
    [   83.753356]  r7:00000013 r6:c007c85c r5:c0094498 r4:df02bee0
    [   83.753387] ---[ end trace 1b75b31a2719ed20 ]---
    [   83.756958]  plat_kim_suspend
    [   83.757049] PM: suspend of devices complete after 121.429 msecs
    [   83.757415] PM: late suspend of devices complete after 0.366 msecs
    [   83.890838] Powerdomain (core_pwrdm) didn't enter target state 1
    [   83.890838] Powerdomain (per_pwrdm) didn't enter target state 1
    [   83.890838] Could not enter target state in pm_suspend
    [   83.891143] PM: early resume of devices complete after 0.183 msecs
    [   83.891296]  plat_kim_resume
    [   83.891479] platform iva.0: omap_voltage_scale: Already at the requestedrate 800000000
    [   83.891510] platform mpu.0: omap_voltage_scale: Already at the requestedrate 1000000000
    [   84.367492] To set duty cycle 0
    [   84.367645] wakeup wake lock: event1-1257
    [   84.369323] PM: resume of devices complete after 478.118 msecs
    [   84.730102] Restarting tasks ... lsdone.
    [   84.858154] suspend: exit suspend, ret = 0 (2000-01-01 00:22:14.989074706 UTC)
    [   84.901397] mmci-omap-hs mmci-omap-hs.2: could not set regulator OCR (-22)
    [   84.947113] PM: Syncing filesystems ... done.
    [   84.987243] Freezing user space processes ... (elapsed 0.01 seconds) done.
    [   85.013610] Freezing remaining freezable tasks ... (elapsed 0.02 seconds) done.
    [   85.045043] Suspending console(s) (use no_console_suspend to debug)
    [   85.178924] To set duty cycle 0
    [   85.284606] ------------[ cut here ]------------
    [   85.284637] WARNING: at drivers/regulator/core.c:1371 _regulator_disable+0x68/0x170()
    [   85.284667] unbalanced disables for dummy
    [   85.284667] Modules linked in: omaplfb pvrsrvkm wl12xx mac80211 cfg80211 compat
    [   85.284698] Backtrace:
    [   85.284698] [<c004ee1c>] (dump_backtrace+0x0/0x110) from [<c047cebc>] (dump_stack+0x18/0x1c)
    [   85.284729]  r7:00000009 r6:0000055b r5:c022e9a4 r4:df033d18
    [   85.284729] [<c047cea4>] (dump_stack+0x0/0x1c) from [<c00794fc>] (warn_slowpath_common+0x54/0x6c)
    [   85.284759] [<c00794a8>] (warn_slowpath_common+0x0/0x6c) from [<c00795b8>] (warn_slowpath_fmt+0x38/0x40)
    [   85.284759]  r9:00000000 r8:c02a7dbc r7:df024400 r6:df033d5c r5:fffffffb
    [   85.284790] r4:df024400
    [   85.284790] [<c0079580>] (warn_slowpath_fmt+0x0/0x40) from [<c022e9a4>] (_regulator_disable+0x68/0x170)
    [   85.284820]  r3:c0590654 r2:c0590330
    [   85.284820] [<c022e93c>] (_regulator_disable+0x0/0x170) from [<c022eae8>] (regulator_disable+0x3c/0x7c)
    [   85.284820]  r7:df024400 r6:df033d5c r5:df033d5c r4:df024440
    [   85.284851] [<c022eaac>] (regulator_disable+0x0/0x7c) from [<c0315374>] (__ads7846_disable+0x1c/0x20)
    [   85.284851]  r7:00000000 r6:00000000 r5:df2723f0 r4:df272000
    [   85.284881] [<c0315358>] (__ads7846_disable+0x0/0x20) from [<c03153b8>] (ads7846_suspend+0x40/0x88)
    [   85.284881]  r5:df2723f0 r4:df272000
    [   85.284912] [<c0315378>] (ads7846_suspend+0x0/0x88) from [<c02a7dec>] (spi_suspend+0x30/0x70)
    [   85.284912]  r5:df0b6a00 r4:c0315378
    [   85.284942] [<c02a7dbc>] (spi_suspend+0x0/0x70) from [<c025b8d8>] (legacy_suspend+0x38/0x7c)
    [   85.284942]  r5:df0b6a00 r4:00000002
    [   85.284973] [<c025b8a0>] (legacy_suspend+0x0/0x7c) from [<c025c4a8>] (__device_suspend+0x1d0/0x23c)
    [   85.284973]  r8:c0621f44 r7:df033e00 r6:df0b6a34 r5:00000002 r4:df0b6a00
    [   85.285003] [<c025c2d8>] (__device_suspend+0x0/0x23c) from [<c025c8c0>] (dpm_suspend_start+0x360/0x490)
    [   85.285003]  r7:00000002 r6:df0b6a58 r5:00000000 r4:df0b6a00
    [   85.285034] [<c025c560>] (dpm_suspend_start+0x0/0x490) from [<c00a+-----------------------------+er+0x48/0x1fc)
    [   85.285034] [<c00ac1d8>] (suspend_devices_and_enter+0x0/0x1fc) fro|                             |4/0x128)
    [   85.285064]  r7:00000000 r6:00000000 r5:00000003 r4:c056eb92      |  Cannot open /dev/ttyUSB0!  |
    [   85.285064] [<c00ac3d4>] (enter_state+0x0/0x128) from [<c00ac51c>]|                             |
    [   85.285095]  r7:00000000 r6:c060f228 r5:c060f228 r4:0000001c      +-----------------------------+
    [   85.285095] [<c00ac4fc>] (pm_suspend+0x0/0x24) from [<c00adaac>] (suspend+0x68/0x12c)
    [   85.285125] [<c00ada44>] (suspend+0x0/0x12c) from [<c008ee90>] (process_one_work+0x278/0x3f8)
    [   85.285125]  r6:c00ada44 r5:df024a00 r4:df01dfc0
    [   85.285156] [<c008ec18>] (process_one_work+0x0/0x3f8) from [<c0090ca0>] (worker_thread+0x218/0x410)
    [   85.285156] [<c0090a88>] (worker_thread+0x0/0x410) from [<c0094524>] (kthread+0x8c/0x94)
    [   85.285186] [<c0094498>] (kthread+0x0/0x94) from [<c007c85c>] (do_exit+0x0/0x638)
    [   85.285186]  r7:00000013 r6:c007c85c r5:c0094498 r4:df02bee0
    [   85.285217] ---[ end trace 1b75b31a2719ed21 ]---
    [   85.287078]  plat_kim_suspend
    [   85.287170] PM: suspend of devices complete after 111.846 msecs
    [   85.287536] PM: late suspend of devices complete after 0.366 msecs
    [   85.289093] Powerdomain (core_pwrdm) didn't enter target state 1
    [   85.289123] Powerdomain (per_pwrdm) didn't enter target state 1
    [   85.289123] Powerdomain (usbhost_pwrdm) didn't enter target state 1
    [   85.289123] Could not enter target state in pm_suspend
    [   85.289428] PM: early resume of devices complete after 0.183 msecs
    [   85.289581]  plat_kim_resume
    [   85.289764] platform iva.0: omap_voltage_scale: Already at the requestedrate 800000000
    [   85.289794] platform mpu.0: omap_voltage_scale: Already at the requestedrate 1000000000
    [   85.750671] To set duty cycle 0
    [   85.750793] wakeup wake lock: event1-1257
    [   85.751586] PM: resume of devices complete after 462.066 msecs
    [   86.118835] Restarting tasks ... done.
    [   86.202362] suspend: exit suspend, ret = 0 (2000-01-01 00:22:16.333312986 UTC)
    [   86.211700] PM: Syncing filesystems ... done.

    Regards,

    Dibin