Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Header file for device driver Hi6421 PMIC
0004  *
0005  * Copyright (c) <2011-2014> HiSilicon Technologies Co., Ltd.
0006  *              http://www.hisilicon.com
0007  * Copyright (c) <2013-2014> Linaro Ltd.
0008  *              https://www.linaro.org
0009  *
0010  * Author: Guodong Xu <guodong.xu@linaro.org>
0011  */
0012 
0013 #ifndef __HI6421_PMIC_H
0014 #define __HI6421_PMIC_H
0015 
0016 /* Hi6421 registers are mapped to memory bus in 4 bytes stride */
0017 #define HI6421_REG_TO_BUS_ADDR(x)   (x << 2)
0018 
0019 /* Hi6421 maximum register number */
0020 #define HI6421_REG_MAX          0xFF
0021 
0022 /* Hi6421 OCP (over current protection) and DEB (debounce) control register */
0023 #define HI6421_OCP_DEB_CTRL_REG     HI6421_REG_TO_BUS_ADDR(0x51)
0024 #define HI6421_OCP_DEB_SEL_MASK     0x0C
0025 #define HI6421_OCP_DEB_SEL_8MS      0x00
0026 #define HI6421_OCP_DEB_SEL_16MS     0x04
0027 #define HI6421_OCP_DEB_SEL_32MS     0x08
0028 #define HI6421_OCP_DEB_SEL_64MS     0x0C
0029 #define HI6421_OCP_EN_DEBOUNCE_MASK 0x02
0030 #define HI6421_OCP_EN_DEBOUNCE_ENABLE   0x02
0031 #define HI6421_OCP_AUTO_STOP_MASK   0x01
0032 #define HI6421_OCP_AUTO_STOP_ENABLE 0x01
0033 
0034 struct hi6421_pmic {
0035     struct regmap       *regmap;
0036 };
0037 
0038 enum hi6421_type {
0039     HI6421 = 0,
0040     HI6421_V530,
0041 };
0042 
0043 #endif      /* __HI6421_PMIC_H */