Lines Matching +full:regulator +full:- +full:active +full:- +full:discharge
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 */
62 * struct regulator_ops - regulator operations.
64 * @enable: Configure the regulator as enabled.
65 * @disable: Configure the regulator as disabled.
66 * @is_enabled: Return 1 if the regulator is enabled, 0 if not.
69 * @set_voltage: Set the voltage for the regulator within the range specified.
71 * @set_voltage_sel: Set the voltage for the regulator using the specified
74 * @get_voltage: Return the currently configured voltage for the regulator;
75 * return -ENOTRECOVERABLE if regulator can't be read at
78 * regulator; return -ENOTRECOVERABLE if regulator can't
85 * @set_current_limit: Configure a limit for a current-limited regulator.
87 * @get_current_limit: Get the configured limit for a current-limited regulator.
94 * - REGULATOR_SEVERITY_PROT should automatically shut down the regulator(s).
96 * - REGULATOR_SEVERITY_ERR should indicate that over-current situation is
100 * - REGULATOR_SEVERITY_WARN should indicate situation where hardware is
116 * @set_active_discharge: Set active discharge enable/disable of regulators.
118 * @set_mode: Set the configured operating mode for the regulator.
119 * @get_mode: Get the configured operating mode for the regulator.
120 * @get_error_flags: Get the current error(s) for the regulator.
121 * @get_status: Return actual (not as-configured) status of regulator, as a
123 * @get_optimum_mode: Get the most efficient operating mode for the regulator
125 * @set_load: Set the load for the regulator.
127 * @set_bypass: Set the regulator in bypass mode.
128 * @get_bypass: Get the regulator bypass mode state.
130 * @enable_time: Time taken for the regulator voltage output voltage to
132 * @set_ramp_delay: Set the ramp delay for the regulator. The driver should
134 * @set_voltage_time: Time taken for the regulator voltage output voltage
138 * @set_voltage_time_sel: Time taken for the regulator voltage output voltage
142 * @set_soft_start: Enable soft start for the regulator.
144 * @set_suspend_voltage: Set the voltage for the regulator when the system
146 * @set_suspend_enable: Mark the regulator as enabled when the system is
148 * @set_suspend_disable: Mark the regulator as disabled when the system is
150 * @set_suspend_mode: Set the operating mode for the regulator when the
152 * @resume: Resume operation of suspended regulator.
153 * @set_pull_down: Configure the regulator to pull down when the regulator
156 * This struct describes regulator operations which can be implemented by
157 * regulator chip drivers.
164 /* get/set regulator voltage */
172 /* get/set regulator current */
188 /* enable/disable regulator */
193 /* get/set regulator operating mode (defined in consumer.h) */
197 /* retrieve current error flags on the regulator */
200 /* Time taken to enable or set voltage on the regulator */
211 /* report regulator status ... most other accessors report
218 /* get most efficient regulator operating mode for load */
221 /* set the load on the regulator */
228 /* the operations below are for configuration of regulator state when
231 /* set regulator suspend voltage */
234 /* enable/disable regulator in suspend state */
238 /* set regulator suspend operating mode (defined in consumer.h) */
255 * struct regulator_desc - Static regulator descriptor
257 * Each regulator registered with the core is described with a
259 * structure contains the non-varying parts of the regulator
262 * @name: Identifying name for the regulator.
263 * @supply_name: Identifying the regulator supply
264 * @of_match: Name used to identify regulator in DT.
267 * @regulators_node: Name of node containing regulator definitions in DT.
269 * Will be called for each regulator parsed from DT, during
277 * @id: Numerical identifier for the regulator.
278 * @ops: Regulator operations table.
279 * @irq: Interrupt number for the regulator.
280 * @type: Indicates if the regulator is a voltage or current regulator.
281 * @owner: Module providing the regulator, used for refcounting.
283 * @continuous_voltage_range: Indicates if the regulator can set any
293 * @min_dropout_uV: The minimum dropout voltage this regulator can handle
310 * set directly), if >0 then the regulator API will ramp the
346 * @ramp_reg: Register for controlling the regulator ramp-rate.
347 * @ramp_mask: Bitmask for the ramp-rate control register.
348 * @ramp_delay_table: Table for mapping the regulator ramp-rate values. Values
353 * @enable_time: Time taken for initial enable of regulator (in uS).
354 * @off_on_delay: guard time (in uS), before re-enabling a regulator
357 * the regulator was actually enabled. Max upto enable_time.
437 * struct regulator_config - Dynamic regulator descriptor
439 * Each regulator registered with the core is described with a
441 * contains the runtime variable parts of the regulator description.
443 * @dev: struct device for the regulator
445 * @driver_data: private regulator data
450 * @ena_gpiod: GPIO controlling regulator enable.
463 * struct regulator_err_state - regulator error/notification status
465 * @rdev: Regulator which status the struct indicates.
466 * @notifs: Events which have occurred on the regulator.
467 * @errors: Errors which are active on the regulator.
478 * struct regulator_irq_data - regulator error/notification status data
492 * reporting regulator status to core.
502 * struct regulator_irq_desc - notification sender for IRQ based events.
506 * best to shut-down regulator(s) or reboot the SOC if error
512 * @reread_ms: The time which is waited before attempting to re-read status
513 * at the worker if IC reading fails. Immediate re-read is done
515 * @irq_off_ms: The time which IRQ is kept disabled before re-evaluating the
529 * attempt like disabling the regulator. If protection succeeded
533 * @map_event: Driver callback to map IRQ status into regulator devices with
536 * active events as core does not clean the map data.
539 * fatal_cnt times the core will call die() callback or power-off
542 * re-enabling IRQ. If implemented this should clear the error
545 * assumed to be cleared and IRQ is re-enabled.
549 * callback or if die() is not populated then attempt to power-off
552 * and IRQ will be re-enabled. Returning REGULATOR_ERROR_ON
553 * indicates the error condition is still active and keeps IRQ
555 * not retrigger evaluating what events are active or resending
558 * re-evaluated and re-sent.
560 * This structure is used for registering regulator IRQ notification helper.
578 * Return values for regulator IRQ helpers.
589 * Describes coupling of regulators. Each regulator should have
591 * When a new coupled regulator is resolved, n_resolved is
604 * Voltage / Current regulator class device. One for each
605 * regulator.
607 * This should *not* be used directly by anything except the regulator
633 struct regulator *supply; /* for tree */
648 /* time when this regulator was disabled last time */
764 * Helper functions intended to be used by regulator drivers prior registering