18 #include <linux/kernel.h>
19 #include <linux/device.h>
22 #include <linux/module.h>
23 #include <linux/string.h>
35 #define VREG(_name, _id, _status, _refcnt) \
36 { .name = _name, .id = _id, .status = _status, .refcnt = _refcnt }
38 static struct vreg vregs[] = {
39 VREG(
"msma", 0, 0, 0),
40 VREG(
"msmp", 1, 0, 0),
41 VREG(
"msme1", 2, 0, 0),
42 VREG(
"msmc1", 3, 0, 0),
43 VREG(
"msmc2", 4, 0, 0),
45 VREG(
"msme2", 6, 0, 0),
48 VREG(
"tcxo", 9, 0, 0),
50 VREG(
"rftx", 11, 0, 0),
51 VREG(
"rfrx1", 12, 0, 0),
52 VREG(
"rfrx2", 13, 0, 0),
53 VREG(
"synt", 14, 0, 0),
54 VREG(
"wlan", 15, 0, 0),
55 VREG(
"usb", 16, 0, 0),
56 VREG(
"boost", 17, 0, 0),
57 VREG(
"mmc", 18, 0, 0),
58 VREG(
"ruim", 19, 0, 0),
59 VREG(
"msmc0", 20, 0, 0),
60 VREG(
"gp2", 21, 0, 0),
61 VREG(
"gp5", 22, 0, 0),
62 VREG(
"gp6", 23, 0, 0),
64 VREG(
"rf_vco", 26, 0, 0),
65 VREG(
"mpll", 27, 0, 0),
68 VREG(
"rfubm", 30, 0, 0),
69 VREG(
"ncp", 31, 0, 0),
70 VREG(
"gp7", 32, 0, 0),
71 VREG(
"gp8", 33, 0, 0),
72 VREG(
"gp9", 34, 0, 0),
73 VREG(
"gp10", 35, 0, 0),
74 VREG(
"gp11", 36, 0, 0),
75 VREG(
"gp12", 37, 0, 0),
76 VREG(
"gp13", 38, 0, 0),
77 VREG(
"gp14", 39, 0, 0),
78 VREG(
"gp15", 40, 0, 0),
79 VREG(
"gp16", 41, 0, 0),
80 VREG(
"gp17", 42, 0, 0),
82 VREG(
"usb2", 44, 0, 0),
83 VREG(
"wlan2", 45, 0, 0),
84 VREG(
"xo_out", 46, 0, 0),
85 VREG(
"lvsw0", 47, 0, 0),
86 VREG(
"lvsw1", 48, 0, 0),
105 unsigned id = vreg->
id;
119 unsigned id = vreg->
id;
136 unsigned id = vreg->
id;
142 #if defined(CONFIG_DEBUG_FS)
144 static int vreg_debug_set(
void *
data,
u64 val)
161 static int vreg_debug_get(
void *data,
u64 *val)
163 struct vreg *vreg =
data;
173 static int vreg_debug_count_set(
void *data,
u64 val)
175 struct vreg *vreg =
data;
182 static int vreg_debug_count_get(
void *data,
u64 *val)
184 struct vreg *vreg =
data;
193 vreg_debug_count_set,
"%llu\n");
195 static int __init vreg_debug_init(
void)
200 const char *refcnt_name =
"_refcnt";
208 dent, vregs + n, &vreg_fops);
210 strlcpy(name, vregs[n].name,
sizeof(name));
211 strlcat(name, refcnt_name,
sizeof(name));
213 dent, vregs + n, &vreg_count_fops);