merge with master
[kernel/u-boot.git] / include / max77693.h
1 /*
2  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * See file CREDITS for list of people who contributed to this
5  * project.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20  * MA 02111-1307 USA
21  */
22
23 #ifndef _MAX77693_H_
24 #define _MAX77693_H_
25 #include "fuelgauge_battery_data.h"
26
27 #define MAX77693_PMIC_ADDR      (0xCC >> 1)
28 #define MAX77693_MUIC_ADDR      (0x4A >> 1)
29 #define MAX77693_FG_ADDR        (0x6C >> 1)
30
31 enum {
32         CHARGER_NO = 0,
33         CHARGER_TA,
34         CHARGER_USB,
35         CHARGER_TA_500,
36         CHARGER_UNKNOWN
37 };
38
39
40 enum {
41         MAX77693_ADC_GND                = 0x00,
42         MAX77693_ADC_MHL                = 0x01,
43         MAX77693_ADC_DOCK_VOL_DN        = 0x0a,
44         MAX77693_ADC_DOCK_VOL_UP        = 0x0b,
45         MAX77693_ADC_CEA936ATYPE1_CHG   = 0x17,
46         MAX77693_ADC_JIG_USB_OFF        = 0x18,
47         MAX77693_ADC_JIG_USB_ON         = 0x19,
48         MAX77693_ADC_DESKDOCK           = 0x1a,
49         MAX77693_ADC_CEA936ATYPE2_CHG   = 0x1b,
50         MAX77693_ADC_JIG_UART_OFF       = 0x1c,
51         MAX77693_ADC_JIG_UART_ON        = 0x1d,
52         MAX77693_ADC_CARDOCK            = 0x1e,
53         MAX77693_ADC_OPEN               = 0x1f
54 };
55
56 int max77693_init(void);
57 void max77693_pmic_bus_init(int bus_num);
58 int max77693_pmic_probe(void);
59 int max77693_charger_detbat(void);
60 void max77693_muic_bus_init(int bus_num);
61 int max77693_muic_probe(void);
62 int max77693_muic_check(void);
63 int max77693_muic_get_adc(void);
64 void max77693_fg_bus_init(int bus_num);
65 int max77693_fg_probe(void);
66 void max77693_fg_init(enum battery_type batt_type, int charger_type);
67 u32 max77693_fg_get_soc(void);
68 u32 max77693_fg_get_vcell(void);
69 void max77693_fg_show_battery(void);
70
71 #endif