Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) ===================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) Regulator Consumer Driver Interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) ===================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) This text describes the regulator interface for consumer device drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) Please see overview.txt for a description of the terms used in this text.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) 1. Consumer Regulator Access (static & dynamic drivers)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) =======================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) A consumer driver can get access to its supply regulator by calling ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 	regulator = regulator_get(dev, "Vcc");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16) The consumer passes in its struct device pointer and power supply ID. The core
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17) then finds the correct regulator by consulting a machine specific lookup table.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) If the lookup is successful then this call will return a pointer to the struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) regulator that supplies this consumer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) To release the regulator the consumer driver should call ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 	regulator_put(regulator);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) Consumers can be supplied by more than one regulator e.g. codec consumer with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) analog and digital supplies ::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 	digital = regulator_get(dev, "Vcc");  /* digital core */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 	analog = regulator_get(dev, "Avdd");  /* analog */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) The regulator access functions regulator_get() and regulator_put() will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) usually be called in your device drivers probe() and remove() respectively.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 2. Regulator Output Enable & Disable (static & dynamic drivers)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) ===============================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) A consumer can enable its power supply by calling::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 	int regulator_enable(regulator);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) NOTE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44)   The supply may already be enabled before regulator_enabled() is called.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45)   This may happen if the consumer shares the regulator or the regulator has been
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46)   previously enabled by bootloader or kernel board initialization code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) A consumer can determine if a regulator is enabled by calling::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	int regulator_is_enabled(regulator);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) This will return > zero when the regulator is enabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) A consumer can disable its supply when no longer needed by calling::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) 	int regulator_disable(regulator);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) NOTE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60)   This may not disable the supply if it's shared with other consumers. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61)   regulator will only be disabled when the enabled reference count is zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) Finally, a regulator can be forcefully disabled in the case of an emergency::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	int regulator_force_disable(regulator);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) NOTE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)   this will immediately and forcefully shutdown the regulator output. All
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69)   consumers will be powered off.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 3. Regulator Voltage Control & Status (dynamic drivers)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) =======================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) Some consumer drivers need to be able to dynamically change their supply
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) voltage to match system operating points. e.g. CPUfreq drivers can scale
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) voltage along with frequency to save power, SD drivers may need to select the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) correct card voltage, etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) Consumers can control their supply voltage by calling::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	int regulator_set_voltage(regulator, min_uV, max_uV);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) Where min_uV and max_uV are the minimum and maximum acceptable voltages in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) microvolts.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) NOTE: this can be called when the regulator is enabled or disabled. If called
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) when enabled, then the voltage changes instantly, otherwise the voltage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) configuration changes and the voltage is physically set when the regulator is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) next enabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) The regulators configured voltage output can be found by calling::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	int regulator_get_voltage(regulator);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) NOTE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)   get_voltage() will return the configured output voltage whether the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)   regulator is enabled or disabled and should NOT be used to determine regulator
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)   output state. However this can be used in conjunction with is_enabled() to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)   determine the regulator physical output voltage.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 4. Regulator Current Limit Control & Status (dynamic drivers)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) =============================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) Some consumer drivers need to be able to dynamically change their supply
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) current limit to match system operating points. e.g. LCD backlight driver can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) change the current limit to vary the backlight brightness, USB drivers may want
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) to set the limit to 500mA when supplying power.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) Consumers can control their supply current limit by calling::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 	int regulator_set_current_limit(regulator, min_uA, max_uA);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) Where min_uA and max_uA are the minimum and maximum acceptable current limit in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) microamps.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) NOTE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)   this can be called when the regulator is enabled or disabled. If called
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)   when enabled, then the current limit changes instantly, otherwise the current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)   limit configuration changes and the current limit is physically set when the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)   regulator is next enabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) A regulators current limit can be found by calling::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 	int regulator_get_current_limit(regulator);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) NOTE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)   get_current_limit() will return the current limit whether the regulator
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)   is enabled or disabled and should not be used to determine regulator current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)   load.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) 5. Regulator Operating Mode Control & Status (dynamic drivers)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) ==============================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) Some consumers can further save system power by changing the operating mode of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) their supply regulator to be more efficient when the consumers operating state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) changes. e.g. consumer driver is idle and subsequently draws less current
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) Regulator operating mode can be changed indirectly or directly.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) Indirect operating mode control.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) --------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) Consumer drivers can request a change in their supply regulator operating mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) by calling::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	int regulator_set_load(struct regulator *regulator, int load_uA);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) This will cause the core to recalculate the total load on the regulator (based
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) on all its consumers) and change operating mode (if necessary and permitted)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) to best match the current operating load.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) The load_uA value can be determined from the consumer's datasheet. e.g. most
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) datasheets have tables showing the maximum current consumed in certain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) situations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) Most consumers will use indirect operating mode control since they have no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) knowledge of the regulator or whether the regulator is shared with other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) consumers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) Direct operating mode control.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) ------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) Bespoke or tightly coupled drivers may want to directly control regulator
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) operating mode depending on their operating point. This can be achieved by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) calling::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 	int regulator_set_mode(struct regulator *regulator, unsigned int mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) 	unsigned int regulator_get_mode(struct regulator *regulator);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) Direct mode will only be used by consumers that *know* about the regulator and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) are not sharing the regulator with other consumers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 6. Regulator Events
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) ===================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) Regulators can notify consumers of external events. Events could be received by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) consumers under regulator stress or failure conditions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) Consumers can register interest in regulator events by calling::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	int regulator_register_notifier(struct regulator *regulator,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 					struct notifier_block *nb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) Consumers can unregister interest by calling::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	int regulator_unregister_notifier(struct regulator *regulator,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 					  struct notifier_block *nb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) Regulators use the kernel notifier framework to send event to their interested
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) consumers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 7. Regulator Direct Register Access
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) ===================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) Some kinds of power management hardware or firmware are designed such that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) they need to do low-level hardware access to regulators, with no involvement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) from the kernel. Examples of such devices are:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) - clocksource with a voltage-controlled oscillator and control logic to change
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)   the supply voltage over I2C to achieve a desired output clock rate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) - thermal management firmware that can issue an arbitrary I2C transaction to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)   perform system poweroff during overtemperature conditions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) To set up such a device/firmware, various parameters like I2C address of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) regulator, addresses of various regulator registers etc. need to be configured
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) to it. The regulator framework provides the following helpers for querying
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) these details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) Bus-specific details, like I2C addresses or transfer rates are handled by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) regmap framework. To get the regulator's regmap (if supported), use::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 	struct regmap *regulator_get_regmap(struct regulator *regulator);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) To obtain the hardware register offset and bitmask for the regulator's voltage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) selector register, use::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 	int regulator_get_hardware_vsel_register(struct regulator *regulator,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 						 unsigned *vsel_reg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 						 unsigned *vsel_mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) To convert a regulator framework voltage selector code (used by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) regulator_list_voltage) to a hardware-specific voltage selector that can be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) directly written to the voltage selector register, use::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 	int regulator_list_hardware_vsel(struct regulator *regulator,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 					 unsigned selector);