coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mt6360.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef __SOC_MEDIATEK_MT8195_MT6360_H__
4 #define __SOC_MEDIATEK_MT8195_MT6360_H__
5 
6 #include <stdint.h>
7 
8 #define MT6360_LDO_I2C_ADDR 0x64
9 #define MT6360_PMIC_I2C_ADDR 0x1a
10 
11 #define MT6360_DATA(_enreg, _enmask, _vreg, _vmask, _table) \
12 { \
13  .enable_reg = _enreg, \
14  .enable_mask = _enmask, \
15  .vsel_reg = _vreg, \
16  .vsel_mask = _vmask, \
17  .vsel_table = _table, \
18  .vsel_table_len = ARRAY_SIZE(_table), \
19 }
20 
21 enum {
25 };
26 
27 /*
28  * This must match the regulator IDs defined in EC's BC1.2 MT6360 driver.
29  * Please do NOT change the order.
30  */
41 };
42 
46 };
47 
48 struct mt6360_data {
55 };
56 
57 void mt6360_init(uint8_t bus);
58 void mt6360_enable(enum mt6360_regulator_id id, uint8_t enable);
60 void mt6360_set_voltage(enum mt6360_regulator_id id, u32 voltage_uv);
62 
63 #endif
mt6360_regulator_id
Definition: mt6360.h:6
@ MT6360_BUCK1
Definition: mt6360.h:11
@ MT6360_LDO5
Definition: mt6360.h:8
@ MT6360_LDO3
Definition: mt6360.h:7
@ MT6360_BUCK2
Definition: mt6360.h:12
@ MT6360_LDO6
Definition: mt6360.h:9
@ MT6360_REGULATOR_COUNT
Definition: mt6360.h:13
@ MT6360_LDO7
Definition: mt6360.h:10
void mt6360_init(uint8_t bus)
Definition: mt6360.c:382
u32 mt6360_get_voltage(enum mt6360_regulator_id id)
Definition: mt6360.c:432
uint8_t mt6360_is_enabled(enum mt6360_regulator_id id)
Definition: mt6360.c:414
@ MT6360_LDO1
Definition: mt6360.h:38
@ MT6360_LDO2
Definition: mt6360.h:39
@ MT6360_INDEX_PMIC
Definition: mt6360.h:23
@ MT6360_INDEX_COUNT
Definition: mt6360.h:24
@ MT6360_INDEX_LDO
Definition: mt6360.h:22
void mt6360_set_voltage(enum mt6360_regulator_id id, u32 voltage_uv)
Definition: mt6360.c:424
void mt6360_enable(enum mt6360_regulator_id id, uint8_t enable)
Definition: mt6360.c:406
unsigned int uint32_t
Definition: stdint.h:14
uint32_t u32
Definition: stdint.h:51
uint8_t u8
Definition: stdint.h:45
unsigned char uint8_t
Definition: stdint.h:8
Definition: device.h:76
uint8_t vsel_mask
Definition: mt6360.h:52
uint8_t enable_mask
Definition: mt6360.h:50
uint8_t vsel_reg
Definition: mt6360.h:51
uint32_t vsel_table_len
Definition: mt6360.h:54
uint8_t enable_reg
Definition: mt6360.h:49
const uint32_t * vsel_table
Definition: mt6360.h:53