Lines Matching +full:regulator +full:- +full:allow +full:- +full:bypass
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * driver.h -- SoC Regulator driver support.
9 * Regulator Driver Interface.
18 #include <linux/regulator/consumer.h>
37 /* The regulator is enabled but not regulating */
57 * struct regulator_ops - regulator operations.
59 * @enable: Configure the regulator as enabled.
60 * @disable: Configure the regulator as disabled.
61 * @is_enabled: Return 1 if the regulator is enabled, 0 if not.
64 * @set_voltage: Set the voltage for the regulator within the range specified.
66 * @set_voltage_sel: Set the voltage for the regulator using the specified
69 * @get_voltage: Return the currently configured voltage for the regulator;
70 * return -ENOTRECOVERABLE if regulator can't be read at
73 * regulator; return -ENOTRECOVERABLE if regulator can't
80 * @set_current_limit: Configure a limit for a current-limited regulator.
82 * @get_current_limit: Get the configured limit for a current-limited regulator.
89 * - REGULATOR_SEVERITY_PROT should automatically shut down the regulator(s).
91 * - REGULATOR_SEVERITY_ERR should indicate that over-current situation is
95 * - REGULATOR_SEVERITY_WARN should indicate situation where hardware is
113 * @set_mode: Set the configured operating mode for the regulator.
114 * @get_mode: Get the configured operating mode for the regulator.
115 * @get_error_flags: Get the current error(s) for the regulator.
116 * @get_status: Return actual (not as-configured) status of regulator, as a
118 * @get_optimum_mode: Get the most efficient operating mode for the regulator
120 * @set_load: Set the load for the regulator.
122 * @set_bypass: Set the regulator in bypass mode.
123 * @get_bypass: Get the regulator bypass mode state.
125 * @enable_time: Time taken for the regulator voltage output voltage to
127 * @set_ramp_delay: Set the ramp delay for the regulator. The driver should
129 * @set_voltage_time: Time taken for the regulator voltage output voltage
133 * @set_voltage_time_sel: Time taken for the regulator voltage output voltage
137 * @set_soft_start: Enable soft start for the regulator.
139 * @set_suspend_voltage: Set the voltage for the regulator when the system
141 * @set_suspend_enable: Mark the regulator as enabled when the system is
143 * @set_suspend_disable: Mark the regulator as disabled when the system is
145 * @set_suspend_mode: Set the operating mode for the regulator when the
147 * @resume: Resume operation of suspended regulator.
148 * @set_pull_down: Configure the regulator to pull down when the regulator
151 * This struct describes regulator operations which can be implemented by
152 * regulator chip drivers.
159 /* get/set regulator voltage */
167 /* get/set regulator current */
183 /* enable/disable regulator */
188 /* get/set regulator operating mode (defined in consumer.h) */
192 /* retrieve current error flags on the regulator */
195 /* Time taken to enable or set voltage on the regulator */
206 /* report regulator status ... most other accessors report
213 /* get most efficient regulator operating mode for load */
216 /* set the load on the regulator */
219 /* control and report on bypass mode */
223 /* the operations below are for configuration of regulator state when
226 /* set regulator suspend voltage */
229 /* enable/disable regulator in suspend state */
233 /* set regulator suspend operating mode (defined in consumer.h) */
250 * struct regulator_desc - Static regulator descriptor
252 * Each regulator registered with the core is described with a
254 * structure contains the non-varying parts of the regulator
257 * @name: Identifying name for the regulator.
258 * @supply_name: Identifying the regulator supply
259 * @of_match: Name used to identify regulator in DT.
262 * @regulators_node: Name of node containing regulator definitions in DT.
264 * Will be called for each regulator parsed from DT, during
272 * @id: Numerical identifier for the regulator.
273 * @ops: Regulator operations table.
274 * @irq: Interrupt number for the regulator.
275 * @type: Indicates if the regulator is a voltage or current regulator.
276 * @owner: Module providing the regulator, used for refcounting.
278 * @continuous_voltage_range: Indicates if the regulator can set any
288 * @min_dropout_uV: The minimum dropout voltage this regulator can handle
308 * set directly), if >0 then the regulator API will ramp the
344 * @ramp_reg: Register for controlling the regulator ramp-rate.
345 * @ramp_mask: Bitmask for the ramp-rate control register.
346 * @ramp_delay_table: Table for mapping the regulator ramp-rate values. Values
351 * @enable_time: Time taken for initial enable of regulator (in uS).
352 * @off_on_delay: guard time (in uS), before re-enabling a regulator
355 * the regulator was actually enabled. Max upto enable_time.
436 * struct regulator_config - Dynamic regulator descriptor
438 * Each regulator registered with the core is described with a
440 * contains the runtime variable parts of the regulator description.
442 * @dev: struct device for the regulator
444 * @driver_data: private regulator data
449 * @ena_gpiod: GPIO controlling regulator enable.
462 * struct regulator_err_state - regulator error/notification status
464 * @rdev: Regulator which status the struct indicates.
465 * @notifs: Events which have occurred on the regulator.
466 * @errors: Errors which are active on the regulator.
477 * struct regulator_irq_data - regulator error/notification status data
487 * REGULATOR_ERROR_ON to allow IRQ fire again and to generate
491 * reporting regulator status to core.
501 * struct regulator_irq_desc - notification sender for IRQ based events.
505 * best to shut-down regulator(s) or reboot the SOC if error
511 * @reread_ms: The time which is waited before attempting to re-read status
512 * at the worker if IC reading fails. Immediate re-read is done
514 * @irq_off_ms: The time which IRQ is kept disabled before re-evaluating the
528 * attempt like disabling the regulator. If protection succeeded
532 * @map_event: Driver callback to map IRQ status into regulator devices with
538 * fatal_cnt times the core will call die() callback or power-off
541 * re-enabling IRQ. If implemented this should clear the error
544 * assumed to be cleared and IRQ is re-enabled.
548 * callback or if die() is not populated then attempt to power-off
551 * and IRQ will be re-enabled. Returning REGULATOR_ERROR_ON
556 * zero and allow IRQ to retrigger causing events to be
557 * re-evaluated and re-sent.
559 * This structure is used for registering regulator IRQ notification helper.
577 * Return values for regulator IRQ helpers.
588 * Describes coupling of regulators. Each regulator should have
590 * When a new coupled regulator is resolved, n_resolved is
603 * Voltage / Current regulator class device. One for each
604 * regulator.
606 * This should *not* be used directly by anything except the regulator
632 struct regulator *supply; /* for tree */
647 /* time when this regulator was disabled last time */
766 * Helper functions intended to be used by regulator drivers prior registering