summaryrefslogtreecommitdiffstats
path: root/plat/mediatek/mt8186/drivers/pmic/pmic.c
blob: 4f7ab13c9a85ba9d16cf33f213a4c7694c0c24cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * Copyright (c) 2021, MediaTek Inc. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <common/debug.h>
#include <pmic.h>
#include <pmic_wrap_init.h>

uint32_t pmic_get_hwcid(void)
{
	uint32_t val = 0;

	pwrap_read(PMIC_RG_HWCID_ADDR, &val);

	return val;
}

void pmic_power_off(void)
{
	pwrap_write(PMIC_PWRHOLD, 0x0);
}