drivers:cpcap_battery: Use seperate functions for added code