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); }
ssize_t show_t2_temp(struct device *dev, struct device_attribute *attr, char *buf) { char *sval = buf; sval += sprintf (sval,"BATTERY DRIVER:Main battery temperature %d \n ", twl4030battery_temperature()); sval+= 1; *sval=0; return sval - buf + 1; }
static void twl4030_bci_battery_read_status(struct twl4030_bci_device_info *di) { /* Read Battery Status */ di->temp_C = twl4030battery_temperature(); // Read Temperature if(system_rev >= 2 && di->battery_present) { // Adjust RCOMP for fuelgauge(Rev.D) max17043_set_rcomp_by_temperature(di->temp_C); // TODO : max17043_update } //20120221, [email protected] , When is suddenly Over temperature, retry read temperature. [START] if (di->temp_C >600 && di->temp_C != 0xBA00E00){ msleep(10); printk("[BATTERY] When suddenly OverTemp. temp_C : %d \n", di->temp_C); di->temp_C = twl4030battery_temperature(); printk("[BATTERY] When suddenly OverTemp. retry temp_C : %d \n", di->temp_C); } //20120221, [email protected] , When is suddenly Over temperature, retry read temperature. [END] di->voltage_uV = twl4030battery_voltage(); // Read Voltage di->battery_capacity = twl4030battery_capacity(di); // Read Capacity di->battery_present = check_battery_present(); // Set Battery Present /* hub do not use BCI block. so we cannot measure battery current */ di->current_uA = 0; }