Skip to content
This repository
Newer
Older
100644 108 lines (93 sloc) 3.736 kb
4bc042bb » Patrick Titiano
2012-09-21 initial public release v1.50
1 /*
2 *
3 * @Component OMAPCONF
4 * @Filename pmic.h
5 * @Description OMAP Power Companion Chip Library
6 * @Author Patrick Titiano (p-titiano@ti.com)
7 * @Date 2012
8 * @Copyright Texas Instruments Incorporated
9 *
10 *
11 * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/
12 *
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 *
18 * Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 *
21 * Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the
24 * distribution.
25 *
26 * Neither the name of Texas Instruments Incorporated nor the names of
27 * its contributors may be used to endorse or promote products derived
28 * from this software without specific prior written permission.
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 *
42 */
43
44
45 #ifndef __PMIC_H__
46 #define __PMIC_H__
47
48
49 #define PMIC_NAME_MAX_LENGTH 12
738d2fc4 » jinzheng
2013-08-09 [PMIC][DRA7] PMIC detection for TPS659038
50 #define PMIC_SMPS_MAX_NUMBER 5
4bc042bb » Patrick Titiano
2012-09-21 initial public release v1.50
51
52
53 typedef enum {
54 PMIC_TWL6030,
55 PMIC_TWL6032,
56 PMIC_TPS62361,
57 PMIC_TWL6034,
58 PMIC_TWL6035,
738d2fc4 » jinzheng
2013-08-09 [PMIC][DRA7] PMIC detection for TPS659038
59 PMIC_TPS659038,
4bc042bb » Patrick Titiano
2012-09-21 initial public release v1.50
60 PMIC_ID_MAX
61 } pmic_id;
62
63
64 typedef enum {
65 PMIC_SMPS_MPU,
66 PMIC_SMPS_MM,
67 PMIC_SMPS_CORE,
738d2fc4 » jinzheng
2013-08-09 [PMIC][DRA7] PMIC detection for TPS659038
68 PMIC_SMPS_GPU,
69 PMIC_SMPS_DSPEVE,
4bc042bb » Patrick Titiano
2012-09-21 initial public release v1.50
70 PMIC_SMPS_ID_MAX
71 } pmic_smps_id;
72
73
738d2fc4 » jinzheng
2013-08-09 [PMIC][DRA7] PMIC detection for TPS659038
74 void pmic_smps_init(pmic_smps_id id, unsigned short is_twl6030,
75 unsigned short is_twl6032, unsigned short is_twl6034,
76 unsigned short is_twl6035, unsigned short tps62361_present,
77 unsigned short tps659038_present);
4bc042bb » Patrick Titiano
2012-09-21 initial public release v1.50
78 int pmic_detect(void);
79
80 pmic_id pmic_chip_get(pmic_smps_id smps_id);
81 unsigned short pmic_is_twl6030(pmic_smps_id smps_id);
82 unsigned short pmic_is_twl6032(pmic_smps_id smps_id);
83 unsigned short pmic_is_twl6034(pmic_smps_id smps_id);
84 unsigned short pmic_is_twl6035(pmic_smps_id smps_id);
85 unsigned short pmic_is_tps62361(pmic_smps_id smps_id);
738d2fc4 » jinzheng
2013-08-09 [PMIC][DRA7] PMIC detection for TPS659038
86 unsigned short pmic_is_tps659038(pmic_smps_id smps_id);
4bc042bb » Patrick Titiano
2012-09-21 initial public release v1.50
87 unsigned short pmic_is_single_chip(void);
88 double pmic_chip_revision_get(pmic_smps_id smps_id);
89 double pmic_eprom_revision_get(pmic_smps_id smps_id);
90 const char *pmic_name_get(pmic_id id);
91
92 pmic_smps_id vdd_id2smps_id(unsigned short vdd_id);
93 unsigned short smps_id2vdd_id(pmic_smps_id smps_id);
94
95 const char *smps_name_get(pmic_smps_id smps_id);
96 long smps_step_get(pmic_smps_id smps_id);
97 long smps_offset_get(pmic_smps_id smps_id);
98 int smps_vsel_len_get(pmic_smps_id smps_id);
99 int smps_uvolt2vsel(pmic_smps_id smps_id, unsigned long uvolt);
100 long smps_vsel2uvolt(pmic_smps_id smps_id, unsigned char vsel);
101 double smps_vsel2volt(pmic_smps_id smps_id, unsigned char vsel);
af697b74 » Patrick Titiano
2012-10-24 [PMIC] add function to round voltage
102 long smps_voltage_round(pmic_smps_id smps_id, long uvolt);
4bc042bb » Patrick Titiano
2012-09-21 initial public release v1.50
103 int smps_vsel_get(pmic_smps_id smps_id);
104 double smps_voltage_get(pmic_smps_id smps_id);
105 int smps_voltage_set(pmic_smps_id smps_id, unsigned long uvolt);
106
107
108 #endif
Something went wrong with that request. Please try again.