aboutsummaryrefslogtreecommitdiff
path: root/include/linux/regulator/cpr-regulator.h
blob: 09baf6a57d0b0a810f57d17cc7a53be7af3ec288 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef __REGULATOR_CPR_REGULATOR_H__
#define __REGULATOR_CPR_REGULATOR_H__

#include <linux/regulator/machine.h>

#define CPR_REGULATOR_DRIVER_NAME	"qcom,cpr-regulator"

#define CPR_PVS_EFUSE_BITS_MAX		5
#define CPR_PVS_EFUSE_BINS_MAX		(1 << CPR_PVS_EFUSE_BITS_MAX)

/**
 * enum cpr_fuse_corner_enum - CPR fuse corner enum values
 * %CPR_FUSE_CORNER_SVS:		Lowest voltage for APC
 * %CPR_FUSE_CORNER_NORMAL:		Normal mode voltage
 * %CPR_FUSE_CORNER_TURBO:		Turbo mode voltage
 * %CPR_FUSE_CORNER_SUPER_TURBO:	Super Turbo mode voltage
 *
 * These should be used in regulator_set_voltage() for CPR
 * regulator as if they had units of uV.
 */
enum cpr_fuse_corner_enum {
	CPR_FUSE_CORNER_SVS = 1,
	CPR_FUSE_CORNER_NORMAL,
	CPR_FUSE_CORNER_TURBO,
	CPR_FUSE_CORNER_MAX,
};

/**
 * enum pvs_process_enum - PVS process enum values
 * %APC_PVS_NO:		No PVS
 * %APC_PVS_SLOW:	Slow PVS process
 * %APC_PVS_NOM:	Nominal PVS process
 * %APC_PVS_FAST:	Fast PVS process
 */
enum apc_pvs_process_enum {
	APC_PVS_NO,
	APC_PVS_SLOW,
	APC_PVS_NOM,
	APC_PVS_FAST,
	NUM_APC_PVS,
};

/**
 * enum vdd_mx_vmin_method - Method to determine vmin for vdd-mx
 * %VDD_MX_VMIN_APC:			Equal to APC voltage
 * %VDD_MX_VMIN_APC_CORNER_CEILING:	Equal to PVS corner ceiling voltage
 * %VDD_MX_VMIN_APC_SLOW_CORNER_CEILING:
 *					Equal to slow speed corner ceiling
 * %VDD_MX_VMIN_MX_VMAX:		Equal to specified vdd-mx-vmax voltage
 * %VDD_MX_VMIN_APC_CORNER_MAP:		Equal to the APC corner mapped MX
 *					voltage
 */
enum vdd_mx_vmin_method {
	VDD_MX_VMIN_APC,
	VDD_MX_VMIN_APC_CORNER_CEILING,
	VDD_MX_VMIN_APC_SLOW_CORNER_CEILING,
	VDD_MX_VMIN_MX_VMAX,
	VDD_MX_VMIN_APC_CORNER_MAP,
};

#ifdef CONFIG_MSM_CPR_REGULATOR

int __init cpr_regulator_init(void);

#else

static inline int __init cpr_regulator_init(void)
{
	return -ENODEV;
}

#endif /* CONFIG_MSM_CPR_REGULATOR */

#endif /* __REGULATOR_CPR_REGULATOR_H__ */