drivers/regulator/qcom-rpmh-regulator.c
Source file repositories/reference/linux-study-clean/drivers/regulator/qcom-rpmh-regulator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/regulator/qcom-rpmh-regulator.c- Extension
.c- Size
- 76477 bytes
- Lines
- 2011
- Domain
- Driver Families
- Bucket
- drivers/regulator
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hlinux/kernel.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/slab.hlinux/string.hlinux/regulator/driver.hlinux/regulator/machine.hlinux/regulator/of_regulator.hsoc/qcom/cmd-db.hsoc/qcom/rpmh.hdt-bindings/regulator/qcom,rpmh-regulator.h
Detected Declarations
struct resource_name_formatsstruct rpmh_vreg_hw_datastruct rpmh_vregstruct rpmh_vreg_init_dataenum rpmh_regulator_typeenum regulator_hw_typefunction rpmh_regulator_send_requestfunction _rpmh_regulator_vrm_set_voltage_selfunction rpmh_regulator_vrm_set_voltage_selfunction rpmh_regulator_vrm_get_voltage_selfunction rpmh_regulator_is_enabledfunction rpmh_regulator_set_enable_statefunction rpmh_regulator_enablefunction rpmh_regulator_disablefunction rpmh_regulator_vrm_set_mode_bypassfunction rpmh_regulator_vrm_set_modefunction rpmh_regulator_vrm_get_modefunction rpmh_regulator_vrm_get_optimum_modefunction rpmh_regulator_vrm_set_bypassfunction rpmh_regulator_vrm_get_bypassfunction rpmh_regulator_init_vregfunction rpmh_regulator_pmic4_ldo_of_map_modefunction rpmh_regulator_pmic530_ldo_of_map_modefunction rpmh_regulator_pmic4_smps_of_map_modefunction rpmh_regulator_pmic4_bob_of_map_modefunction rpmh_regulator_probefunction for_each_available_child_of_node_scoped
Annotated Snippet
struct resource_name_formats {
const char *rsc_name_fmt;
const char *rsc_name_fmt1;
};
static const struct resource_name_formats vreg_rsc_name_lookup[NUM_REGULATOR_TYPES] = {
[SMPS] = {"S%d%s", "smp%s%d"},
[LDO] = {"L%d%s", "ldo%s%d"},
[BOB] = {"B%d%s", "bob%s%d"},
[VS] = {"VS%d%s", "vs%s%d"},
};
#define RPMH_REGULATOR_REG_VRM_VOLTAGE 0x0
#define RPMH_REGULATOR_REG_ENABLE 0x4
#define RPMH_REGULATOR_REG_VRM_MODE 0x8
#define PMIC4_LDO_MODE_RETENTION 4
#define PMIC4_LDO_MODE_LPM 5
#define PMIC4_LDO_MODE_HPM 7
#define PMIC4_SMPS_MODE_RETENTION 4
#define PMIC4_SMPS_MODE_PFM 5
#define PMIC4_SMPS_MODE_AUTO 6
#define PMIC4_SMPS_MODE_PWM 7
#define PMIC4_BOB_MODE_PASS 0
#define PMIC4_BOB_MODE_PFM 1
#define PMIC4_BOB_MODE_AUTO 2
#define PMIC4_BOB_MODE_PWM 3
#define PMIC5_LDO_MODE_RETENTION 3
#define PMIC5_LDO_MODE_LPM 4
#define PMIC5_LDO_MODE_HPM 7
#define PMIC5_SMPS_MODE_RETENTION 3
#define PMIC5_SMPS_MODE_PFM 4
#define PMIC5_SMPS_MODE_AUTO 6
#define PMIC5_SMPS_MODE_PWM 7
#define PMIC5_BOB_MODE_PASS 2
#define PMIC5_BOB_MODE_PFM 4
#define PMIC5_BOB_MODE_AUTO 6
#define PMIC5_BOB_MODE_PWM 7
#define PMIC530_LDO_MODE_RETENTION 3
#define PMIC530_LDO_MODE_LPM 4
#define PMIC530_LDO_MODE_OPM 5
#define PMIC530_LDO_MODE_HPM 7
#define PMIC_ID_LEN 4
/**
* struct rpmh_vreg_hw_data - RPMh regulator hardware configurations
* @regulator_type: RPMh accelerator type used to manage this
* regulator
* @ops: Pointer to regulator ops callback structure
* @voltage_ranges: The possible ranges of voltages supported by this
* PMIC regulator type
* @n_linear_ranges: Number of entries in voltage_ranges
* @n_voltages: The number of unique voltage set points defined
* by voltage_ranges
* @hpm_min_load_uA: Minimum load current in microamps that requires
* high power mode (HPM) operation. This is used
* for LDO hardware type regulators only.
* @pmic_mode_map: Array indexed by regulator framework mode
* containing PMIC hardware modes. Must be large
* enough to index all framework modes supported
* by this regulator hardware type.
* @of_map_mode: Maps an RPMH_REGULATOR_MODE_* mode value defined
* in device tree to a regulator framework mode
*/
struct rpmh_vreg_hw_data {
enum rpmh_regulator_type regulator_type;
const struct regulator_ops *ops;
const struct linear_range *voltage_ranges;
int n_linear_ranges;
int n_voltages;
int hpm_min_load_uA;
const int *pmic_mode_map;
unsigned int (*of_map_mode)(unsigned int mode);
};
/**
* struct rpmh_vreg - individual RPMh regulator data structure encapsulating a
* single regulator device
* @dev: Device pointer for the top-level PMIC RPMh
* regulator parent device. This is used as a
* handle in RPMh write requests.
* @addr: Base address of the regulator resource within
* an RPMh accelerator
* @rdesc: Regulator descriptor
Annotation
- Immediate include surface: `linux/err.h`, `linux/kernel.h`, `linux/module.h`, `linux/of.h`, `linux/platform_device.h`, `linux/slab.h`, `linux/string.h`, `linux/regulator/driver.h`.
- Detected declarations: `struct resource_name_formats`, `struct rpmh_vreg_hw_data`, `struct rpmh_vreg`, `struct rpmh_vreg_init_data`, `enum rpmh_regulator_type`, `enum regulator_hw_type`, `function rpmh_regulator_send_request`, `function _rpmh_regulator_vrm_set_voltage_sel`, `function rpmh_regulator_vrm_set_voltage_sel`, `function rpmh_regulator_vrm_get_voltage_sel`.
- Atlas domain: Driver Families / drivers/regulator.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.