blob: fcb5916f27efa4412b25b7bf1aa557057ab14039 [file] [log] [blame]
Svyatoslav Ryhelaba052b2023-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 Ryhel52914ea2023-10-24 10:49:05 +030015#define MAX77663_RST_DRIVER "max77663_rst"
Svyatoslav Ryhel16360b82023-07-15 22:25:03 +030016#define MAX77663_GPIO_DRIVER "max77663_gpio"
Svyatoslav Ryhelaba052b2023-10-27 11:26:10 +030017
18/* Step-Down (SD) Regulator calculations */
19#define SD_STATUS_MASK 0x30
20
21#define SD0_VOLT_MAX_HEX 0x40
22#define SD1_VOLT_MAX_HEX 0x4c
23#define SD_VOLT_MAX_HEX 0xff
24#define SD_VOLT_MIN_HEX 0x02
25
26#define SD0_VOLT_MAX 1400000
27#define SD1_VOLT_MAX 1550000
28#define SD_VOLT_MAX 3787500
29#define SD_VOLT_MIN 625000
30
31#define SD_VOLT_BASE 600000
32
33/* Low-Dropout Linear (LDO) Regulator calculations */
34#define LDO_STATUS_MASK 0xc0
35#define LDO_VOLT_MASK 0x3f
36#define LDO_VOLT_MAX_HEX 0x3f
37
38#define LDO01_VOLT_MAX 2375000
39#define LDO4_VOLT_MAX 1587500
40#define LDO_VOLT_MAX 3950000
41
42#define LDO_VOLT_BASE 800000
43
Svyatoslav Ryhel52914ea2023-10-24 10:49:05 +030044#define MAX77663_REG_ONOFF_CFG1 0x41
45#define ONOFF_SFT_RST BIT(7)
46#define ONOFF_PWR_OFF BIT(1)
47
Svyatoslav Ryhelaba052b2023-10-27 11:26:10 +030048#endif /* _MAX77663_H_ */