1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>struct regulator_ops</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Voltage and current regulator API"><link rel="up" href="api.html" title="Chapter 5. API reference"><link rel="prev" href="API-struct-regulator-linear-range.html" title="struct regulator_linear_range"><link rel="next" href="API-struct-regulator-desc.html" title="struct regulator_desc"></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"><span class="phrase">struct regulator_ops</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-struct-regulator-linear-range.html">Prev</a> </td><th width="60%" align="center">Chapter 5. API reference</th><td width="20%" align="right"> <a accesskey="n" href="API-struct-regulator-desc.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-regulator-ops"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct regulator_ops — 2 regulator operations. 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting"> 4struct regulator_ops { 5 int (* list_voltage) (struct regulator_dev *, unsigned selector); 6 int (* set_voltage) (struct regulator_dev *, int min_uV, int max_uV,unsigned *selector); 7 int (* map_voltage) (struct regulator_dev *, int min_uV, int max_uV); 8 int (* set_voltage_sel) (struct regulator_dev *, unsigned selector); 9 int (* get_voltage) (struct regulator_dev *); 10 int (* get_voltage_sel) (struct regulator_dev *); 11 int (* set_current_limit) (struct regulator_dev *,int min_uA, int max_uA); 12 int (* get_current_limit) (struct regulator_dev *); 13 int (* enable) (struct regulator_dev *); 14 int (* disable) (struct regulator_dev *); 15 int (* is_enabled) (struct regulator_dev *); 16 int (* set_mode) (struct regulator_dev *, unsigned int mode); 17 unsigned int (* get_mode) (struct regulator_dev *); 18 int (* enable_time) (struct regulator_dev *); 19 int (* set_ramp_delay) (struct regulator_dev *, int ramp_delay); 20 int (* set_voltage_time_sel) (struct regulator_dev *,unsigned int old_selector,unsigned int new_selector); 21 int (* get_status) (struct regulator_dev *); 22 unsigned int (* get_optimum_mode) (struct regulator_dev *, int input_uV,int output_uV, int load_uA); 23 int (* set_load) (struct regulator_dev *, int load_uA); 24 int (* set_bypass) (struct regulator_dev *dev, bool enable); 25 int (* get_bypass) (struct regulator_dev *dev, bool *enable); 26 int (* set_suspend_voltage) (struct regulator_dev *, int uV); 27 int (* set_suspend_enable) (struct regulator_dev *); 28 int (* set_suspend_disable) (struct regulator_dev *); 29 int (* set_suspend_mode) (struct regulator_dev *, unsigned int mode); 30}; </pre></div><div class="refsect1"><a name="idp1124841292"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">list_voltage</span></dt><dd><p> 31 Return one of the supported voltages, in microvolts; zero 32 if the selector indicates a voltage that is unusable on this system; 33 or negative errno. Selectors range from zero to one less than 34 regulator_desc.n_voltages. Voltages may be reported in any order. 35 </p></dd><dt><span class="term">set_voltage</span></dt><dd><p> 36 Set the voltage for the regulator within the range specified. 37 The driver should select the voltage closest to min_uV. 38 </p></dd><dt><span class="term">map_voltage</span></dt><dd><p> 39 Convert a voltage into a selector 40 </p></dd><dt><span class="term">set_voltage_sel</span></dt><dd><p> 41 Set the voltage for the regulator using the specified 42 selector. 43 </p></dd><dt><span class="term">get_voltage</span></dt><dd><p> 44 Return the currently configured voltage for the regulator. 45 </p></dd><dt><span class="term">get_voltage_sel</span></dt><dd><p> 46 Return the currently configured voltage selector for the 47 regulator. 48 </p></dd><dt><span class="term">set_current_limit</span></dt><dd><p> 49 Configure a limit for a current-limited regulator. 50 The driver should select the current closest to max_uA. 51 </p></dd><dt><span class="term">get_current_limit</span></dt><dd><p> 52 Get the configured limit for a current-limited regulator. 53 </p></dd><dt><span class="term">enable</span></dt><dd><p> 54 Configure the regulator as enabled. 55 </p></dd><dt><span class="term">disable</span></dt><dd><p> 56 Configure the regulator as disabled. 57 </p></dd><dt><span class="term">is_enabled</span></dt><dd><p> 58 Return 1 if the regulator is enabled, 0 if not. 59 May also return negative errno. 60 </p></dd><dt><span class="term">set_mode</span></dt><dd><p> 61 Set the configured operating mode for the regulator. 62 </p></dd><dt><span class="term">get_mode</span></dt><dd><p> 63 Get the configured operating mode for the regulator. 64 </p></dd><dt><span class="term">enable_time</span></dt><dd><p> 65 Time taken for the regulator voltage output voltage to 66 stabilise after being enabled, in microseconds. 67 </p></dd><dt><span class="term">set_ramp_delay</span></dt><dd><p> 68 Set the ramp delay for the regulator. The driver should 69 select ramp delay equal to or less than(closest) ramp_delay. 70 </p></dd><dt><span class="term">set_voltage_time_sel</span></dt><dd><p> 71 Time taken for the regulator voltage output voltage 72 to stabilise after being set to a new value, in microseconds. 73 The function provides the from and to voltage selector, the 74 function should return the worst case. 75 </p></dd><dt><span class="term">get_status</span></dt><dd><p> 76 Return actual (not as-configured) status of regulator, as a 77 REGULATOR_STATUS value (or negative errno) 78 </p></dd><dt><span class="term">get_optimum_mode</span></dt><dd><p> 79 Get the most efficient operating mode for the regulator 80 when running with the specified parameters. 81 </p></dd><dt><span class="term">set_load</span></dt><dd><p> 82 Set the load for the regulator. 83 </p></dd><dt><span class="term">set_bypass</span></dt><dd><p> 84 Set the regulator in bypass mode. 85 </p></dd><dt><span class="term">get_bypass</span></dt><dd><p> 86 Get the regulator bypass mode state. 87 </p></dd><dt><span class="term">set_suspend_voltage</span></dt><dd><p> 88 Set the voltage for the regulator when the system 89 is suspended. 90 </p></dd><dt><span class="term">set_suspend_enable</span></dt><dd><p> 91 Mark the regulator as enabled when the system is 92 suspended. 93 </p></dd><dt><span class="term">set_suspend_disable</span></dt><dd><p> 94 Mark the regulator as disabled when the system is 95 suspended. 96 </p></dd><dt><span class="term">set_suspend_mode</span></dt><dd><p> 97 Set the operating mode for the regulator when the 98 system is suspended. 99 </p></dd></dl></div></div><div class="refsect1"><a name="idp1124860428"></a><h2>Description</h2><p> 100 This struct describes regulator operations which can be implemented by 101 regulator chip drivers. 102</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-struct-regulator-linear-range.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="api.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-struct-regulator-desc.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">struct regulator_linear_range</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">struct regulator_desc</span></td></tr></table></div></body></html> 103