how the Kernel know the status of battery when it is charging

738 views
Skip to first unread message

carchangel

unread,
Jan 17, 2012, 7:28:21 AM1/17/12
to Android Linux Kernel Development
hello every one
I want to know which source file is responsible for the
battery-charging status in kernel,
can anyone know ,thanks.

Sachin Nikam

unread,
Jan 17, 2012, 11:42:35 PM1/17/12
to android...@googlegroups.com
cd kernel/drivers/power/

See which battery charger/status reporting chip you are using the name of the file would be <chipname>_charger.c

Thanks,
Sachin Nikam.




--
Have a nice time !!!

Cheers,
Sachin.

carchangel

unread,
Jan 20, 2012, 4:19:14 AM1/20/12
to Android Linux Kernel Development
thanks your answer
I did not find any <chipname>_charger.c file respond for my chip
under kernel/drivers/power/ .
but I found <chipname>_bat.c in /drivers/misc/, and it is build into
binary file. In this file the method get_property() which is in struct
"power_supply"
is used to get the battery status. may this is the file I want.

Best wish to you

carchangel


On 1月18日, 午後1:42, Sachin Nikam <sachini...@gmail.com> wrote:
> cd kernel/drivers/power/
>
> See which battery charger/status reporting chip you are using the name of
> the file would be <chipname>_charger.c
>
> Thanks,
> Sachin Nikam.
>

venkatesh yadav

unread,
Jan 20, 2012, 5:10:44 AM1/20/12
to android...@googlegroups.com

u can check  sys/class/power_supply/battery---> for the status like soc,vcell,temp etc
 
the battery charger (chipname_charger) could be in drivers/power/ or it can be in drivers/misc or it can be in drivers/properitory/
 
but actual core file would be drivers/power/power_supply_core.c power_supply_sysfs.c 
 
 
Thanks
Venkatesh
regards
yadav
Reply all
Reply to author
Forward
0 new messages