1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><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 (* set_input_current_limit) (struct regulator_dev *, int lim_uA);
14  int (* enable) (struct regulator_dev *);
15  int (* disable) (struct regulator_dev *);
16  int (* is_enabled) (struct regulator_dev *);
17  int (* set_mode) (struct regulator_dev *, unsigned int mode);
18  unsigned int (* get_mode) (struct regulator_dev *);
19  int (* enable_time) (struct regulator_dev *);
20  int (* set_ramp_delay) (struct regulator_dev *, int ramp_delay);
21  int (* set_voltage_time_sel) (struct regulator_dev *,unsigned int old_selector,unsigned int new_selector);
22  int (* set_soft_start) (struct regulator_dev *);
23  int (* get_status) (struct regulator_dev *);
24  unsigned int (* get_optimum_mode) (struct regulator_dev *, int input_uV,int output_uV, int load_uA);
25  int (* set_load) (struct regulator_dev *, int load_uA);
26  int (* set_bypass) (struct regulator_dev *dev, bool enable);
27  int (* get_bypass) (struct regulator_dev *dev, bool *enable);
28  int (* set_suspend_voltage) (struct regulator_dev *, int uV);
29  int (* set_suspend_enable) (struct regulator_dev *);
30  int (* set_suspend_disable) (struct regulator_dev *);
31  int (* set_suspend_mode) (struct regulator_dev *, unsigned int mode);
32  int (* set_pull_down) (struct regulator_dev *);
33};  </pre></div><div class="refsect1"><a name="id-1.7.10.5"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">list_voltage</span></dt><dd><p>
34   Return one of the supported voltages, in microvolts; zero
35   if the selector indicates a voltage that is unusable on this system;
36   or negative errno.  Selectors range from zero to one less than
37   regulator_desc.n_voltages.  Voltages may be reported in any order.
38      </p></dd><dt><span class="term">set_voltage</span></dt><dd><p>
39   Set the voltage for the regulator within the range specified.
40   The driver should select the voltage closest to min_uV.
41      </p></dd><dt><span class="term">map_voltage</span></dt><dd><p>
42   Convert a voltage into a selector
43      </p></dd><dt><span class="term">set_voltage_sel</span></dt><dd><p>
44   Set the voltage for the regulator using the specified
45   selector.
46      </p></dd><dt><span class="term">get_voltage</span></dt><dd><p>
47   Return the currently configured voltage for the regulator.
48      </p></dd><dt><span class="term">get_voltage_sel</span></dt><dd><p>
49   Return the currently configured voltage selector for the
50   regulator.
51      </p></dd><dt><span class="term">set_current_limit</span></dt><dd><p>
52   Configure a limit for a current-limited regulator.
53   The driver should select the current closest to max_uA.
54      </p></dd><dt><span class="term">get_current_limit</span></dt><dd><p>
55   Get the configured limit for a current-limited regulator.
56      </p></dd><dt><span class="term">set_input_current_limit</span></dt><dd><p>
57   Configure an input limit.
58      </p></dd><dt><span class="term">enable</span></dt><dd><p>
59   Configure the regulator as enabled.
60      </p></dd><dt><span class="term">disable</span></dt><dd><p>
61   Configure the regulator as disabled.
62      </p></dd><dt><span class="term">is_enabled</span></dt><dd><p>
63   Return 1 if the regulator is enabled, 0 if not.
64   May also return negative errno.
65      </p></dd><dt><span class="term">set_mode</span></dt><dd><p>
66   Set the configured operating mode for the regulator.
67      </p></dd><dt><span class="term">get_mode</span></dt><dd><p>
68   Get the configured operating mode for the regulator.
69      </p></dd><dt><span class="term">enable_time</span></dt><dd><p>
70   Time taken for the regulator voltage output voltage to
71   stabilise after being enabled, in microseconds.
72      </p></dd><dt><span class="term">set_ramp_delay</span></dt><dd><p>
73   Set the ramp delay for the regulator. The driver should
74   select ramp delay equal to or less than(closest) ramp_delay.
75      </p></dd><dt><span class="term">set_voltage_time_sel</span></dt><dd><p>
76   Time taken for the regulator voltage output voltage
77   to stabilise after being set to a new value, in microseconds.
78   The function provides the from and to voltage selector, the
79   function should return the worst case.
80      </p></dd><dt><span class="term">set_soft_start</span></dt><dd><p>
81   Enable soft start for the regulator.
82      </p></dd><dt><span class="term">get_status</span></dt><dd><p>
83   Return actual (not as-configured) status of regulator, as a
84   REGULATOR_STATUS value (or negative errno)
85      </p></dd><dt><span class="term">get_optimum_mode</span></dt><dd><p>
86   Get the most efficient operating mode for the regulator
87   when running with the specified parameters.
88      </p></dd><dt><span class="term">set_load</span></dt><dd><p>
89   Set the load for the regulator.
90      </p></dd><dt><span class="term">set_bypass</span></dt><dd><p>
91   Set the regulator in bypass mode.
92      </p></dd><dt><span class="term">get_bypass</span></dt><dd><p>
93   Get the regulator bypass mode state.
94      </p></dd><dt><span class="term">set_suspend_voltage</span></dt><dd><p>
95   Set the voltage for the regulator when the system
96   is suspended.
97      </p></dd><dt><span class="term">set_suspend_enable</span></dt><dd><p>
98   Mark the regulator as enabled when the system is
99   suspended.
100      </p></dd><dt><span class="term">set_suspend_disable</span></dt><dd><p>
101   Mark the regulator as disabled when the system is
102   suspended.
103      </p></dd><dt><span class="term">set_suspend_mode</span></dt><dd><p>
104   Set the operating mode for the regulator when the
105   system is suspended.
106      </p></dd><dt><span class="term">set_pull_down</span></dt><dd><p>
107   Configure the regulator to pull down when the regulator
108   is disabled.
109      </p></dd></dl></div></div><div class="refsect1"><a name="id-1.7.10.6"></a><h2>Description</h2><p>
110   This struct describes regulator operations which can be implemented by
111   regulator chip drivers.
112</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>
113