blob: b3ae3dabf462066e5b7c692edb1548623c0b38d2 [file] [log] [blame]
Svyatoslav Ryhelf2ed5842023-10-27 11:26:10 +03001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Copyright(C) 2023 Svyatoslav Ryhel <clamor95@gmail.com>
4 */
5
6#ifndef _MAX77663_H_
7#define _MAX77663_H_
8
9#define MAX77663_LDO_NUM 9
10#define MAX77663_SD_NUM 5
11
12/* Drivers name */
13#define MAX77663_LDO_DRIVER "max77663_ldo"
14#define MAX77663_SD_DRIVER "max77663_sd"
Svyatoslav Ryhelfa1e72e2023-10-24 10:49:05 +030015#define MAX77663_RST_DRIVER "max77663_rst"
Svyatoslav Ryhelf2ed5842023-10-27 11:26:10 +030016
17/* Step-Down (SD) Regulator calculations */
18#define SD_STATUS_MASK 0x30
19
20#define SD0_VOLT_MAX_HEX 0x40
21#define SD1_VOLT_MAX_HEX 0x4c
22#define SD_VOLT_MAX_HEX 0xff
23#define SD_VOLT_MIN_HEX 0x02
24
25#define SD0_VOLT_MAX 1400000
26#define SD1_VOLT_MAX 1550000
27#define SD_VOLT_MAX 3787500
28#define SD_VOLT_MIN 625000
29
30#define SD_VOLT_BASE 600000
31
32/* Low-Dropout Linear (LDO) Regulator calculations */
33#define LDO_STATUS_MASK 0xc0
34#define LDO_VOLT_MASK 0x3f
35#define LDO_VOLT_MAX_HEX 0x3f
36
37#define LDO01_VOLT_MAX 2375000
38#define LDO4_VOLT_MAX 1587500
39#define LDO_VOLT_MAX 3950000
40
41#define LDO_VOLT_BASE 800000
42
Svyatoslav Ryhelfa1e72e2023-10-24 10:49:05 +030043#define MAX77663_REG_ONOFF_CFG1 0x41
44#define ONOFF_SFT_RST BIT(7)
45#define ONOFF_PWR_OFF BIT(1)
46
Svyatoslav Ryhelf2ed5842023-10-27 11:26:10 +030047#endif /* _MAX77663_H_ */