Example #1
0
static void twl4030_bci_battery_read_status(struct twl4030_bci_device_info *di)
{
	di->temp_C = twl4030battery_temperature();
	di->voltage_uV = twl4030battery_voltage();
	di->current_uA = twl4030battery_current();
	di->capacity = twl4030battery_capacity(di);
}
Example #2
0
ssize_t show_t2_curr(struct device *dev, struct device_attribute *attr,
	char *buf)
{
	char *sval = buf;
	
	sval += sprintf (sval, "BATTERY DRIVER: Main battery current %d  \n ",
			twl4030battery_current());
	
	sval+= 1;
	*sval=0;
	
	return sval - buf + 1;
}