[processor-sdk/performance-audio-sr.git] / psdk_cust / pdk_k2g_1_0_1_2_eng / packages / ti / board / src / evmAM572x / device / pmic_device.h
1 /**
2 * \file pmic_device.h
3 *
4 * \brief The file contains the declaration for pmic data structure.
5 *
6 */
8 /*
9 * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 *
15 * Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 *
18 * Redistributions in binary form must reproduce the above copyright
19 * notice, this list of conditions and the following disclaimer in the
20 * documentation and/or other materials provided with the
21 * distribution.
22 *
23 * Neither the name of Texas Instruments Incorporated nor the names of
24 * its contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 *
39 */
41 #ifndef __PMIC_DEVICE_H
42 #define __PMIC_DEVICE_H
44 /* ========================================================================== */
45 /* Include Files */
46 /* ========================================================================== */
47 #include <stdint.h>
49 #include <ti/drv/i2c/I2C.h>
50 #include <ti/drv/i2c/soc/I2C_v1.h>
52 #ifdef __cplusplus /* If this is a C++ compiler, use C linkage */
53 extern "C"
54 {
55 #endif
57 /* TPS659039 */
58 #define TPS659039_I2C_SLAVE_ADDR 0x58
59 #define TPS659039_REG_ADDR_SMPS12 0x23
60 #define TPS659039_REG_ADDR_SMPS45 0x2B
61 #define TPS659039_REG_ADDR_SMPS6 0x2F
62 #define TPS659039_REG_ADDR_SMPS7 0x33
63 #define TPS659039_REG_ADDR_SMPS8 0x37
65 typedef struct pmic_data {
66 uint32_t base_offset;
67 uint32_t step;
68 uint32_t start_code;
69 uint32_t slave_addr;
70 uint32_t dev_instance;
71 void (*pmic_device_open)(uint32_t instance);
72 bool (*pmic_write)(uint32_t slaveAddr, uint8_t reg_addr, uint8_t value);
73 uint32_t (*pmic_get_offset)(uint32_t volt_offset, struct pmic_data *pmic);
74 void (*pmic_device_close)();
75 }pmic_data_t;
77 /**
78 * \brief This API returns the pointer to the structure holding PMIC data.
79 *
80 * \param pPmicData Pointer to the PMIC data structure.
81 */
82 pmic_data_t* Board_GetPmicData();
84 #ifdef __cplusplus /* If this is a C++ compiler, end C linkage */
85 }
86 #endif
88 #endif /*__PMIC_DEVICE_H*/