Willie Ruan | 2635a85 | 2013-03-17 16:33:42 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013, The Linux Foundation. All rights reserved. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 and |
| 6 | * only version 2 as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
| 14 | #ifndef __REGULATOR_CPR_REGULATOR_H__ |
| 15 | #define __REGULATOR_CPR_REGULATOR_H__ |
| 16 | |
| 17 | #include <linux/regulator/machine.h> |
| 18 | |
| 19 | #define CPR_REGULATOR_DRIVER_NAME "qcom,cpr-regulator" |
| 20 | |
| 21 | #define CPR_PVS_EFUSE_BITS_MAX 5 |
| 22 | #define CPR_PVS_EFUSE_BINS_MAX (1 << CPR_PVS_EFUSE_BITS_MAX) |
| 23 | |
| 24 | /** |
| 25 | * enum cpr_corner_enum - CPR corner enum values |
| 26 | * %CPR_CORNER_SVS: Lowest voltage for APC |
| 27 | * %CPR_CORNER_NORMAL: Normal mode voltage |
| 28 | * %CPR_CORNER_TURBO: Turbo mode voltage |
| 29 | * %CPR_CORNER_SUPER_TURBO: Super Turbo mode voltage |
| 30 | * |
| 31 | * These should be used in regulator_set_voltage() for CPR |
| 32 | * regulator as if they had units of uV. |
| 33 | */ |
| 34 | enum cpr_corner_enum { |
| 35 | CPR_CORNER_SVS = 1, |
| 36 | CPR_CORNER_NORMAL, |
| 37 | CPR_CORNER_TURBO, |
| 38 | CPR_CORNER_SUPER_TURBO, |
| 39 | CPR_CORNER_MAX, |
| 40 | }; |
| 41 | |
| 42 | /** |
| 43 | * enum pvs_process_enum - PVS process enum values |
| 44 | * %APC_PVS_NO: No PVS |
| 45 | * %APC_PVS_SLOW: Slow PVS process |
| 46 | * %APC_PVS_NOM: Nominal PVS process |
| 47 | * %APC_PVS_FAST: Fast PVS process |
| 48 | */ |
| 49 | enum apc_pvs_process_enum { |
| 50 | APC_PVS_NO, |
| 51 | APC_PVS_SLOW, |
| 52 | APC_PVS_NOM, |
| 53 | APC_PVS_FAST, |
| 54 | NUM_APC_PVS, |
| 55 | }; |
| 56 | |
| 57 | #ifdef CONFIG_MSM_CPR_REGULATOR |
| 58 | |
| 59 | int __init cpr_regulator_init(void); |
| 60 | |
| 61 | #else |
| 62 | |
| 63 | static inline int __init cpr_regulator_init(void) |
| 64 | { |
| 65 | return -ENODEV; |
| 66 | } |
| 67 | |
| 68 | #endif /* CONFIG_MSM_CPR_REGULATOR */ |
| 69 | |
| 70 | #endif /* __REGULATOR_CPR_REGULATOR_H__ */ |