Lines Matching refs:vreg

27 struct vreg {  struct
37 static struct vreg vregs[] = { argument
88 struct vreg *vreg_get(struct device *dev, const char *id) in vreg_get()
98 void vreg_put(struct vreg *vreg) in vreg_put() argument
102 int vreg_enable(struct vreg *vreg) in vreg_enable() argument
104 unsigned id = vreg->id; in vreg_enable()
107 if (vreg->refcnt == 0) in vreg_enable()
108 vreg->status = msm_proc_comm(PCOM_VREG_SWITCH, &id, &enable); in vreg_enable()
110 if ((vreg->refcnt < UINT_MAX) && (!vreg->status)) in vreg_enable()
111 vreg->refcnt++; in vreg_enable()
113 return vreg->status; in vreg_enable()
116 int vreg_disable(struct vreg *vreg) in vreg_disable() argument
118 unsigned id = vreg->id; in vreg_disable()
121 if (!vreg->refcnt) in vreg_disable()
124 if (vreg->refcnt == 1) in vreg_disable()
125 vreg->status = msm_proc_comm(PCOM_VREG_SWITCH, &id, &enable); in vreg_disable()
127 if (!vreg->status) in vreg_disable()
128 vreg->refcnt--; in vreg_disable()
130 return vreg->status; in vreg_disable()
133 int vreg_set_level(struct vreg *vreg, unsigned mv) in vreg_set_level() argument
135 unsigned id = vreg->id; in vreg_set_level()
137 vreg->status = msm_proc_comm(PCOM_VREG_SET_LEVEL, &id, &mv); in vreg_set_level()
138 return vreg->status; in vreg_set_level()
145 struct vreg *vreg = data; in vreg_debug_set() local
148 vreg_disable(vreg); in vreg_debug_set()
151 vreg_enable(vreg); in vreg_debug_set()
154 vreg_set_level(vreg, val); in vreg_debug_set()
162 struct vreg *vreg = data; in vreg_debug_get() local
164 if (!vreg->status) in vreg_debug_get()
174 struct vreg *vreg = data; in vreg_debug_count_set() local
177 vreg->refcnt = val; in vreg_debug_count_set()
183 struct vreg *vreg = data; in vreg_debug_count_get() local
185 *val = vreg->refcnt; in vreg_debug_count_get()