xref: /rk3399_ARM-atf/plat/mediatek/mt8183/drivers/pmic/pmic.c (revision 301d27d998892c054dec925264f81b11dcd64822)
1 /*
2  * Copyright (c) 2019, MediaTek Inc. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <pmic_wrap_init.h>
8 #include <pmic.h>
9 
10 void wk_pmic_enable_sdn_delay(void)
11 {
12 	uint32_t con;
13 
14 	pwrap_write(PMIC_TMA_KEY, 0x9CA7);
15 	pwrap_read(PMIC_PSEQ_ELR11, &con);
16 	con &= ~PMIC_RG_SDN_DLY_ENB;
17 	pwrap_write(PMIC_PSEQ_ELR11, con);
18 	pwrap_write(PMIC_TMA_KEY, 0);
19 }
20 
21 void pmic_power_off(void)
22 {
23 	pwrap_write(PMIC_PWRHOLD, 0x0);
24 }
25