<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>Chapter 2. Consumer driver interface</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><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="ch01.html" title="Chapter 1. Introduction" /><link rel="next" href="ch02s02.html" title="Configuration" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 2. Consumer driver interface</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch01.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch02s02.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 2. Consumer driver interface"><div class="titlepage"><div><div><h2 class="title"><a id="consumer"></a>Chapter 2. Consumer driver interface</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="ch02.html#consumer-enable">Enabling and disabling</a></span></dt><dt><span class="sect1"><a href="ch02s02.html">Configuration</a></span></dt><dt><span class="sect1"><a href="ch02s03.html">Callbacks</a></span></dt></dl></div><p> This offers a similar API to the kernel clock framework. Consumer drivers use <a class="link" href="re08.html" title="regulator_get">get</a> and <a class="link" href="re10.html" title="regulator_put">put</a> operations to acquire and release regulators. Functions are provided to <a class="link" href="re11.html" title="regulator_enable">enable</a> and <a class="link" href="re12.html" title="regulator_disable">disable</a> the reguator and to get and set the runtime parameters of the regulator. </p><p> When requesting regulators consumers use symbolic names for their supplies, such as "Vcc", which are mapped into actual regulator devices by the machine interface. </p><p> A stub version of this API is provided when the regulator framework is not in use in order to minimise the need to use ifdefs. </p><div class="sect1" title="Enabling and disabling"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="consumer-enable"></a>Enabling and disabling</h2></div></div></div><p> The regulator API provides reference counted enabling and disabling of regulators. Consumer devices use the <code class="function"><a class="link" href="re11.html" title="regulator_enable">regulator_enable</a></code> and <code class="function"><a class="link" href="re12.html" title="regulator_disable">regulator_disable</a> </code> functions to enable and disable regulators. Calls to the two functions must be balanced. </p><p> Note that since multiple consumers may be using a regulator and machine constraints may not allow the regulator to be disabled there is no guarantee that calling <code class="function">regulator_disable</code> will actually cause the supply provided by the regulator to be disabled. Consumer drivers should assume that the regulator may be enabled at all times. </p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch01.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch02s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 1. Introduction </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Configuration</td></tr></table></div></body></html>