1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Chapter&#160;2.&#160;Consumer driver interface</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Voltage and current regulator API"><link rel="up" href="index.html" title="Voltage and current regulator API"><link rel="prev" href="intro.html" title="Chapter&#160;1.&#160;Introduction"><link rel="next" href="consumer-config.html" title="Configuration"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&#160;2.&#160;Consumer driver interface</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="intro.html">Prev</a>&#160;</td><th width="60%" align="center">&#160;</th><td width="20%" align="right">&#160;<a accesskey="n" href="consumer-config.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="consumer"></a>Chapter&#160;2.&#160;Consumer driver interface</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="consumer.html#consumer-enable">Enabling and disabling</a></span></dt><dt><span class="sect1"><a href="consumer-config.html">Configuration</a></span></dt><dt><span class="sect1"><a href="consumer-callback.html">Callbacks</a></span></dt></dl></div><p>
2       This offers a similar API to the kernel clock framework.
3       Consumer drivers use <a class="link" href="API-regulator-get.html" title="regulator_get">get</a> and <a class="link" href="API-regulator-put.html" title="regulator_put">put</a> operations to acquire and
4       release regulators.  Functions are
5       provided to <a class="link" href="API-regulator-enable.html" title="regulator_enable">enable</a>
6       and <a class="link" href="API-regulator-disable.html" title="regulator_disable">disable</a> the
7       regulator and to get and set the runtime parameters of the
8       regulator.
9     </p><p>
10       When requesting regulators consumers use symbolic names for their
11       supplies, such as "Vcc", which are mapped into actual regulator
12       devices by the machine interface.
13     </p><p>
14	A stub version of this API is provided when the regulator
15	framework is not in use in order to minimise the need to use
16	ifdefs.
17     </p><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="consumer-enable"></a>Enabling and disabling</h2></div></div></div><p>
18         The regulator API provides reference counted enabling and
19	 disabling of regulators. Consumer devices use the <code class="function"><a class="link" href="API-regulator-enable.html" title="regulator_enable">regulator_enable</a></code>
20	 and <code class="function"><a class="link" href="API-regulator-disable.html" title="regulator_disable">regulator_disable</a>
21	 </code> functions to enable and disable regulators.  Calls
22	 to the two functions must be balanced.
23       </p><p>
24         Note that since multiple consumers may be using a regulator and
25	 machine constraints may not allow the regulator to be disabled
26	 there is no guarantee that calling
27	 <code class="function">regulator_disable</code> will actually cause the
28	 supply provided by the regulator to be disabled. Consumer
29	 drivers should assume that the regulator may be enabled at all
30	 times.
31       </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="intro.html">Prev</a>&#160;</td><td width="20%" align="center">&#160;</td><td width="40%" align="right">&#160;<a accesskey="n" href="consumer-config.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&#160;1.&#160;Introduction&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;Configuration</td></tr></table></div></body></html>
32