1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>Voltage and current regulator API</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="next" href="intro.html" title="Chapter 1. Introduction"></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">Voltage and current regulator API</th></tr><tr><td width="20%" align="left"> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr></table><hr></div><div class="book"><div class="titlepage"><div><div><h1 class="title"><a name="regulator-api"></a>Voltage and current regulator API</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">Liam</span> <span class="surname">Girdwood</span></h3><div class="affiliation"><div class="address"><p><br> 2      <code class="email"><<a class="email" href="mailto:lrg@slimlogic.co.uk">lrg@slimlogic.co.uk</a>></code><br> 3     </p></div></div></div><div class="author"><h3 class="author"><span class="firstname">Mark</span> <span class="surname">Brown</span></h3><div class="affiliation"><span class="orgname">Wolfson Microelectronics<br></span><div class="address"><p><br> 4      <code class="email"><<a class="email" href="mailto:broonie@opensource.wolfsonmicro.com">broonie@opensource.wolfsonmicro.com</a>></code><br> 5     </p></div></div></div></div></div><div><p class="copyright">Copyright © 2007-2008 Wolfson Microelectronics</p></div><div><p class="copyright">Copyright © 2008 Liam Girdwood</p></div><div><div class="legalnotice"><a name="idp1124251388"></a><p> 6 This documentation is free software; you can redistribute 7 it and/or modify it under the terms of the GNU General Public 8 License version 2 as published by the Free Software Foundation. 9 </p><p> 10 This program is distributed in the hope that it will be 11 useful, but WITHOUT ANY WARRANTY; without even the implied 12 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 See the GNU General Public License for more details. 14 </p><p> 15 You should have received a copy of the GNU General Public 16 License along with this program; if not, write to the Free 17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 18 MA 02111-1307 USA 19 </p><p> 20 For more details see the file COPYING in the source 21 distribution of Linux. 22 </p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="chapter"><a href="intro.html">1. Introduction</a></span></dt><dd><dl><dt><span class="sect1"><a href="intro.html#glossary">Glossary</a></span></dt></dl></dd><dt><span class="chapter"><a href="consumer.html">2. Consumer driver interface</a></span></dt><dd><dl><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></dd><dt><span class="chapter"><a href="driver.html">3. Regulator driver interface</a></span></dt><dt><span class="chapter"><a href="machine.html">4. Machine interface</a></span></dt><dd><dl><dt><span class="sect1"><a href="machine.html#machine-supply">Supplies</a></span></dt><dt><span class="sect1"><a href="machine-constraint.html">Constraints</a></span></dt></dl></dd><dt><span class="chapter"><a href="api.html">5. API reference</a></span></dt><dd><dl><dt><span class="refentrytitle"><a href="API-struct-pre-voltage-change-data.html"><span class="phrase">struct pre_voltage_change_data</span></a></span><span class="refpurpose"> — 23 Data sent with PRE_VOLTAGE_CHANGE event 24 </span></dt><dt><span class="refentrytitle"><a href="API-struct-regulator-bulk-data.html"><span class="phrase">struct regulator_bulk_data</span></a></span><span class="refpurpose"> — 25 Data used for bulk regulator operations. 26 </span></dt><dt><span class="refentrytitle"><a href="API-struct-regulator-state.html"><span class="phrase">struct regulator_state</span></a></span><span class="refpurpose"> — 27 regulator state during low power system states 28 </span></dt><dt><span class="refentrytitle"><a href="API-struct-regulation-constraints.html"><span class="phrase">struct regulation_constraints</span></a></span><span class="refpurpose"> — 29 regulator operating constraints. 30 </span></dt><dt><span class="refentrytitle"><a href="API-struct-regulator-consumer-supply.html"><span class="phrase">struct regulator_consumer_supply</span></a></span><span class="refpurpose"> — 31 supply -> device mapping 32 </span></dt><dt><span class="refentrytitle"><a href="API-struct-regulator-init-data.html"><span class="phrase">struct regulator_init_data</span></a></span><span class="refpurpose"> — 33 regulator platform initialisation data. 34 </span></dt><dt><span class="refentrytitle"><a href="API-struct-regulator-linear-range.html"><span class="phrase">struct regulator_linear_range</span></a></span><span class="refpurpose"> — 35 specify linear voltage ranges 36 </span></dt><dt><span class="refentrytitle"><a href="API-struct-regulator-ops.html"><span class="phrase">struct regulator_ops</span></a></span><span class="refpurpose"> — 37 regulator operations. 38 </span></dt><dt><span class="refentrytitle"><a href="API-struct-regulator-desc.html"><span class="phrase">struct regulator_desc</span></a></span><span class="refpurpose"> — 39 Static regulator descriptor 40 </span></dt><dt><span class="refentrytitle"><a href="API-struct-regulator-config.html"><span class="phrase">struct regulator_config</span></a></span><span class="refpurpose"> — 41 Dynamic regulator descriptor 42 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-get.html"><span class="phrase">regulator_get</span></a></span><span class="refpurpose"> — 43 lookup and obtain a reference to a regulator. 44 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-get-exclusive.html"><span class="phrase">regulator_get_exclusive</span></a></span><span class="refpurpose"> — 45 obtain exclusive access to a regulator. 46 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-get-optional.html"><span class="phrase">regulator_get_optional</span></a></span><span class="refpurpose"> — 47 obtain optional access to a regulator. 48 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-put.html"><span class="phrase">regulator_put</span></a></span><span class="refpurpose"> — 49 "free" the regulator source 50 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-register-supply-alias.html"><span class="phrase">regulator_register_supply_alias</span></a></span><span class="refpurpose"> — 51 Provide device alias for supply lookup 52 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-unregister-supply-alias.html"><span class="phrase">regulator_unregister_supply_alias</span></a></span><span class="refpurpose"> — 53 Remove device alias 54 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-bulk-register-supply-alias.html"><span class="phrase">regulator_bulk_register_supply_alias</span></a></span><span class="refpurpose"> — 55 register multiple aliases 56 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-bulk-unregister-supply-alias.html"><span class="phrase">regulator_bulk_unregister_supply_alias</span></a></span><span class="refpurpose"> — 57 unregister multiple aliases 58 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-enable.html"><span class="phrase">regulator_enable</span></a></span><span class="refpurpose"> — 59 enable regulator output 60 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-disable.html"><span class="phrase">regulator_disable</span></a></span><span class="refpurpose"> — 61 disable regulator output 62 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-force-disable.html"><span class="phrase">regulator_force_disable</span></a></span><span class="refpurpose"> — 63 force disable regulator output 64 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-disable-deferred.html"><span class="phrase">regulator_disable_deferred</span></a></span><span class="refpurpose"> — 65 disable regulator output with delay 66 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-is-enabled.html"><span class="phrase">regulator_is_enabled</span></a></span><span class="refpurpose"> — 67 is the regulator output enabled 68 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-can-change-voltage.html"><span class="phrase">regulator_can_change_voltage</span></a></span><span class="refpurpose"> — 69 check if regulator can change voltage 70 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-count-voltages.html"><span class="phrase">regulator_count_voltages</span></a></span><span class="refpurpose"> — 71 count <code class="function">regulator_list_voltage</code> selectors 72 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-list-voltage.html"><span class="phrase">regulator_list_voltage</span></a></span><span class="refpurpose"> — 73 enumerate supported voltages 74 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-get-hardware-vsel-register.html"><span class="phrase">regulator_get_hardware_vsel_register</span></a></span><span class="refpurpose"> — 75 get the HW voltage selector register 76 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-list-hardware-vsel.html"><span class="phrase">regulator_list_hardware_vsel</span></a></span><span class="refpurpose"> — 77 get the HW-specific register value for a selector 78 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-get-linear-step.html"><span class="phrase">regulator_get_linear_step</span></a></span><span class="refpurpose"> — 79 return the voltage step size between VSEL values 80 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-is-supported-voltage.html"><span class="phrase">regulator_is_supported_voltage</span></a></span><span class="refpurpose"> — 81 check if a voltage range can be supported 82 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-set-voltage.html"><span class="phrase">regulator_set_voltage</span></a></span><span class="refpurpose"> — 83 set regulator output voltage 84 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-set-voltage-time.html"><span class="phrase">regulator_set_voltage_time</span></a></span><span class="refpurpose"> — 85 get raise/fall time 86 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-set-voltage-time-sel.html"><span class="phrase">regulator_set_voltage_time_sel</span></a></span><span class="refpurpose"> — 87 get raise/fall time 88 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-sync-voltage.html"><span class="phrase">regulator_sync_voltage</span></a></span><span class="refpurpose"> — 89 re-apply last regulator output voltage 90 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-get-voltage.html"><span class="phrase">regulator_get_voltage</span></a></span><span class="refpurpose"> — 91 get regulator output voltage 92 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-set-current-limit.html"><span class="phrase">regulator_set_current_limit</span></a></span><span class="refpurpose"> — 93 set regulator output current limit 94 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-get-current-limit.html"><span class="phrase">regulator_get_current_limit</span></a></span><span class="refpurpose"> — 95 get regulator output current 96 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-set-mode.html"><span class="phrase">regulator_set_mode</span></a></span><span class="refpurpose"> — 97 set regulator operating mode 98 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-get-mode.html"><span class="phrase">regulator_get_mode</span></a></span><span class="refpurpose"> — 99 get regulator operating mode 100 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-set-load.html"><span class="phrase">regulator_set_load</span></a></span><span class="refpurpose"> — 101 set regulator load 102 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-allow-bypass.html"><span class="phrase">regulator_allow_bypass</span></a></span><span class="refpurpose"> — 103 allow the regulator to go into bypass mode 104 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-register-notifier.html"><span class="phrase">regulator_register_notifier</span></a></span><span class="refpurpose"> — 105 register regulator event notifier 106 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-unregister-notifier.html"><span class="phrase">regulator_unregister_notifier</span></a></span><span class="refpurpose"> — 107 unregister regulator event notifier 108 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-bulk-get.html"><span class="phrase">regulator_bulk_get</span></a></span><span class="refpurpose"> — 109 get multiple regulator consumers 110 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-bulk-enable.html"><span class="phrase">regulator_bulk_enable</span></a></span><span class="refpurpose"> — 111 enable multiple regulator consumers 112 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-bulk-disable.html"><span class="phrase">regulator_bulk_disable</span></a></span><span class="refpurpose"> — 113 disable multiple regulator consumers 114 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-bulk-force-disable.html"><span class="phrase">regulator_bulk_force_disable</span></a></span><span class="refpurpose"> — 115 force disable multiple regulator consumers 116 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-bulk-free.html"><span class="phrase">regulator_bulk_free</span></a></span><span class="refpurpose"> — 117 free multiple regulator consumers 118 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-notifier-call-chain.html"><span class="phrase">regulator_notifier_call_chain</span></a></span><span class="refpurpose"> — 119 call regulator event notifier 120 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-mode-to-status.html"><span class="phrase">regulator_mode_to_status</span></a></span><span class="refpurpose"> — 121 convert a regulator mode into a status 122 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-register.html"><span class="phrase">regulator_register</span></a></span><span class="refpurpose"> — 123 register regulator 124 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-unregister.html"><span class="phrase">regulator_unregister</span></a></span><span class="refpurpose"> — 125 unregister regulator 126 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-suspend-prepare.html"><span class="phrase">regulator_suspend_prepare</span></a></span><span class="refpurpose"> — 127 prepare regulators for system wide suspend 128 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-suspend-finish.html"><span class="phrase">regulator_suspend_finish</span></a></span><span class="refpurpose"> — 129 resume regulators from system wide suspend 130 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-has-full-constraints.html"><span class="phrase">regulator_has_full_constraints</span></a></span><span class="refpurpose"> — 131 the system has fully specified constraints 132 </span></dt><dt><span class="refentrytitle"><a href="API-rdev-get-drvdata.html"><span class="phrase">rdev_get_drvdata</span></a></span><span class="refpurpose"> — 133 get rdev regulator driver data 134 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-get-drvdata.html"><span class="phrase">regulator_get_drvdata</span></a></span><span class="refpurpose"> — 135 get regulator driver data 136 </span></dt><dt><span class="refentrytitle"><a href="API-regulator-set-drvdata.html"><span class="phrase">regulator_set_drvdata</span></a></span><span class="refpurpose"> — 137 set regulator driver data 138 </span></dt><dt><span class="refentrytitle"><a href="API-rdev-get-id.html"><span class="phrase">rdev_get_id</span></a></span><span class="refpurpose"> — 139 get regulator ID 140 </span></dt></dl></dd></dl></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="intro.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"> </td><td width="40%" align="right" valign="top"> Chapter 1. Introduction</td></tr></table></div></body></html> 141