summaryrefslogtreecommitdiff
path: root/include/pmu_tpschrome.h
diff options
context:
space:
mode:
authorRong Chang <rongchang@chromium.org>2012-06-30 17:47:30 +0800
committerGerrit <chrome-bot@google.com>2012-07-01 15:45:09 -0700
commitf4297440050a9fcedad96645ae9ee1606f61bbd0 (patch)
tree01905d1a17a32370e098601ef62f296d66d92ab1 /include/pmu_tpschrome.h
parent6900449d0c4b40d2a12b74bc495fe441e18069e8 (diff)
downloadchrome-ec-f4297440050a9fcedad96645ae9ee1606f61bbd0.tar.gz
Fix multiple charging issues on snow
This change fixes mutiple snow charging issues. Including: - disable i2c host auto selection - i2c_read8 got wrong output value - pmu CHARGE_EN control workaround Signed-off-by: Rong Chang <rongchang@chromium.org> BUG=chrome-os-partner:11010 TEST=Only test on snow dvt with AP turned off plug/unplug ac adapter and check charging led check console command 'battery' Change-Id: I29d554b3daa4cfc538bd5bf5ba5233976d381861 Reviewed-on: https://gerrit.chromium.org/gerrit/26529 Tested-by: Rong Chang <rongchang@chromium.org> Commit-Ready: Rong Chang <rongchang@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/pmu_tpschrome.h')
-rw-r--r--include/pmu_tpschrome.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/pmu_tpschrome.h b/include/pmu_tpschrome.h
index 697e9942d5..0c066beff0 100644
--- a/include/pmu_tpschrome.h
+++ b/include/pmu_tpschrome.h
@@ -8,9 +8,47 @@
#ifndef __CROS_EC_TPSCHROME_H
#define __CROS_EC_TPSCHROME_H
+#define FET_BACKLIGHT 1
+#define FET_LCD_PANEL 6
+/**
+ * Check pmu charger alarm
+ *
+ * @return 0 if there's no charging alarm or pmu access failed
+ * @return 1 if charger over current or over heat
+ */
int pmu_is_charger_alarm(void);
+
+/**
+ * Get pmu power source
+ *
+ * @param ac_good pointer to output value of ac voltage good
+ * @param battery_good pointer to output value of battery voltage good
+ * @return EC_SUCCESS if ac_good and battery_good are set
+ */
int pmu_get_power_source(int *ac_good, int *battery_good);
+
+/**
+ * Enable/disable pmu fet
+ *
+ * @param fet_id the fet to control
+ * @param enable 0 to disable the fet, 1 to enable
+ * @param power_good pointer to value of fet power good
+ * @return EC_SUCCESS if the communication to pmu succeeded
+ */
+int pmu_enable_fet(int fet_id, int enable, int *power_good);
+
+/**
+ * Enable/disable pmu internal charger
+ *
+ * @param enable 0 to disable the charger, 1 to enable
+ * @return EC_SUCCESS if no I2C communication error
+ */
+int pmu_enable_charger(int enable);
+
+/**
+ * * Initialize pmu
+ * */
void pmu_init(void);
#endif /* __CROS_EC_TPSCHROME_H */