/**
* struct ab8500_battery_type - different batteries supported
- * @name: battery technology
* @resis_high: battery upper resistance limit
* @resis_low: battery lower resistance limit
* @nominal_voltage: Nominal voltage of the battery in mV
* @batres_tbl battery internal resistance vs temperature table
*/
struct ab8500_battery_type {
- int name;
int resis_high;
int resis_low;
int nominal_voltage;
/* Default battery type for reference designs is the unknown type */
static struct ab8500_battery_type bat_type_thermistor_unknown = {
- .name = POWER_SUPPLY_TECHNOLOGY_UNKNOWN,
.resis_high = 0,
.resis_low = 0,
.battery_resistance = 300,
int rbat, rntc, vntc;
if ((di->bm->adc_therm == AB8500_ADC_THERM_BATCTRL) &&
- (di->bm->bat_type->name == POWER_SUPPLY_TECHNOLOGY_UNKNOWN)) {
+ (di->bm->bi.technology == POWER_SUPPLY_TECHNOLOGY_UNKNOWN)) {
rbat = ab8500_btemp_get_batctrl_res(di);
if (rbat < 0) {
* that need it.
*/
if ((di->bm->adc_therm == AB8500_ADC_THERM_BATCTRL) &&
- (di->bm->bat_type->name == POWER_SUPPLY_TECHNOLOGY_LIPO) &&
+ (di->bm->bi.technology == POWER_SUPPLY_TECHNOLOGY_LIPO) &&
(res <= 53407) && (res >= 12500)) {
dev_dbg(di->dev, "Set BATCTRL current source to 20uA\n");
di->curr_source = BTEMP_BATCTRL_CURR_SRC_20UA;
val->intval = 1;
break;
case POWER_SUPPLY_PROP_TECHNOLOGY:
- val->intval = di->bm->bat_type->name;
+ val->intval = di->bm->bi.technology;
break;
case POWER_SUPPLY_PROP_TEMP:
val->intval = ab8500_btemp_get_temp(di);
switch (ext->desc->type) {
case POWER_SUPPLY_TYPE_BATTERY:
if (!di->flags.batt_id_received &&
- (di->bm->bat_type->name !=
+ (di->bm->bi.technology !=
POWER_SUPPLY_TECHNOLOGY_UNKNOWN)) {
const struct ab8500_battery_type *b;