|
|
|
@ -58,16 +58,22 @@ static enum power_supply_property sec_battery_props[] = { |
|
|
|
|
|
|
|
|
|
static enum power_supply_property sec_power_props[] = { |
|
|
|
|
POWER_SUPPLY_PROP_ONLINE, |
|
|
|
|
POWER_SUPPLY_PROP_VOLTAGE_MAX, |
|
|
|
|
POWER_SUPPLY_PROP_CURRENT_MAX, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static enum power_supply_property sec_wireless_props[] = { |
|
|
|
|
POWER_SUPPLY_PROP_ONLINE, |
|
|
|
|
POWER_SUPPLY_PROP_PRESENT, |
|
|
|
|
POWER_SUPPLY_PROP_VOLTAGE_MAX, |
|
|
|
|
POWER_SUPPLY_PROP_CURRENT_MAX, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static enum power_supply_property sec_ac_props[] = { |
|
|
|
|
POWER_SUPPLY_PROP_ONLINE, |
|
|
|
|
POWER_SUPPLY_PROP_TEMP, |
|
|
|
|
POWER_SUPPLY_PROP_VOLTAGE_MAX, |
|
|
|
|
POWER_SUPPLY_PROP_CURRENT_MAX, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
static enum power_supply_property sec_ps_props[] = { |
|
|
|
@ -6160,8 +6166,20 @@ static int sec_usb_get_property(struct power_supply *psy, |
|
|
|
|
{ |
|
|
|
|
struct sec_battery_info *battery = power_supply_get_drvdata(psy); |
|
|
|
|
|
|
|
|
|
if (psp != POWER_SUPPLY_PROP_ONLINE) |
|
|
|
|
switch (psp) { |
|
|
|
|
case POWER_SUPPLY_PROP_ONLINE: |
|
|
|
|
break; |
|
|
|
|
case POWER_SUPPLY_PROP_VOLTAGE_MAX: |
|
|
|
|
/* V -> uV */ |
|
|
|
|
val->intval = battery->input_voltage * 1000000; |
|
|
|
|
return 0; |
|
|
|
|
case POWER_SUPPLY_PROP_CURRENT_MAX: |
|
|
|
|
/* mA -> uA */ |
|
|
|
|
val->intval = battery->pdata->charging_current[battery->cable_type].input_current_limit * 1000; |
|
|
|
|
return 0; |
|
|
|
|
default: |
|
|
|
|
return -EINVAL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ((battery->health == POWER_SUPPLY_HEALTH_OVERVOLTAGE) || |
|
|
|
|
(battery->health == POWER_SUPPLY_HEALTH_UNDERVOLTAGE)) { |
|
|
|
@ -6238,6 +6256,14 @@ static int sec_ac_get_property(struct power_supply *psy, |
|
|
|
|
case POWER_SUPPLY_PROP_TEMP: |
|
|
|
|
val->intval = battery->chg_temp; |
|
|
|
|
break; |
|
|
|
|
case POWER_SUPPLY_PROP_VOLTAGE_MAX: |
|
|
|
|
/* V -> uV */ |
|
|
|
|
val->intval = battery->input_voltage * 1000000; |
|
|
|
|
return 0; |
|
|
|
|
case POWER_SUPPLY_PROP_CURRENT_MAX: |
|
|
|
|
/* mA -> uA */ |
|
|
|
|
val->intval = battery->pdata->charging_current[battery->cable_type].input_current_limit * 1000; |
|
|
|
|
return 0; |
|
|
|
|
default: |
|
|
|
|
return -EINVAL; |
|
|
|
|
} |
|
|
|
@ -6265,6 +6291,14 @@ static int sec_wireless_get_property(struct power_supply *psy, |
|
|
|
|
val->intval = (battery->pdata->wireless_charger_name) ? |
|
|
|
|
1 : 0; |
|
|
|
|
break; |
|
|
|
|
case POWER_SUPPLY_PROP_VOLTAGE_MAX: |
|
|
|
|
/* V -> uV */ |
|
|
|
|
val->intval = battery->input_voltage * 1000000; |
|
|
|
|
return 0; |
|
|
|
|
case POWER_SUPPLY_PROP_CURRENT_MAX: |
|
|
|
|
/* mA -> uA */ |
|
|
|
|
val->intval = battery->pdata->charging_current[battery->cable_type].input_current_limit * 1000; |
|
|
|
|
return 0; |
|
|
|
|
default: |
|
|
|
|
return -EINVAL; |
|
|
|
|
} |
|
|
|
|