summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhijeet Dharmapurikar <adharmap@codeaurora.org>2017-01-04 19:18:32 -0800
committerAbhijeet Dharmapurikar <adharmap@codeaurora.org>2017-01-05 21:41:39 -0800
commit2d7e48a4b3d562004d5b39e8ea3dabe4401f8b04 (patch)
treef6d5bc65dd01175c92d105dfb9e073b7e6dbf8e5
parent55e8426a192811d7567f19d7e781727f46b0406d (diff)
qpnp-qnovo: Remove dependency on adapter current limit
Currently enabling of Qnovo isn't allowed unless a charger with minimum 1A current limit is detected. This is not required. Allow enabling of Qnovo regardless of the charger current limit. Change-Id: I1726423d3bc31725c162f09b907683d6e63ac6b5 Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
-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;
}