summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-09 12:42:37 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-09 12:42:36 -0800
commit8992a2bc85b61a214320738ecae9aea72d2d702d (patch)
tree46d486b74f5bf88ad08e0d8d0e06b10a1af0ca5d
parentde87f8c7f5a1cb440b7264bb3e8a1159356fdc43 (diff)
parent2d7e48a4b3d562004d5b39e8ea3dabe4401f8b04 (diff)
Merge "qpnp-qnovo: Remove dependency on adapter current limit"
-rw-r--r--drivers/power/qcom-charger/qpnp-qnovo.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/drivers/power/qcom-charger/qpnp-qnovo.c b/drivers/power/qcom-charger/qpnp-qnovo.c
index ac1c900f4771..7bc90fbf2929 100644
--- a/drivers/power/qcom-charger/qpnp-qnovo.c
+++ b/drivers/power/qcom-charger/qpnp-qnovo.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2016 The Linux Foundation. All rights reserved.
+/* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -99,8 +99,6 @@
#define VADC_LSB_NA 1220700
#define GAIN_LSB_FACTOR 976560
-#define MIN_EN_UA 1000000
-
#define USER_VOTER "user_voter"
#define OK_TO_QNOVO_VOTER "ok_to_qnovo_voter"
@@ -119,9 +117,7 @@ enum {
struct chg_props {
bool charging;
bool usb_online;
- int usb_input_uA;
bool dc_online;
- int dc_input_uA;
};
struct chg_status {
@@ -1092,7 +1088,6 @@ static void get_chg_props(struct qnovo *chip, struct chg_props *cp)
}
cp->usb_online = false;
- cp->usb_input_uA = 0;
if (!chip->usb_psy)
chip->usb_psy = power_supply_get_by_name("usb");
if (chip->usb_psy) {
@@ -1102,17 +1097,9 @@ static void get_chg_props(struct qnovo *chip, struct chg_props *cp)
pr_err("Couldn't read usb online rc = %d\n", rc);
else
cp->usb_online = (bool)pval.intval;
-
- rc = power_supply_get_property(chip->usb_psy,
- POWER_SUPPLY_PROP_CURRENT_MAX, &pval);
- if (rc < 0)
- pr_err("Couldn't read usb current max rc = %d\n", rc);
- else
- cp->usb_input_uA = pval.intval;
}
cp->dc_online = false;
- cp->dc_input_uA = 0;
if (!chip->dc_psy)
chip->dc_psy = power_supply_get_by_name("dc");
if (chip->dc_psy) {
@@ -1122,13 +1109,6 @@ static void get_chg_props(struct qnovo *chip, struct chg_props *cp)
pr_err("Couldn't read dc online rc = %d\n", rc);
else
cp->dc_online = (bool)pval.intval;
-
- rc = power_supply_get_property(chip->dc_psy,
- POWER_SUPPLY_PROP_CURRENT_MAX, &pval);
- if (rc < 0)
- pr_err("Couldn't read dc current max rc = %d\n", rc);
- else
- cp->dc_input_uA = pval.intval;
}
}
@@ -1138,8 +1118,7 @@ static void get_chg_status(struct qnovo *chip, const struct chg_props *cp,
cs->ok_to_qnovo = false;
if (cp->charging &&
- ((cp->usb_online && cp->usb_input_uA >= MIN_EN_UA)
- || (cp->dc_online && cp->dc_input_uA >= MIN_EN_UA)))
+ (cp->usb_online || cp->dc_online))
cs->ok_to_qnovo = true;
}