Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Przemyslaw Marczak | 9038cd5 | 2015-05-13 13:38:35 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2015 Samsung Electronics |
| 4 | * Przemyslaw Marczak <p.marczak@samsung.com> |
Przemyslaw Marczak | 9038cd5 | 2015-05-13 13:38:35 +0200 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef _DT_BINDINGS_SANDBOX_PMIC_H_ |
| 8 | #define _DT_BINDINGS_SANDBOX_PMIC_H_ |
| 9 | |
| 10 | /* |
| 11 | * Sandbox PMIC - prepare reset values |
| 12 | * To provide the default (reset) values as in the real hardware, |
| 13 | * the registers are set in i2c pmic emul driver's probe() method. |
| 14 | * The default values are defined as below. |
| 15 | */ |
| 16 | |
| 17 | /* Buck operation mode IDs */ |
| 18 | #define BUCK_OM_OFF 0 |
| 19 | #define BUCK_OM_ON 1 |
| 20 | #define BUCK_OM_PWM 2 |
| 21 | #define BUCK_OM_COUNT 3 |
| 22 | |
| 23 | /* Ldo operation mode IDs */ |
| 24 | #define LDO_OM_OFF 0 |
| 25 | #define LDO_OM_ON 1 |
| 26 | #define LDO_OM_SLEEP 2 |
| 27 | #define LDO_OM_STANDBY 3 |
| 28 | #define LDO_OM_COUNT 4 |
| 29 | |
| 30 | /* [Value uV/uA]/[Mode ID] to register */ |
| 31 | #define VAL2REG(min, step, val) (((val) - (min)) / (step)) |
| 32 | #define VAL2OMREG(x) (x) |
| 33 | |
| 34 | #endif |