Lines Matching refs:vreg
1 /* arch/arm/mach-msm/vreg.c
23 #include <mach/vreg.h>
27 struct vreg {
37 static struct vreg vregs[] = {
88 struct vreg *vreg_get(struct device *dev, const char *id)
98 void vreg_put(struct vreg *vreg)
102 int vreg_enable(struct vreg *vreg)
104 unsigned id = vreg->id;
107 if (vreg->refcnt == 0)
108 vreg->status = msm_proc_comm(PCOM_VREG_SWITCH, &id, &enable);
110 if ((vreg->refcnt < UINT_MAX) && (!vreg->status))
111 vreg->refcnt++;
113 return vreg->status;
116 int vreg_disable(struct vreg *vreg)
118 unsigned id = vreg->id;
121 if (!vreg->refcnt)
124 if (vreg->refcnt == 1)
125 vreg->status = msm_proc_comm(PCOM_VREG_SWITCH, &id, &enable);
127 if (!vreg->status)
128 vreg->refcnt--;
130 return vreg->status;
133 int vreg_set_level(struct vreg *vreg, unsigned mv)
135 unsigned id = vreg->id;
137 vreg->status = msm_proc_comm(PCOM_VREG_SET_LEVEL, &id, &mv);
138 return vreg->status;
145 struct vreg *vreg = data;
148 vreg_disable(vreg);
151 vreg_enable(vreg);
154 vreg_set_level(vreg, val);
162 struct vreg *vreg = data;
164 if (!vreg->status)
174 struct vreg *vreg = data;
177 vreg->refcnt = val;
183 struct vreg *vreg = data;
185 *val = vreg->refcnt;
201 dent = debugfs_create_dir("vreg", 0);