summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/ab8500_fg.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2022-02-26 00:27:57 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2022-02-28 11:34:31 +0100
commit1f918e0fe43ec41d906e2cf96b80b15451fed7ba (patch)
tree0e2de0ee5e69c0d5c5987046c6d22d17d67e089c /drivers/power/supply/ab8500_fg.c
parent0e8b903b522b5a3cb473035cea085d396dd7150a (diff)
downloadlinux-1f918e0fe43ec41d906e2cf96b80b15451fed7ba.tar.bz2
power: supply: ab8500: Standardize BTI resistance
The Battery Type Indicator (BTI) resistor is a resistor mounted between a special terminal on the battery and ground. By sending a fixed current (such as 7mA) through this resistor and measuring the voltage over it, the resistance can be determined, and this verifies the battery type. Typical side view of the battery: o o o GND BTI +3.8V Typical example of the electrical layout: +3.8 V BTI | | | + | _______ [ ] 7kOhm ___ | | | | | GND GND By verifying this resistance before attempting to charge the battery we add an additional level of security. In some systems this is used for plug-and-play of batteries with different capacity. In other cases, this is merely used to verify that the right type of battery is connected, if several batteries have the same physical shape and can be plugged into the same slot. Sometimes this is just a surplus security mechanism. Nokia and Samsung among many other vendors are known to use these BTI resistors. Add the BTI properties to struct power_supply_battery_info and switch the AB8500 charger code over to using it. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply/ab8500_fg.c')
-rw-r--r--drivers/power/supply/ab8500_fg.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c
index 0227e800c58d..f2ff3103e0d0 100644
--- a/drivers/power/supply/ab8500_fg.c
+++ b/drivers/power/supply/ab8500_fg.c
@@ -2241,10 +2241,6 @@ static int ab8500_fg_get_ext_psy_data(struct device *dev, void *data)
if (!di->flags.batt_id_received &&
(bi && (bi->technology !=
POWER_SUPPLY_TECHNOLOGY_UNKNOWN))) {
- const struct ab8500_battery_type *b;
-
- b = di->bm->bat_type;
-
di->flags.batt_id_received = true;
di->bat_cap.max_mah_design =