OLD | NEW |
(Empty) | |
| 1 /* Header file for Quanta I2C Battery Driver |
| 2 * |
| 3 * Copyright (C) 2009 Quanta Computer Inc. |
| 4 * |
| 5 * This software is licensed under the terms of the GNU General Public |
| 6 * License version 2, as published by the Free Software Foundation, and |
| 7 * may be copied, distributed, and modified under those terms. |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 */ |
| 15 |
| 16 /* |
| 17 * |
| 18 * The Driver with I/O communications via the I2C Interface for ON2 of AP BU. |
| 19 * And it is only working on the nuvoTon WPCE775x Embedded Controller. |
| 20 * |
| 21 */ |
| 22 |
| 23 #ifndef __QCI_BATTERY_H__ |
| 24 #define __QCI_BATTERY_H__ |
| 25 |
| 26 #define BAT_I2C_ADDRESS 0x1A |
| 27 #define BATTERY_ID_NAME "qci-i2cbat" |
| 28 #define EC_FLAG_ADAPTER_IN 0x01 |
| 29 #define EC_FLAG_POWER_ON 0x02 |
| 30 #define EC_FLAG_ENTER_S3 0x04 |
| 31 #define EC_FLAG_ENTER_S4 0x08 |
| 32 #define EC_FLAG_IN_STANDBY 0x10 |
| 33 #define EC_FLAG_SYSTEM_ON 0x20 |
| 34 #define EC_FLAG_WAIT_HWPG 0x40 |
| 35 #define EC_FLAG_S5_POWER_ON 0x80 |
| 36 |
| 37 #define MAIN_BATTERY_STATUS_BAT_IN 0x01 |
| 38 #define MAIN_BATTERY_STATUS_BAT_FULL 0x02 |
| 39 #define MAIN_BATTERY_STATUS_BAT_ABNORMAL 0x04 |
| 40 #define MAIN_BATTERY_STATUS_BAT_CHARGING 0x08 |
| 41 #define MAIN_BATTERY_STATUS_BAT_CRITICAL 0x10 |
| 42 #define MAIN_BATTERY_STATUS_BAT_LOW 0x20 |
| 43 #define MAIN_BATTERY_STATUS_BAT_DISCHRG 0x40 |
| 44 #define MAIN_BATTERY_STATUS_BAT_SMB_VALID 0x80 |
| 45 |
| 46 #define CHG_STATUS_BAT_CHARGE 0x01 |
| 47 #define CHG_STATUS_BAT_PRECHG 0x02 |
| 48 #define CHG_STATUS_BAT_OVERTEMP 0x04 |
| 49 #define CHG_STATUS_BAT_TYPE 0x08 |
| 50 #define CHG_STATUS_BAT_GWROK 0x10 |
| 51 #define CHG_STATUS_BAT_INCHARGE 0x20 |
| 52 #define CHG_STATUS_BAT_WAKECHRG 0x40 |
| 53 #define CHG_STATUS_BAT_CHGTIMEOUT 0x80 |
| 54 |
| 55 #define EC_ADAPTER_PRESENT 0x1 |
| 56 #define EC_BAT_PRESENT 0x1 |
| 57 #define EC_ADAPTER_NOT_PRESENT 0x0 |
| 58 #define EC_BAT_NOT_PRESENT 0x0 |
| 59 #define I2C_BAT_BUFFER_LEN 12 |
| 60 |
| 61 #endif |
OLD | NEW |