Piotr Wilczek | 0475044 | 2013-09-24 16:31:22 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2013 Samsung Electronics |
| 3 | * Piotr Wilczek <p.wilczek@samsung.com> |
| 4 | * |
| 5 | * SPDX-License-Identifier: GPL-2.0+ |
| 6 | */ |
| 7 | |
| 8 | #ifndef __MAX77693_FG_H_ |
| 9 | #define __MAX77693_FG_H_ |
| 10 | |
| 11 | /* MAX 77693 registers */ |
| 12 | enum { |
| 13 | MAX77693_STATUS = 0x00, |
| 14 | MAX77693_SOCREP = 0x06, |
| 15 | MAX77693_VCELL = 0x09, |
| 16 | MAX77693_CURRENT = 0x0A, |
| 17 | MAX77693_AVG_CURRENT = 0x0B, |
| 18 | MAX77693_SOCMIX = 0x0D, |
| 19 | MAX77693_SOCAV = 0x0E, |
| 20 | MAX77693_DESIGN_CAP = 0x18, |
| 21 | MAX77693_AVG_VCELL = 0x19, |
| 22 | MAX77693_CONFIG = 0x1D, |
| 23 | MAX77693_VERSION = 0x21, |
| 24 | MAX77693_LEARNCFG = 0x28, |
| 25 | MAX77693_FILTERCFG = 0x29, |
| 26 | MAX77693_RELAXCFG = 0x2A, |
| 27 | MAX77693_MISCCFG = 0x2B, |
| 28 | MAX77693_CGAIN = 0x2E, |
| 29 | MAX77693_COFF = 0x2F, |
| 30 | MAX77693_RCOMP0 = 0x38, |
| 31 | MAX77693_TEMPCO = 0x39, |
| 32 | MAX77693_FSTAT = 0x3D, |
| 33 | MAX77693_VFOCV = 0xEE, |
| 34 | MAX77693_VFSOC = 0xFF, |
| 35 | |
| 36 | FG_NUM_OF_REGS = 0x100, |
| 37 | }; |
| 38 | |
| 39 | #define MAX77693_POR (1 << 1) |
| 40 | |
| 41 | #define MODEL_UNLOCK1 0x0059 |
| 42 | #define MODEL_UNLOCK2 0x00c4 |
| 43 | #define MODEL_LOCK1 0x0000 |
| 44 | #define MODEL_LOCK2 0x0000 |
| 45 | |
| 46 | #define MAX77693_FUEL_I2C_ADDR (0x6C >> 1) |
| 47 | |
| 48 | int power_fg_init(unsigned char bus); |
| 49 | #endif /* __MAX77693_FG_H_ */ |