Svyatoslav Ryhel | 8f0fa2b | 2023-10-27 11:26:12 +0300 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * Copyright(C) 2023 Svyatoslav Ryhel <clamor95@gmail.com> |
| 4 | */ |
| 5 | |
| 6 | #ifndef _TPS80031_H_ |
| 7 | #define _TPS80031_H_ |
| 8 | |
| 9 | #define TPS80031_LDO_NUM 9 |
| 10 | #define TPS80031_SMPS_NUM 5 |
| 11 | |
| 12 | /* Drivers name */ |
| 13 | #define TPS80031_LDO_DRIVER "tps80031_ldo" |
| 14 | #define TPS80031_SMPS_DRIVER "tps80031_smps" |
Svyatoslav Ryhel | b72803f | 2023-10-24 10:49:06 +0300 | [diff] [blame] | 15 | #define TPS80031_RST_DRIVER "tps80031_rst" |
Svyatoslav Ryhel | 8f0fa2b | 2023-10-27 11:26:12 +0300 | [diff] [blame] | 16 | |
| 17 | #define TPS80031_SMPS_OFFSET 0xe0 |
| 18 | #define TPS80031_OFFSET_FLAG BIT(0) |
| 19 | |
| 20 | #define REGULATOR_STATUS_MASK 0x3 |
| 21 | #define REGULATOR_MODE_ON 0x1 |
| 22 | |
| 23 | /* Switched-Mode Power Supply Regulator calculations */ |
| 24 | #define SMPS_VOLT_MASK 0x3f |
| 25 | #define SMPS_VOLT_LINEAR_HEX 0x39 |
| 26 | #define SMPS_VOLT_NLINEAR_HEX 0x3a |
| 27 | #define SMPS_VOLT_LINEAR 1300000 |
| 28 | #define SMPS_VOLT_BASE 600000 |
| 29 | #define SMPS_VOLT_BASE_OFFSET 700000 |
| 30 | |
| 31 | /* Low-Dropout Linear (LDO) Regulator calculations */ |
| 32 | #define LDO_VOLT_MASK 0x3f |
| 33 | #define LDO_VOLT_MAX_HEX 0x18 |
| 34 | #define LDO_VOLT_MIN_HEX 0x01 |
| 35 | #define LDO_VOLT_MAX 3360000 |
| 36 | #define LDO_VOLT_MIN 1018000 |
| 37 | #define LDO_VOLT_BASE 916000 |
| 38 | |
Svyatoslav Ryhel | b72803f | 2023-10-24 10:49:06 +0300 | [diff] [blame] | 39 | #define TPS80031_PHOENIX_DEV_ON 0x25 |
| 40 | #define SW_RESET BIT(6) |
| 41 | #define DEVOFF BIT(0) |
| 42 | |
Svyatoslav Ryhel | 8f0fa2b | 2023-10-27 11:26:12 +0300 | [diff] [blame] | 43 | /* register groups */ |
| 44 | enum { |
| 45 | CTRL, |
| 46 | VOLT, |
| 47 | OFFSET, |
| 48 | }; |
| 49 | |
| 50 | #endif /* _TPS80031_H_ */ |