Commit f0f14c37 authored by Vincent Zvikaramba's avatar Vincent Zvikaramba

Revert "sm5703_charge: Remove charging limit"

This reverts commit 75b93d75.

Change-Id: Id06eb921391a47ea91450f744b6dc7287e4f0a1b
parent f7d5d0ae
......@@ -72,6 +72,7 @@ CONFIG_BATTERY_SAMSUNG_DATA_FILE="j5_battery_data.h"
CONFIG_SAMSUNG_LPM_MODE=y
CONFIG_FUELGAUGE_SM5703=y
CONFIG_BATTERY_SWELLING=y
CONFIG_SIOP_CHARGING_LIMIT_CURRENT=1200
CONFIG_PREVENT_SOC_JUMP=y
CONFIG_SW_SELF_DISCHARGING=y
CONFIG_CHARGER_SM5703_DUALPATH=y
......
......@@ -77,6 +77,7 @@ CONFIG_BATTERY_SAMSUNG_DATA_FILE="j5_battery_data.h"
CONFIG_SAMSUNG_LPM_MODE=y
CONFIG_FUELGAUGE_SM5703=y
CONFIG_BATTERY_SWELLING=y
CONFIG_SIOP_CHARGING_LIMIT_CURRENT=1000
CONFIG_PREVENT_SOC_JUMP=y
# DUAL SIM / SINGLE SIM Detection
......
......@@ -72,6 +72,7 @@ CONFIG_BATTERY_SAMSUNG_DATA_FILE="j5_battery_data.h"
CONFIG_SAMSUNG_LPM_MODE=y
CONFIG_FUELGAUGE_SM5703=y
CONFIG_BATTERY_SWELLING=y
CONFIG_SIOP_CHARGING_LIMIT_CURRENT=1200
CONFIG_PREVENT_SOC_JUMP=y
CONFIG_SW_SELF_DISCHARGING=y
CONFIG_CHARGER_SM5703_DUALPATH=y
......
......@@ -77,6 +77,7 @@ CONFIG_BATTERY_SAMSUNG_DATA_FILE="j5_battery_data.h"
CONFIG_SAMSUNG_LPM_MODE=y
CONFIG_FUELGAUGE_SM5703=y
CONFIG_BATTERY_SWELLING=y
CONFIG_SIOP_CHARGING_LIMIT_CURRENT=1200
CONFIG_PREVENT_SOC_JUMP=y
CONFIG_SW_SELF_DISCHARGING=y
CONFIG_CHARGER_SM5703_DUALPATH=y
......
......@@ -93,6 +93,7 @@ CONFIG_BATTERY_SAMSUNG_DATA_FILE="j5x_battery_data.h"
CONFIG_SAMSUNG_LPM_MODE=y
CONFIG_FUELGAUGE_SM5703=y
CONFIG_BATTERY_SWELLING=y
CONFIG_SIOP_CHARGING_LIMIT_CURRENT=700
CONFIG_PREVENT_SOC_JUMP=y
CONFIG_SW_SELF_DISCHARGING=y
CONFIG_CHARGER_SM5703_DUALPATH=y
......
......@@ -93,6 +93,7 @@ CONFIG_BATTERY_SAMSUNG_DATA_FILE="j5x_battery_data.h"
CONFIG_SAMSUNG_LPM_MODE=y
CONFIG_FUELGAUGE_SM5703=y
CONFIG_BATTERY_SWELLING=y
CONFIG_SIOP_CHARGING_LIMIT_CURRENT=1200
CONFIG_PREVENT_SOC_JUMP=y
CONFIG_SW_SELF_DISCHARGING=y
CONFIG_CHARGER_SM5703_DUALPATH=y
......
......@@ -63,6 +63,7 @@ CONFIG_BATTERY_SAMSUNG_DATA_FILE="o7_battery_data.h"
CONFIG_SAMSUNG_LPM_MODE=y
CONFIG_FUELGAUGE_SM5703=y
CONFIG_BATTERY_SWELLING=y
CONFIG_SIOP_CHARGING_LIMIT_CURRENT=1200
CONFIG_PREVENT_SOC_JUMP=y
CONFIG_CHARGER_SM5703_SOFT_START_CHARGING=y
CONFIG_CHARGER_SM5703_DUALPATH=y
......
......@@ -49,6 +49,11 @@
#define EN_TEST_READ 1
#endif
#if defined(CONFIG_BATTERY_SWELLING)
#define LIMIT_SWELLING_VOLTAGE 4000
#define LIMIT_SWELLING_CURRENT 300
#endif
static int sm5703_reg_map[] = {
SM5703_INTMSK1,
SM5703_INTMSK2,
......@@ -571,15 +576,22 @@ static void __sm5703_set_termination_current_limit(struct i2c_client *i2c,
static void sm5703_set_charging_current(struct sm5703_charger_data *charger, int topoff)
{
int adj_current = 0;
#ifndef CONFIG_DISABLE_MINIMUM_SIOP_CHARGING
const int usb_charging_current = charger->pdata->charging_current_table[
POWER_SUPPLY_TYPE_USB].fast_charging_current;
#endif
adj_current = charger->charging_current * charger->siop_level / 100;
#ifndef CONFIG_DISABLE_MINIMUM_SIOP_CHARGING
if (adj_current > 0 && adj_current < usb_charging_current)
adj_current = usb_charging_current;
#endif
#if CONFIG_SIOP_CHARGING_LIMIT_CURRENT
if(charger->siop_level < 100 && adj_current > CONFIG_SIOP_CHARGING_LIMIT_CURRENT)
adj_current = CONFIG_SIOP_CHARGING_LIMIT_CURRENT;
#endif
pr_info("%s adj_current = %dmA charger->siop_level = %d\n",__func__, adj_current,charger->siop_level);
mutex_lock(&charger->io_lock);
__sm5703_set_fast_charging_current(charger->sm5703->i2c_client,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment