xref: /openbmc/u-boot/include/power/act8846_pmic.h (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
2d2c88f7dSSimon Glass /*
3d2c88f7dSSimon Glass  * Copyright (C) 2015 Google, Inc
4d2c88f7dSSimon Glass  * Written by Simon Glass <sjg@chromium.org>
5d2c88f7dSSimon Glass  */
6d2c88f7dSSimon Glass 
7d2c88f7dSSimon Glass #ifndef _PMIC_ACT8846_H_
8d2c88f7dSSimon Glass #define _PMIC_ACT8846_H_
9d2c88f7dSSimon Glass 
10d2c88f7dSSimon Glass #include <asm/gpio.h>
11d2c88f7dSSimon Glass 
12d2c88f7dSSimon Glass #define ACT8846_NUM_OF_REGS	12
13d2c88f7dSSimon Glass 
14d2c88f7dSSimon Glass #define BUCK_VOL_MASK 0x3f
15d2c88f7dSSimon Glass #define LDO_VOL_MASK 0x3f
16d2c88f7dSSimon Glass 
17d2c88f7dSSimon Glass #define BUCK_EN_MASK 0x80
18d2c88f7dSSimon Glass #define LDO_EN_MASK 0x80
19d2c88f7dSSimon Glass 
20d2c88f7dSSimon Glass #define VOL_MIN_IDX 0x00
21d2c88f7dSSimon Glass #define VOL_MAX_IDX 0x3f
22d2c88f7dSSimon Glass 
23d2c88f7dSSimon Glass struct  act8846_reg_table {
24d2c88f7dSSimon Glass 	char	*name;
25d2c88f7dSSimon Glass 	char	reg_ctl;
26d2c88f7dSSimon Glass 	char	reg_vol;
27d2c88f7dSSimon Glass };
28d2c88f7dSSimon Glass 
29d2c88f7dSSimon Glass struct pmic_act8846 {
30d2c88f7dSSimon Glass 	struct pmic *pmic;
31d2c88f7dSSimon Glass 	int node;	/*device tree node*/
32d2c88f7dSSimon Glass 	struct gpio_desc pwr_hold;
33d2c88f7dSSimon Glass 	struct udevice *dev;
34d2c88f7dSSimon Glass };
35d2c88f7dSSimon Glass 
36d2c88f7dSSimon Glass #endif
37