<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
	"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>

<book id="regulator-api">
 <bookinfo>
  <title>Voltage and current regulator API</title>

  <authorgroup>
   <author>
    <firstname>Liam</firstname>
    <surname>Girdwood</surname>
    <affiliation>
     <address>
      <email>lrg@slimlogic.co.uk</email>
     </address>
    </affiliation>
   </author>
   <author>
    <firstname>Mark</firstname>
    <surname>Brown</surname>
    <affiliation>
     <orgname>Wolfson Microelectronics</orgname>
     <address>
      <email>broonie@opensource.wolfsonmicro.com</email>
     </address>
    </affiliation>
   </author>
  </authorgroup>

  <copyright>
   <year>2007-2008</year>
   <holder>Wolfson Microelectronics</holder>
  </copyright>
  <copyright>
   <year>2008</year>
   <holder>Liam Girdwood</holder>
  </copyright>

  <legalnotice>
   <para>
     This documentation is free software; you can redistribute
     it and/or modify it under the terms of the GNU General Public
     License version 2 as published by the Free Software Foundation.
   </para>

   <para>
     This program is distributed in the hope that it will be
     useful, but WITHOUT ANY WARRANTY; without even the implied
     warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     See the GNU General Public License for more details.
   </para>

   <para>
     You should have received a copy of the GNU General Public
     License along with this program; if not, write to the Free
     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
     MA 02111-1307 USA
   </para>

   <para>
     For more details see the file COPYING in the source
     distribution of Linux.
   </para>
  </legalnotice>
 </bookinfo>

<toc></toc>

  <chapter id="intro">
    <title>Introduction</title>
    <para>
	This framework is designed to provide a standard kernel
	interface to control voltage and current regulators.
    </para>
    <para>
	The intention is to allow systems to dynamically control
	regulator power output in order to save power and prolong
	battery life.  This applies to both voltage regulators (where
	voltage output is controllable) and current sinks (where current
	limit is controllable).
    </para>
    <para>
	Note that additional (and currently more complete) documentation
	is available in the Linux kernel source under
	<filename>Documentation/power/regulator</filename>.
    </para>

    <sect1 id="glossary">
       <title>Glossary</title>
       <para>
	The regulator API uses a number of terms which may not be
	familiar:
       </para>
       <glossary>

         <glossentry>
	   <glossterm>Regulator</glossterm>
	   <glossdef>
	     <para>
	Electronic device that supplies power to other devices.  Most
	regulators can enable and disable their output and some can also
	control their output voltage or current.
	     </para>
	   </glossdef>
         </glossentry>

	 <glossentry>
	   <glossterm>Consumer</glossterm>
	   <glossdef>
	     <para>
	Electronic device which consumes power provided by a regulator.
	These may either be static, requiring only a fixed supply, or
	dynamic, requiring active management of the regulator at
	runtime.
	     </para>
	   </glossdef>
	 </glossentry>

	 <glossentry>
	   <glossterm>Power Domain</glossterm>
	   <glossdef>
	     <para>
	The electronic circuit supplied by a given regulator, including
	the regulator and all consumer devices.  The configuration of
	the regulator is shared between all the components in the
	circuit.
	     </para>
	   </glossdef>
	 </glossentry>

	 <glossentry>
	   <glossterm>Power Management Integrated Circuit</glossterm>
	   <acronym>PMIC</acronym>
	   <glossdef>
	     <para>
	An IC which contains numerous regulators and often also other
	subsystems.  In an embedded system the primary PMIC is often
	equivalent to a combination of the PSU and southbridge in a
	desktop system.
	     </para>
	   </glossdef>
	 </glossentry>
	</glossary>
     </sect1>
  </chapter>

  <chapter id="consumer">
     <title>Consumer driver interface</title>
     <para>
       This offers a similar API to the kernel clock framework.
       Consumer drivers use <link
       linkend='API-regulator-get'>get</link> and <link
       linkend='API-regulator-put'>put</link> operations to acquire and
       release regulators.  Functions are
       provided to <link linkend='API-regulator-enable'>enable</link>
       and <link linkend='API-regulator-disable'>disable</link> the
       reguator and to get and set the runtime parameters of the
       regulator.
     </para>
     <para>
       When requesting regulators consumers use symbolic names for their
       supplies, such as "Vcc", which are mapped into actual regulator
       devices by the machine interface.
     </para>
     <para>
	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.
     </para>

     <sect1 id="consumer-enable">
       <title>Enabling and disabling</title>
       <para>
         The regulator API provides reference counted enabling and
	 disabling of regulators. Consumer devices use the <function><link
	 linkend='API-regulator-enable'>regulator_enable</link></function>
	 and <function><link
	 linkend='API-regulator-disable'>regulator_disable</link>
	 </function> functions to enable and disable regulators.  Calls
	 to the two functions must be balanced.
       </para>
       <para>
         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
	 <function>regulator_disable</function> 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.
       </para>
     </sect1>

     <sect1 id="consumer-config">
       <title>Configuration</title>
       <para>
         Some consumer devices may need to be able to dynamically
	 configure their supplies.  For example, MMC drivers may need to
	 select the correct operating voltage for their cards.  This may
	 be done while the regulator is enabled or disabled.
       </para>
       <para>
	 The <function><link
	 linkend='API-regulator-set-voltage'>regulator_set_voltage</link>
	 </function> and <function><link
	 linkend='API-regulator-set-current-limit'
	 >regulator_set_current_limit</link>
	 </function> functions provide the primary interface for this.
	 Both take ranges of voltages and currents, supporting drivers
	 that do not require a specific value (eg, CPU frequency scaling
	 normally permits the CPU to use a wider range of supply
	 voltages at lower frequencies but does not require that the
	 supply voltage be lowered).  Where an exact value is required
	 both minimum and maximum values should be identical.
       </para>
     </sect1>

     <sect1 id="consumer-callback">
       <title>Callbacks</title>
       <para>
	  Callbacks may also be <link
	  linkend='API-regulator-register-notifier'>registered</link>
	  for events such as regulation failures.
       </para>
     </sect1>
   </chapter>

   <chapter id="driver">
     <title>Regulator driver interface</title>
     <para>
       Drivers for regulator chips <link
       linkend='API-regulator-register'>register</link> the regulators
       with the regulator core, providing operations structures to the
       core.  A <link
       linkend='API-regulator-notifier-call-chain'>notifier</link> interface
       allows error conditions to be reported to the core.
     </para>
     <para>
       Registration should be triggered by explicit setup done by the
       platform, supplying a <link
       linkend='API-struct-regulator-init-data'>struct
       regulator_init_data</link> for the regulator containing
       <link linkend='machine-constraint'>constraint</link> and
       <link linkend='machine-supply'>supply</link> information.
     </para>
   </chapter>

   <chapter id="machine">
     <title>Machine interface</title>
     <para>
       This interface provides a way to define how regulators are
       connected to consumers on a given system and what the valid
       operating parameters are for the system.
     </para>

     <sect1 id="machine-supply">
       <title>Supplies</title>
       <para>
         Regulator supplies are specified using <link
	 linkend='API-struct-regulator-consumer-supply'>struct
	 regulator_consumer_supply</link>.  This is done at
	 <link linkend='driver'>driver registration
	 time</link> as part of the machine constraints.
       </para>
     </sect1>

     <sect1 id="machine-constraint">
       <title>Constraints</title>
       <para>
	 As well as definining the connections the machine interface
	 also provides constraints definining the operations that
	 clients are allowed to perform and the parameters that may be
	 set.  This is required since generally regulator devices will
	 offer more flexibility than it is safe to use on a given
	 system, for example supporting higher supply voltages than the
	 consumers are rated for.
       </para>
       <para>
	 This is done at <link linkend='driver'>driver
	 registration time</link> by providing a <link
	 linkend='API-struct-regulation-constraints'>struct
	 regulation_constraints</link>.
       </para>
       <para>
         The constraints may also specify an initial configuration for the
         regulator in the constraints, which is particularly useful for
         use with static consumers.
       </para>
     </sect1>
  </chapter>

  <chapter id="api">
    <title>API reference</title>
    <para>
      Due to limitations of the kernel documentation framework and the
      existing layout of the source code the entire regulator API is
      documented here.
    </para>
<!-- include/linux/regulator/consumer.h -->
<refentry id="API-struct-regulator-bulk-data">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct regulator_bulk_data</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct regulator_bulk_data</refname>
 <refpurpose>
  Data used for bulk regulator operations.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct regulator_bulk_data {
  const char * supply;
  struct regulator * consumer;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>supply</term>
      <listitem><para>
The name of the supply.  Initialised by the user before
using the bulk regulator APIs.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>consumer</term>
      <listitem><para>
The regulator consumer for the supply.  This will be managed
by the bulk API.
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
<refsect1>
<title>Description</title>
<para>
   The regulator APIs provide a series of <function>regulator_bulk_</function> API calls as
   a convenience to consumers which require multiple supplies.  This
   structure is used to manage data for these calls.
</para>
</refsect1>
</refentry>

<!-- include/linux/regulator/machine.h -->
<refentry id="API-struct-regulator-state">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct regulator_state</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct regulator_state</refname>
 <refpurpose>
  regulator state during low power system states
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct regulator_state {
  int uV;
  unsigned int mode;
  int enabled;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>uV</term>
      <listitem><para>
Operating voltage during suspend.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>mode</term>
      <listitem><para>
Operating mode during suspend.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>enabled</term>
      <listitem><para>
Enabled during suspend.
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
<refsect1>
<title>Description</title>
<para>
   </para><para>

   This describes a regulators state during a system wide low power state.
</para>
</refsect1>
</refentry>

<refentry id="API-struct-regulation-constraints">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct regulation_constraints</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct regulation_constraints</refname>
 <refpurpose>
     regulator operating constraints.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct regulation_constraints {
  char * name;
  int min_uV;
  int max_uV;
  int min_uA;
  int max_uA;
  unsigned int valid_modes_mask;
  unsigned int valid_ops_mask;
  int input_uV;
  struct regulator_state state_disk;
  struct regulator_state state_mem;
  struct regulator_state state_standby;
  suspend_state_t initial_state;
  unsigned int initial_mode;
  unsigned always_on:1;
  unsigned boot_on:1;
  unsigned apply_uV:1;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>name</term>
      <listitem><para>
   Descriptive name for the constraints, used for display purposes.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>min_uV</term>
      <listitem><para>
   Smallest voltage consumers may set.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>max_uV</term>
      <listitem><para>
   Largest voltage consumers may set.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>min_uA</term>
      <listitem><para>
   Smallest consumers consumers may set.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>max_uA</term>
      <listitem><para>
   Largest current consumers may set.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>valid_modes_mask</term>
      <listitem><para>
   Mask of modes which may be configured by consumers.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>valid_ops_mask</term>
      <listitem><para>
   Operations which may be performed by consumers.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>input_uV</term>
      <listitem><para>
   Input voltage for regulator when supplied by another regulator.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>state_disk</term>
      <listitem><para>
   State for regulator when system is suspended in disk mode.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>state_mem</term>
      <listitem><para>
   State for regulator when system is suspended in mem mode.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>state_standby</term>
      <listitem><para>
   State for regulator when system is suspended in standby
   mode.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>initial_state</term>
      <listitem><para>
   Suspend state to set by default.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>initial_mode</term>
      <listitem><para>
   Mode to set at startup.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>always_on</term>
      <listitem><para>
   Set if the regulator should never be disabled.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>boot_on</term>
      <listitem><para>
   Set if the regulator is enabled when the system is initially
   started.  If the regulator is not enabled by the hardware or
   bootloader then it will be enabled when the constraints are
   applied.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>apply_uV</term>
      <listitem><para>
   Apply the voltage constraint when initialising.
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
<refsect1>
<title>Description</title>
<para>
   </para><para>

   This struct describes regulator and board/machine specific constraints.
</para>
</refsect1>
</refentry>

<refentry id="API-struct-regulator-consumer-supply">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct regulator_consumer_supply</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct regulator_consumer_supply</refname>
 <refpurpose>
     supply -&gt; device mapping
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct regulator_consumer_supply {
  struct device * dev;
  const char * dev_name;
  const char * supply;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>dev</term>
      <listitem><para>
   Device structure for the consumer.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>dev_name</term>
      <listitem><para>
   Result of <function>dev_name</function> for the consumer.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>supply</term>
      <listitem><para>
   Name for the supply.
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
<refsect1>
<title>Description</title>
<para>
   </para><para>

   This maps a supply name to a device.  Only one of dev or dev_name
   can be specified.  Use of dev_name allows support for buses which
   make struct device available late such as I2C and is the preferred
   form.
</para>
</refsect1>
</refentry>

<refentry id="API-struct-regulator-init-data">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct regulator_init_data</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct regulator_init_data</refname>
 <refpurpose>
     regulator platform initialisation data.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct regulator_init_data {
  struct device * supply_regulator_dev;
  struct regulation_constraints constraints;
  int num_consumer_supplies;
  struct regulator_consumer_supply * consumer_supplies;
  int (* regulator_init) (void *driver_data);
  void * driver_data;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>supply_regulator_dev</term>
      <listitem><para>
   Parent regulator (if any).
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>constraints</term>
      <listitem><para>
   Constraints.  These must be specified for the regulator to
   be usable.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>num_consumer_supplies</term>
      <listitem><para>
   Number of consumer device supplies.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>consumer_supplies</term>
      <listitem><para>
   Consumer device supply configuration.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>regulator_init</term>
      <listitem><para>
   Callback invoked when the regulator has been registered.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>driver_data</term>
      <listitem><para>
   Data passed to regulator_init.
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
<refsect1>
<title>Description</title>
<para>
   </para><para>

   Initialisation constraints, our supply and consumers supplies.
</para>
</refsect1>
</refentry>

<!-- include/linux/regulator/driver.h -->
<refentry id="API-struct-regulator-ops">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct regulator_ops</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct regulator_ops</refname>
 <refpurpose>
  regulator operations.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct regulator_ops {
  int (* list_voltage) (struct regulator_dev *, unsigned selector);
  int (* set_voltage) (struct regulator_dev *, int min_uV, int max_uV);
  int (* get_voltage) (struct regulator_dev *);
  int (* set_current_limit) (struct regulator_dev *,int min_uA, int max_uA);
  int (* get_current_limit) (struct regulator_dev *);
  int (* enable) (struct regulator_dev *);
  int (* disable) (struct regulator_dev *);
  int (* is_enabled) (struct regulator_dev *);
  int (* set_mode) (struct regulator_dev *, unsigned int mode);
  unsigned int (* get_mode) (struct regulator_dev *);
  int (* get_status) (struct regulator_dev *);
  unsigned int (* get_optimum_mode) (struct regulator_dev *, int input_uV,int output_uV, int load_uA);
  int (* set_suspend_voltage) (struct regulator_dev *, int uV);
  int (* set_suspend_enable) (struct regulator_dev *);
  int (* set_suspend_disable) (struct regulator_dev *);
  int (* set_suspend_mode) (struct regulator_dev *, unsigned int mode);
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>list_voltage</term>
      <listitem><para>
Return one of the supported voltages, in microvolts; zero
if the selector indicates a voltage that is unusable on this system;
or negative errno.  Selectors range from zero to one less than
regulator_desc.n_voltages.  Voltages may be reported in any order.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>set_voltage</term>
      <listitem><para>
Set the voltage for the regulator within the range specified.
The driver should select the voltage closest to min_uV.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>get_voltage</term>
      <listitem><para>
Return the currently configured voltage for the regulator.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>set_current_limit</term>
      <listitem><para>
Configure a limit for a current-limited regulator.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>get_current_limit</term>
      <listitem><para>
Get the configured limit for a current-limited regulator.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>enable</term>
      <listitem><para>
Configure the regulator as enabled.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>disable</term>
      <listitem><para>
Configure the regulator as disabled.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>is_enabled</term>
      <listitem><para>
Return 1 if the regulator is enabled, 0 if not.
May also return negative errno.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>set_mode</term>
      <listitem><para>
Set the configured operating mode for the regulator.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>get_mode</term>
      <listitem><para>
Get the configured operating mode for the regulator.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>get_status</term>
      <listitem><para>
Return actual (not as-configured) status of regulator, as a
REGULATOR_STATUS value (or negative errno)
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>get_optimum_mode</term>
      <listitem><para>
Get the most efficient operating mode for the regulator
when running with the specified parameters.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>set_suspend_voltage</term>
      <listitem><para>
Set the voltage for the regulator when the system
is suspended.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>set_suspend_enable</term>
      <listitem><para>
Mark the regulator as enabled when the system is
suspended.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>set_suspend_disable</term>
      <listitem><para>
Mark the regulator as disabled when the system is
suspended.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>set_suspend_mode</term>
      <listitem><para>
Set the operating mode for the regulator when the
system is suspended.
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
<refsect1>
<title>Description</title>
<para>
   This struct describes regulator operations which can be implemented by
   regulator chip drivers.
</para>
</refsect1>
</refentry>

<refentry id="API-struct-regulator-desc">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>struct regulator_desc</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>struct regulator_desc</refname>
 <refpurpose>
     Regulator descriptor
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <programlisting>
struct regulator_desc {
  const char * name;
  int id;
  unsigned n_voltages;
  struct regulator_ops * ops;
  int irq;
  enum regulator_type type;
  struct module * owner;
};  </programlisting>
</refsynopsisdiv>
 <refsect1>
  <title>Members</title>
  <variablelist>
    <varlistentry>      <term>name</term>
      <listitem><para>
   Identifying name for the regulator.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>id</term>
      <listitem><para>
   Numerical identifier for the regulator.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>n_voltages</term>
      <listitem><para>
   Number of selectors available for ops.<function>list_voltage</function>.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>ops</term>
      <listitem><para>
   Regulator operations table.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>irq</term>
      <listitem><para>
   Interrupt number for the regulator.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>type</term>
      <listitem><para>
   Indicates if the regulator is a voltage or current regulator.
      </para></listitem>
    </varlistentry>
    <varlistentry>      <term>owner</term>
      <listitem><para>
   Module providing the regulator, used for refcounting.
      </para></listitem>
    </varlistentry>
  </variablelist>
 </refsect1>
<refsect1>
<title>Description</title>
<para>
   </para><para>

   Each regulator registered with the core is described with a structure of
   this type.
</para>
</refsect1>
</refentry>

<!-- drivers/regulator/core.c -->
<refentry id="API-regulator-get">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_get</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_get</refname>
 <refpurpose>
  lookup and obtain a reference to a regulator.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct regulator * <function>regulator_get </function></funcdef>
   <paramdef>struct device * <parameter>dev</parameter></paramdef>
   <paramdef>const char * <parameter>id</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device for regulator <quote>consumer</quote>
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>id</parameter></term>
   <listitem>
    <para>
     Supply name or regulator ID.
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns a struct regulator corresponding to the regulator producer,
   or <function>IS_ERR</function> condition containing errno.
   </para><para>

   Use of supply names configured via <function>regulator_set_device_supply</function> is
   strongly encouraged.  It is recommended that the supply name used
   should match the name used for the supply and/or the relevant
   device pins in the datasheet.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-get-exclusive">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_get_exclusive</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_get_exclusive</refname>
 <refpurpose>
     obtain exclusive access to a regulator.
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct regulator * <function>regulator_get_exclusive </function></funcdef>
   <paramdef>struct device * <parameter>dev</parameter></paramdef>
   <paramdef>const char * <parameter>id</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     device for regulator <quote>consumer</quote>
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>id</parameter></term>
   <listitem>
    <para>
     Supply name or regulator ID.
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns a struct regulator corresponding to the regulator producer,
   or <function>IS_ERR</function> condition containing errno.  Other consumers will be
   unable to obtain this reference is held and the use count for the
   regulator will be initialised to reflect the current state of the
   regulator.
   </para><para>

   This is intended for use by consumers which cannot tolerate shared
   use of the regulator such as those which need to force the
   regulator off for correct operation of the hardware they are
   controlling.
   </para><para>

   Use of supply names configured via <function>regulator_set_device_supply</function> is
   strongly encouraged.  It is recommended that the supply name used
   should match the name used for the supply and/or the relevant
   device pins in the datasheet.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-put">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_put</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_put</refname>
 <refpurpose>
     "free" the regulator source
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>regulator_put </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Note</title>
<para>
   drivers must ensure that all regulator_enable calls made on this
   regulator source are balanced by regulator_disable calls prior to calling
   this function.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-enable">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_enable</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_enable</refname>
 <refpurpose>
     enable regulator output
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_enable </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Request that the regulator be enabled with the regulator output at
   the predefined voltage or current value.  Calls to <function>regulator_enable</function>
   must be balanced with calls to <function>regulator_disable</function>.
</para>
</refsect1>
<refsect1>
<title>NOTE</title>
<para>
   the output value can be set by other drivers, boot loader or may be
   hardwired in the regulator.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-disable">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_disable</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_disable</refname>
 <refpurpose>
     disable regulator output
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_disable </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Disable the regulator output voltage or current.  Calls to
   <function>regulator_enable</function> must be balanced with calls to
   <function>regulator_disable</function>.
</para>
</refsect1>
<refsect1>
<title>NOTE</title>
<para>
   this will only disable the regulator output if no other consumer
   devices have it enabled, the regulator device supports disabling and
   machine constraints permit this operation.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-force-disable">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_force_disable</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_force_disable</refname>
 <refpurpose>
     force disable regulator output
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_force_disable </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Forcibly disable the regulator output voltage or current.
</para>
</refsect1>
<refsect1>
<title>NOTE</title>
<para>
   this *will* disable the regulator output even if other consumer
   devices have it enabled. This should be used for situations when device
   damage will likely occur if the regulator is not disabled (e.g. over temp).
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-is-enabled">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_is_enabled</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_is_enabled</refname>
 <refpurpose>
     is the regulator output enabled
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_is_enabled </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns positive if the regulator driver backing the source/client
   has requested that the device be enabled, zero if it hasn't, else a
   negative errno code.
   </para><para>

   Note that the device backing this regulator handle can have multiple
   users, so it might be enabled even if <function>regulator_enable</function> was never
   called for this particular source.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-count-voltages">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_count_voltages</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_count_voltages</refname>
 <refpurpose>
     count <function>regulator_list_voltage</function> selectors
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_count_voltages </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns number of selectors, or negative errno.  Selectors are
   numbered starting at zero, and typically correspond to bitfields
   in hardware registers.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-list-voltage">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_list_voltage</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_list_voltage</refname>
 <refpurpose>
     enumerate supported voltages
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_list_voltage </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
   <paramdef>unsigned <parameter>selector</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>selector</parameter></term>
   <listitem>
    <para>
     identify voltage to list
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Context</title>
<para>
   can sleep
</para>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Returns a voltage that can be passed to <parameter>regulator_set_voltage</parameter>(),
   zero if this selector code can't be used on this sytem, or a
   negative errno.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-set-voltage">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_set_voltage</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_set_voltage</refname>
 <refpurpose>
     set regulator output voltage
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_set_voltage </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
   <paramdef>int <parameter>min_uV</parameter></paramdef>
   <paramdef>int <parameter>max_uV</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>min_uV</parameter></term>
   <listitem>
    <para>
     Minimum required voltage in uV
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>max_uV</parameter></term>
   <listitem>
    <para>
     Maximum acceptable voltage in uV
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Sets a voltage regulator to the desired output voltage. This can be set
   during any regulator state. IOW, regulator can be disabled or enabled.
   </para><para>

   If the regulator is enabled then the voltage will change to the new value
   immediately otherwise if the regulator is disabled the regulator will
   output at the new voltage when enabled.
</para>
</refsect1>
<refsect1>
<title>NOTE</title>
<para>
   If the regulator is shared between several devices then the lowest
   request voltage that meets the system constraints will be used.
   Regulator system constraints must be set for this regulator before
   calling this function otherwise this call will fail.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-get-voltage">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_get_voltage</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_get_voltage</refname>
 <refpurpose>
     get regulator output voltage
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_get_voltage </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This returns the current regulator voltage in uV.
</para>
</refsect1>
<refsect1>
<title>NOTE</title>
<para>
   If the regulator is disabled it will return the voltage value. This
   function should not be used to determine regulator state.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-set-current-limit">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_set_current_limit</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_set_current_limit</refname>
 <refpurpose>
     set regulator output current limit
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_set_current_limit </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
   <paramdef>int <parameter>min_uA</parameter></paramdef>
   <paramdef>int <parameter>max_uA</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>min_uA</parameter></term>
   <listitem>
    <para>
     Minimuum supported current in uA
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>max_uA</parameter></term>
   <listitem>
    <para>
     Maximum supported current in uA
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Sets current sink to the desired output current. This can be set during
   any regulator state. IOW, regulator can be disabled or enabled.
   </para><para>

   If the regulator is enabled then the current will change to the new value
   immediately otherwise if the regulator is disabled the regulator will
   output at the new current when enabled.
</para>
</refsect1>
<refsect1>
<title>NOTE</title>
<para>
   Regulator system constraints must be set for this regulator before
   calling this function otherwise this call will fail.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-get-current-limit">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_get_current_limit</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_get_current_limit</refname>
 <refpurpose>
     get regulator output current
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_get_current_limit </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This returns the current supplied by the specified current sink in uA.
</para>
</refsect1>
<refsect1>
<title>NOTE</title>
<para>
   If the regulator is disabled it will return the current value. This
   function should not be used to determine regulator state.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-set-mode">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_set_mode</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_set_mode</refname>
 <refpurpose>
     set regulator operating mode
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_set_mode </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
   <paramdef>unsigned int <parameter>mode</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>mode</parameter></term>
   <listitem>
    <para>
     operating mode - one of the REGULATOR_MODE constants
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Set regulator operating mode to increase regulator efficiency or improve
   regulation performance.
</para>
</refsect1>
<refsect1>
<title>NOTE</title>
<para>
   Regulator system constraints must be set for this regulator before
   calling this function otherwise this call will fail.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-get-mode">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_get_mode</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_get_mode</refname>
 <refpurpose>
     get regulator operating mode
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>unsigned int <function>regulator_get_mode </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Get the current regulator operating mode.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-set-optimum-mode">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_set_optimum_mode</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_set_optimum_mode</refname>
 <refpurpose>
     set regulator optimum operating mode
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_set_optimum_mode </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
   <paramdef>int <parameter>uA_load</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>uA_load</parameter></term>
   <listitem>
    <para>
     load current
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Notifies the regulator core of a new device load. This is then used by
   DRMS (if enabled by constraints) to set the most efficient regulator
   operating mode for the new regulator loading.
   </para><para>

   Consumer devices notify their supply regulator of the maximum power
   they will require (can be taken from device datasheet in the power
   consumption tables) when they change operational status and hence power
   state. Examples of operational state changes that can affect power
</para>
</refsect1>
<refsect1>
<title>consumption are </title>
<para>
   -
   </para><para>

   o Device is opened / closed.
   o Device I/O is about to begin or has just finished.
   o Device is idling in between work.
   </para><para>

   This information is also exported via sysfs to userspace.
   </para><para>

   DRMS will sum the total requested load on the regulator and change
   to the most efficient operating mode if platform constraints allow.
   </para><para>

   Returns the new regulator mode or error.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-register-notifier">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_register_notifier</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_register_notifier</refname>
 <refpurpose>
     register regulator event notifier
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_register_notifier </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
   <paramdef>struct notifier_block * <parameter>nb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>nb</parameter></term>
   <listitem>
    <para>
     notifier block
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Register notifier block to receive regulator events.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-unregister-notifier">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_unregister_notifier</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_unregister_notifier</refname>
 <refpurpose>
     unregister regulator event notifier
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_unregister_notifier </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
   <paramdef>struct notifier_block * <parameter>nb</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>nb</parameter></term>
   <listitem>
    <para>
     notifier block
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Unregister regulator event notifier block.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-bulk-get">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_bulk_get</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_bulk_get</refname>
 <refpurpose>
     get multiple regulator consumers
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_bulk_get </function></funcdef>
   <paramdef>struct device * <parameter>dev</parameter></paramdef>
   <paramdef>int <parameter>num_consumers</parameter></paramdef>
   <paramdef>struct regulator_bulk_data * <parameter>consumers</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     Device to supply
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>num_consumers</parameter></term>
   <listitem>
    <para>
     Number of consumers to register
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>consumers</parameter></term>
   <listitem>
    <para>
     Configuration of consumers; clients are stored here.
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   <parameter>return</parameter> 0 on success, an errno on failure.
   </para><para>

   This helper function allows drivers to get several regulator
   consumers in one operation.  If any of the regulators cannot be
   acquired then any regulators that were allocated will be freed
   before returning to the caller.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-bulk-enable">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_bulk_enable</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_bulk_enable</refname>
 <refpurpose>
     enable multiple regulator consumers
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_bulk_enable </function></funcdef>
   <paramdef>int <parameter>num_consumers</parameter></paramdef>
   <paramdef>struct regulator_bulk_data * <parameter>consumers</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>num_consumers</parameter></term>
   <listitem>
    <para>
     Number of consumers
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>consumers</parameter></term>
   <listitem>
    <para>
     Consumer data; clients are stored here.
     <parameter>return</parameter>         0 on success, an errno on failure
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This convenience API allows consumers to enable multiple regulator
   clients in a single API call.  If any consumers cannot be enabled
   then any others that were enabled will be disabled again prior to
   return.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-bulk-disable">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_bulk_disable</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_bulk_disable</refname>
 <refpurpose>
     disable multiple regulator consumers
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_bulk_disable </function></funcdef>
   <paramdef>int <parameter>num_consumers</parameter></paramdef>
   <paramdef>struct regulator_bulk_data * <parameter>consumers</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>num_consumers</parameter></term>
   <listitem>
    <para>
     Number of consumers
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>consumers</parameter></term>
   <listitem>
    <para>
     Consumer data; clients are stored here.
     <parameter>return</parameter>         0 on success, an errno on failure
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This convenience API allows consumers to disable multiple regulator
   clients in a single API call.  If any consumers cannot be enabled
   then any others that were disabled will be disabled again prior to
   return.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-bulk-free">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_bulk_free</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_bulk_free</refname>
 <refpurpose>
     free multiple regulator consumers
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>regulator_bulk_free </function></funcdef>
   <paramdef>int <parameter>num_consumers</parameter></paramdef>
   <paramdef>struct regulator_bulk_data * <parameter>consumers</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>num_consumers</parameter></term>
   <listitem>
    <para>
     Number of consumers
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>consumers</parameter></term>
   <listitem>
    <para>
     Consumer data; clients are stored here.
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   This convenience API allows consumers to free multiple regulator
   clients in a single API call.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-notifier-call-chain">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_notifier_call_chain</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_notifier_call_chain</refname>
 <refpurpose>
     call regulator event notifier
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_notifier_call_chain </function></funcdef>
   <paramdef>struct regulator_dev * <parameter>rdev</parameter></paramdef>
   <paramdef>unsigned long <parameter>event</parameter></paramdef>
   <paramdef>void * <parameter>data</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>rdev</parameter></term>
   <listitem>
    <para>
     regulator source
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>event</parameter></term>
   <listitem>
    <para>
     notifier block
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>data</parameter></term>
   <listitem>
    <para>
     callback-specific data.
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Called by regulator drivers to notify clients a regulator event has
   occurred. We also notify regulator clients downstream.
   Note lock must be held by caller.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-mode-to-status">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_mode_to_status</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_mode_to_status</refname>
 <refpurpose>
     convert a regulator mode into a status
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_mode_to_status </function></funcdef>
   <paramdef>unsigned int <parameter>mode</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>mode</parameter></term>
   <listitem>
    <para>
     Mode to convert
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Convert a regulator mode into a status.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-register">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_register</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_register</refname>
 <refpurpose>
     register regulator
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>struct regulator_dev * <function>regulator_register </function></funcdef>
   <paramdef>struct regulator_desc * <parameter>regulator_desc</parameter></paramdef>
   <paramdef>struct device * <parameter>dev</parameter></paramdef>
   <paramdef>struct regulator_init_data * <parameter>init_data</parameter></paramdef>
   <paramdef>void * <parameter>driver_data</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator_desc</parameter></term>
   <listitem>
    <para>
     regulator to register
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>dev</parameter></term>
   <listitem>
    <para>
     struct device for the regulator
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>init_data</parameter></term>
   <listitem>
    <para>
     platform provided init data, passed through by driver
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>driver_data</parameter></term>
   <listitem>
    <para>
     private regulator data
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Called by regulator drivers to register a regulator.
   Returns 0 on success.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-unregister">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_unregister</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_unregister</refname>
 <refpurpose>
     unregister regulator
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>regulator_unregister </function></funcdef>
   <paramdef>struct regulator_dev * <parameter>rdev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>rdev</parameter></term>
   <listitem>
    <para>
     regulator to unregister
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Called by regulator drivers to unregister a regulator.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-suspend-prepare">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_suspend_prepare</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_suspend_prepare</refname>
 <refpurpose>
     prepare regulators for system wide suspend
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>regulator_suspend_prepare </function></funcdef>
   <paramdef>suspend_state_t <parameter>state</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>state</parameter></term>
   <listitem>
    <para>
     system suspend state
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Configure each regulator with it's suspend operating parameters for state.
   This will usually be called by machine suspend code prior to supending.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-has-full-constraints">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_has_full_constraints</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_has_full_constraints</refname>
 <refpurpose>
     the system has fully specified constraints
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>regulator_has_full_constraints </function></funcdef>
   <paramdef> <parameter>void</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>void</parameter></term>
   <listitem>
    <para>
     no arguments
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   </para><para>

   Calling this function will cause the regulator API to disable all
   regulators which have a zero use count and don't have an always_on
   constraint in a late_initcall.
   </para><para>

   The intention is that this will become the default behaviour in a
   future kernel release so users are encouraged to use this facility
   now.
</para>
</refsect1>
</refentry>

<refentry id="API-rdev-get-drvdata">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rdev_get_drvdata</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rdev_get_drvdata</refname>
 <refpurpose>
     get rdev regulator driver data
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void * <function>rdev_get_drvdata </function></funcdef>
   <paramdef>struct regulator_dev * <parameter>rdev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>rdev</parameter></term>
   <listitem>
    <para>
     regulator
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Get rdev regulator driver private data. This call can be used in the
   regulator driver context.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-get-drvdata">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_get_drvdata</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_get_drvdata</refname>
 <refpurpose>
     get regulator driver data
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void * <function>regulator_get_drvdata </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>
   Get regulator driver private data. This call can be used in the consumer
   driver context when non API regulator specific functions need to be called.
</para>
</refsect1>
</refentry>

<refentry id="API-regulator-set-drvdata">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>regulator_set_drvdata</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>regulator_set_drvdata</refname>
 <refpurpose>
     set regulator driver data
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>void <function>regulator_set_drvdata </function></funcdef>
   <paramdef>struct regulator * <parameter>regulator</parameter></paramdef>
   <paramdef>void * <parameter>data</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>regulator</parameter></term>
   <listitem>
    <para>
     regulator
    </para>
   </listitem>
  </varlistentry>
  <varlistentry>
   <term><parameter>data</parameter></term>
   <listitem>
    <para>
     data
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

<refentry id="API-rdev-get-id">
<refentryinfo>
 <title>LINUX</title>
 <productname>Kernel Hackers Manual</productname>
 <date>October 2009</date>
</refentryinfo>
<refmeta>
 <refentrytitle><phrase>rdev_get_id</phrase></refentrytitle>
 <manvolnum>9</manvolnum>
 <refmiscinfo class="version">2.6.32-rc5</refmiscinfo>
</refmeta>
<refnamediv>
 <refname>rdev_get_id</refname>
 <refpurpose>
     get regulator ID
 </refpurpose>
</refnamediv>
<refsynopsisdiv>
 <title>Synopsis</title>
  <funcsynopsis><funcprototype>
   <funcdef>int <function>rdev_get_id </function></funcdef>
   <paramdef>struct regulator_dev * <parameter>rdev</parameter></paramdef>
  </funcprototype></funcsynopsis>
</refsynopsisdiv>
<refsect1>
 <title>Arguments</title>
 <variablelist>
  <varlistentry>
   <term><parameter>rdev</parameter></term>
   <listitem>
    <para>
     regulator
    </para>
   </listitem>
  </varlistentry>
 </variablelist>
</refsect1>
</refentry>

  </chapter>
</book>
