blob: 6387913c97ceee68cf44642fd6783fdf84f51425 [file] [log] [blame]
Willie Ruan2635a852013-03-17 16:33:42 -07001/*
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 */
34enum cpr_corner_enum {
35 CPR_CORNER_SVS = 1,
36 CPR_CORNER_NORMAL,
37 CPR_CORNER_TURBO,
Willie Ruan2635a852013-03-17 16:33:42 -070038 CPR_CORNER_MAX,
39};
40
41/**
42 * enum pvs_process_enum - PVS process enum values
43 * %APC_PVS_NO: No PVS
44 * %APC_PVS_SLOW: Slow PVS process
45 * %APC_PVS_NOM: Nominal PVS process
46 * %APC_PVS_FAST: Fast PVS process
47 */
48enum apc_pvs_process_enum {
49 APC_PVS_NO,
50 APC_PVS_SLOW,
51 APC_PVS_NOM,
52 APC_PVS_FAST,
53 NUM_APC_PVS,
54};
55
Willie Ruan6d502392013-03-27 15:40:28 -070056/**
57 * enum vdd_mx_vmin_method - Method to determine vmin for vdd-mx
58 * %VDD_MX_VMIN_APC: Equal to APC voltage
59 * %VDD_MX_VMIN_APC_CORNER_CEILING: Equal to PVS corner ceiling voltage
60 * %VDD_MX_VMIN_APC_SLOW_CORNER_CEILING:
61 * Equal to slow speed corner ceiling
62 * %VDD_MX_VMIN_MX_VMAX: Equal to specified vdd-mx-vmax voltage
63 */
64enum vdd_mx_vmin_method {
65 VDD_MX_VMIN_APC,
66 VDD_MX_VMIN_APC_CORNER_CEILING,
67 VDD_MX_VMIN_APC_SLOW_CORNER_CEILING,
68 VDD_MX_VMIN_MX_VMAX,
69};
70
Willie Ruan2635a852013-03-17 16:33:42 -070071#ifdef CONFIG_MSM_CPR_REGULATOR
72
73int __init cpr_regulator_init(void);
74
75#else
76
77static inline int __init cpr_regulator_init(void)
78{
79 return -ENODEV;
80}
81
82#endif /* CONFIG_MSM_CPR_REGULATOR */
83
84#endif /* __REGULATOR_CPR_REGULATOR_H__ */