struct act8945a_charger {
struct regmap *regmap;
- bool battery_temperature;
};
static int act8945a_get_charger_state(struct regmap *regmap, int *val)
return 0;
}
-static int act8945a_get_battery_health(struct act8945a_charger *charger,
- struct regmap *regmap, int *val)
+static int act8945a_get_battery_health(struct regmap *regmap, int *val)
{
int ret;
unsigned int status;
if (ret < 0)
return ret;
- if (charger->battery_temperature && !(status & APCH_STATUS_TEMPDAT))
+ if (!(status & APCH_STATUS_TEMPDAT))
*val = POWER_SUPPLY_HEALTH_OVERHEAT;
else if (!(status & APCH_STATUS_INDAT))
*val = POWER_SUPPLY_HEALTH_OVERVOLTAGE;
val->intval = POWER_SUPPLY_TECHNOLOGY_LION;
break;
case POWER_SUPPLY_PROP_HEALTH:
- ret = act8945a_get_battery_health(charger,
- regmap, &val->intval);
+ ret = act8945a_get_battery_health(regmap, &val->intval);
break;
case POWER_SUPPLY_PROP_MODEL_NAME:
val->strval = act8945a_charger_model;
return -EINVAL;
}
- charger->battery_temperature = of_property_read_bool(np,
- "active-semi,check-battery-temperature");
-
chglev_pin = of_get_named_gpio_flags(np,
"active-semi,chglev-gpios", 0, &flags);