2 * (C) Copyright 2011-2013
3 * Texas Instruments, <www.ti.com>
5 * SPDX-License-Identifier: GPL-2.0+
7 * For more details, please see the TRM at http://www.ti.com/product/tps65217a
10 #ifndef __POWER_TPS65217_H__
11 #define __POWER_TPS65217_H__
13 /* I2C chip address */
14 #define TPS65217_CHIP_PM 0x24
18 TPS65217_CHIPID = 0x00,
41 TPS65217_RESERVED0, /* no 0x17 register available */
49 TPS65217_PMIC_NUM_OF_REGS,
52 #define TPS65217_PROT_LEVEL_NONE 0x00
53 #define TPS65217_PROT_LEVEL_1 0x01
54 #define TPS65217_PROT_LEVEL_2 0x02
56 #define TPS65217_PASSWORD_LOCK_FOR_WRITE 0x00
57 #define TPS65217_PASSWORD_UNLOCK 0x7D
59 #define TPS65217_DCDC_GO 0x80
61 #define TPS65217_MASK_ALL_BITS 0xFF
63 #define TPS65217_USB_INPUT_CUR_LIMIT_MASK 0x03
64 #define TPS65217_USB_INPUT_CUR_LIMIT_100MA 0x00
65 #define TPS65217_USB_INPUT_CUR_LIMIT_500MA 0x01
66 #define TPS65217_USB_INPUT_CUR_LIMIT_1300MA 0x02
67 #define TPS65217_USB_INPUT_CUR_LIMIT_1800MA 0x03
69 #define TPS65217_DCDC_VOLT_SEL_950MV 0x02
70 #define TPS65217_DCDC_VOLT_SEL_1100MV 0x08
71 #define TPS65217_DCDC_VOLT_SEL_1125MV 0x09
72 #define TPS65217_DCDC_VOLT_SEL_1200MV 0x0c
73 #define TPS65217_DCDC_VOLT_SEL_1275MV 0x0F
74 #define TPS65217_DCDC_VOLT_SEL_1325MV 0x11
76 #define TPS65217_LDO_MASK 0x1F
77 #define TPS65217_LDO_VOLTAGE_OUT_1_8 0x06
78 #define TPS65217_LDO_VOLTAGE_OUT_3_3 0x1F
80 #define TPS65217_PWR_OFF 0x80
81 #define TPS65217_PWR_SRC_USB_BITMASK 0x4
82 #define TPS65217_PWR_SRC_AC_BITMASK 0x8
84 int tps65217_reg_read(uchar src_reg, uchar *src_val);
85 int tps65217_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,
87 int tps65217_voltage_update(uchar dc_cntrl_reg, uchar volt_sel);
88 #endif /* __POWER_TPS65217_H__ */