Commit a7a28049 authored by Major Lee's avatar Major Lee Committed by Ingo Molnar

x86/mrst: Battery fixes

When DCDC input line over current detecting, PMIC will change
charging current automatically.  Logging event is enough.
Signed-off-by: default avatarMajor Lee <major_lee@wistron.com>
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Feng Tang <feng.tang@intel.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
[fix build]
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 2cd1c8d4
...@@ -61,7 +61,8 @@ MODULE_PARM_DESC(debug, "Flag to enable PMIC Battery debug messages."); ...@@ -61,7 +61,8 @@ MODULE_PARM_DESC(debug, "Flag to enable PMIC Battery debug messages.");
#define PMIC_BATT_CHR_SBATDET_MASK (1 << 5) #define PMIC_BATT_CHR_SBATDET_MASK (1 << 5)
#define PMIC_BATT_CHR_SDCLMT_MASK (1 << 6) #define PMIC_BATT_CHR_SDCLMT_MASK (1 << 6)
#define PMIC_BATT_CHR_SUSBOVP_MASK (1 << 7) #define PMIC_BATT_CHR_SUSBOVP_MASK (1 << 7)
#define PMIC_BATT_CHR_EXCPT_MASK 0xC6 #define PMIC_BATT_CHR_EXCPT_MASK 0x86
#define PMIC_BATT_ADC_ACCCHRG_MASK (1 << 31) #define PMIC_BATT_ADC_ACCCHRG_MASK (1 << 31)
#define PMIC_BATT_ADC_ACCCHRGVAL_MASK 0x7FFFFFFF #define PMIC_BATT_ADC_ACCCHRGVAL_MASK 0x7FFFFFFF
...@@ -304,11 +305,6 @@ static void pmic_battery_read_status(struct pmic_power_module_info *pbi) ...@@ -304,11 +305,6 @@ static void pmic_battery_read_status(struct pmic_power_module_info *pbi)
pbi->batt_status = POWER_SUPPLY_STATUS_NOT_CHARGING; pbi->batt_status = POWER_SUPPLY_STATUS_NOT_CHARGING;
pmic_battery_log_event(BATT_EVENT_BATOVP_EXCPT); pmic_battery_log_event(BATT_EVENT_BATOVP_EXCPT);
batt_exception = 1; batt_exception = 1;
} else if (r8 & PMIC_BATT_CHR_SDCLMT_MASK) {
pbi->batt_health = POWER_SUPPLY_HEALTH_OVERVOLTAGE;
pbi->batt_status = POWER_SUPPLY_STATUS_NOT_CHARGING;
pmic_battery_log_event(BATT_EVENT_DCLMT_EXCPT);
batt_exception = 1;
} else if (r8 & PMIC_BATT_CHR_STEMP_MASK) { } else if (r8 & PMIC_BATT_CHR_STEMP_MASK) {
pbi->batt_health = POWER_SUPPLY_HEALTH_OVERHEAT; pbi->batt_health = POWER_SUPPLY_HEALTH_OVERHEAT;
pbi->batt_status = POWER_SUPPLY_STATUS_NOT_CHARGING; pbi->batt_status = POWER_SUPPLY_STATUS_NOT_CHARGING;
...@@ -316,6 +312,10 @@ static void pmic_battery_read_status(struct pmic_power_module_info *pbi) ...@@ -316,6 +312,10 @@ static void pmic_battery_read_status(struct pmic_power_module_info *pbi)
batt_exception = 1; batt_exception = 1;
} else { } else {
pbi->batt_health = POWER_SUPPLY_HEALTH_GOOD; pbi->batt_health = POWER_SUPPLY_HEALTH_GOOD;
if (r8 & PMIC_BATT_CHR_SDCLMT_MASK) {
/* PMIC will change charging current automatically */
pmic_battery_log_event(BATT_EVENT_DCLMT_EXCPT);
}
} }
} }
......
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