Merge "smb138x-charger: expose charger temperature"

This commit is contained in:
Linux Build Service Account 2016-09-11 23:19:24 -07:00 committed by Gerrit - the friendly Code Review server
commit 6179dd5c5b
2 changed files with 32 additions and 0 deletions

View file

@ -52,6 +52,22 @@ Charger specific properties:
Value type: <u32>
Definition: Specifies the DC input current limit in micro-amps.
- io-channels
Usage: optional
Value type: List of <phandle u32>
Definition: List of phandle and IIO specifier pairs, one pair
for each IIO input to the device. Note: if the
IIO provider specifies '0' for #io-channel-cells,
then only the phandle portion of the pair will appear.
- io-channel-names
Usage: optional
Value type: List of <string>
Definition: List of IIO input name strings sorted in the same
order as the io-channels property. Consumer drivers
will use io-channel-names to match IIO input names
with IIO specifiers.
================================================
Second Level Nodes - SMB138X Charger Peripherals
================================================

View file

@ -267,6 +267,8 @@ static enum power_supply_property smb138x_batt_props[] = {
POWER_SUPPLY_PROP_PRESENT,
POWER_SUPPLY_PROP_CHARGE_TYPE,
POWER_SUPPLY_PROP_CAPACITY,
POWER_SUPPLY_PROP_CHARGER_TEMP,
POWER_SUPPLY_PROP_CHARGER_TEMP_MAX,
};
static int smb138x_batt_get_prop(struct power_supply *psy,
@ -296,6 +298,12 @@ static int smb138x_batt_get_prop(struct power_supply *psy,
case POWER_SUPPLY_PROP_CAPACITY:
rc = smblib_get_prop_batt_capacity(chg, val);
break;
case POWER_SUPPLY_PROP_CHARGER_TEMP:
rc = smblib_get_prop_charger_temp(chg, val);
break;
case POWER_SUPPLY_PROP_CHARGER_TEMP_MAX:
rc = smblib_get_prop_charger_temp_max(chg, val);
break;
default:
pr_err("batt power supply get prop %d not supported\n",
prop);
@ -381,6 +389,8 @@ static enum power_supply_property smb138x_parallel_props[] = {
POWER_SUPPLY_PROP_INPUT_SUSPEND,
POWER_SUPPLY_PROP_VOLTAGE_MAX,
POWER_SUPPLY_PROP_CURRENT_MAX,
POWER_SUPPLY_PROP_CHARGER_TEMP,
POWER_SUPPLY_PROP_CHARGER_TEMP_MAX,
};
static int smb138x_parallel_get_prop(struct power_supply *psy,
@ -415,6 +425,12 @@ static int smb138x_parallel_get_prop(struct power_supply *psy,
rc = smblib_get_charge_param(chg, &chg->param.fcc,
&val->intval);
break;
case POWER_SUPPLY_PROP_CHARGER_TEMP:
rc = smblib_get_prop_charger_temp(chg, val);
break;
case POWER_SUPPLY_PROP_CHARGER_TEMP_MAX:
rc = smblib_get_prop_charger_temp_max(chg, val);
break;
default:
pr_err("parallel power supply get prop %d not supported\n",
prop);