summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-09-11 23:19:24 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2016-09-11 23:19:23 -0700
commit6179dd5c5b4698dce93d52bc2286617d75c1fe12 (patch)
treee7ebbfcf5aed8118ebe83223d9c304d0010325f1
parent55d84b4e86c3b54407c6f8ed76c7a182ac5169b9 (diff)
parent2e8f65595abaea9ebb7b3fddafe734973c400834 (diff)
Merge "smb138x-charger: expose charger temperature"
-rw-r--r--Documentation/devicetree/bindings/power/qcom-charger/smb138x-charger.txt16
-rw-r--r--drivers/power/qcom-charger/smb138x-charger.c16
2 files changed, 32 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/power/qcom-charger/smb138x-charger.txt b/Documentation/devicetree/bindings/power/qcom-charger/smb138x-charger.txt
index 0549c439460c..0244f910017a 100644
--- a/Documentation/devicetree/bindings/power/qcom-charger/smb138x-charger.txt
+++ b/Documentation/devicetree/bindings/power/qcom-charger/smb138x-charger.txt
@@ -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
================================================
diff --git a/drivers/power/qcom-charger/smb138x-charger.c b/drivers/power/qcom-charger/smb138x-charger.c
index cc72772dba88..a77b0bbc193c 100644
--- a/drivers/power/qcom-charger/smb138x-charger.c
+++ b/drivers/power/qcom-charger/smb138x-charger.c
@@ -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);