Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1467404

[PATCH v7 1/7] power: act8945a_charger: Remove "battery_temperature"

From Wenyou Yang <wenyou.yang@atmel.com>
Newsgroups linux.kernel
Subject [PATCH v7 1/7] power: act8945a_charger: Remove "battery_temperature"
Date 2016-08-22 09:00 +0200
Message-ID <s8Rnc-2P6-11@gated-at.bofh.it> (permalink)
References <s8Rdw-2H5-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Remove "battery_temperature" member, it is redundant, it is the
hardware's responsibility to handle TH pin properly.
It is unnecessary to use the dt property to check if there is
a battery temperature monitor or not.

Signed-off-by: Wenyou Yang <wenyou.yang@atmel.com>
---

Changes in v7:
 - Fix the missing negation sign.

Changes in v6: None
Changes in v5: None
Changes in v4: None
Changes in v3: None
Changes in v2: None

 drivers/power/supply/act8945a_charger.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/power/supply/act8945a_charger.c b/drivers/power/supply/act8945a_charger.c
index b5c00e4..9894577 100644
--- a/drivers/power/supply/act8945a_charger.c
+++ b/drivers/power/supply/act8945a_charger.c
@@ -76,7 +76,6 @@ static const char *act8945a_charger_manufacturer = "Active-semi";
 
 struct act8945a_charger {
 	struct regmap *regmap;
-	bool battery_temperature;
 };
 
 static int act8945a_get_charger_state(struct regmap *regmap, int *val)
@@ -138,8 +137,7 @@ static int act8945a_get_charge_type(struct regmap *regmap, int *val)
 	return 0;
 }
 
-static int act8945a_get_battery_health(struct act8945a_charger *charger,
-				       struct regmap *regmap, int *val)
+static int act8945a_get_battery_health(struct regmap *regmap, int *val)
 {
 	int ret;
 	unsigned int status;
@@ -148,7 +146,7 @@ static int act8945a_get_battery_health(struct act8945a_charger *charger,
 	if (ret < 0)
 		return ret;
 
-	if (charger->battery_temperature && !(status & APCH_STATUS_TEMPDAT))
+	if (!(status & APCH_STATUS_TEMPDAT))
 		*val = POWER_SUPPLY_HEALTH_OVERHEAT;
 	else if (!(status & APCH_STATUS_INDAT))
 		*val = POWER_SUPPLY_HEALTH_OVERVOLTAGE;
@@ -188,8 +186,7 @@ static int act8945a_charger_get_property(struct power_supply *psy,
 		val->intval = POWER_SUPPLY_TECHNOLOGY_LION;
 		break;
 	case POWER_SUPPLY_PROP_HEALTH:
-		ret = act8945a_get_battery_health(charger,
-						  regmap, &val->intval);
+		ret = act8945a_get_battery_health(regmap, &val->intval);
 		break;
 	case POWER_SUPPLY_PROP_MODEL_NAME:
 		val->strval = act8945a_charger_model;
@@ -235,9 +232,6 @@ static int act8945a_charger_config(struct device *dev,
 		return -EINVAL;
 	}
 
-	charger->battery_temperature = of_property_read_bool(np,
-				"active-semi,check-battery-temperature");
-
 	chglev_pin = of_get_named_gpio_flags(np,
 				"active-semi,chglev-gpios", 0, &flags);
 
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v7 0/7] power: act8945a_charger: Improvements Wenyou Yang <wenyou.yang@atmel.com> - 2016-08-22 08:50 +0200
  [PATCH v7 1/7] power: act8945a_charger: Remove "battery_temperature" Wenyou Yang <wenyou.yang@atmel.com> - 2016-08-22 09:00 +0200
  [PATCH v7 4/7] power: act8945a_charger: Fix the power supply type Wenyou Yang <wenyou.yang@atmel.com> - 2016-08-22 09:00 +0200
  [PATCH v7 2/7] power: act8945a_charger: Improve Wenyou Yang <wenyou.yang@atmel.com> - 2016-08-22 09:00 +0200
  [PATCH v7 7/7] doc: bindings: act8945a-charger: Update properties Wenyou Yang <wenyou.yang@atmel.com> - 2016-08-22 09:00 +0200
    Re: [PATCH v7 7/7] doc: bindings: act8945a-charger: Update properties Sebastian Reichel <sre@kernel.org> - 2016-08-23 05:10 +0200
  [PATCH v7 6/7] power: act8945a_charger: Add max current property Wenyou Yang <wenyou.yang@atmel.com> - 2016-08-22 09:00 +0200
    Re: [PATCH v7 6/7] power: act8945a_charger: Add max current property Sebastian Reichel <sre@kernel.org> - 2016-08-23 04:50 +0200
  [PATCH v7 3/7] power: act8945a_charger: Add status change update support Wenyou Yang <wenyou.yang@atmel.com> - 2016-08-22 09:00 +0200
  [PATCH v7 5/7] power: act8945a_charger: Add capacity level property Wenyou Yang <wenyou.yang@atmel.com> - 2016-08-22 09:00 +0200
    Re: [PATCH v7 5/7] power: act8945a_charger: Add capacity level  property Sebastian Reichel <sre@kernel.org> - 2016-08-23 04:50 +0200

csiph-web