162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0 262306a36Sopenharmony_ci// Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci#define pr_fmt(fmt) "%s: " fmt, __func__ 562306a36Sopenharmony_ci 662306a36Sopenharmony_ci#include <linux/err.h> 762306a36Sopenharmony_ci#include <linux/kernel.h> 862306a36Sopenharmony_ci#include <linux/module.h> 962306a36Sopenharmony_ci#include <linux/of.h> 1062306a36Sopenharmony_ci#include <linux/platform_device.h> 1162306a36Sopenharmony_ci#include <linux/slab.h> 1262306a36Sopenharmony_ci#include <linux/string.h> 1362306a36Sopenharmony_ci#include <linux/regulator/driver.h> 1462306a36Sopenharmony_ci#include <linux/regulator/machine.h> 1562306a36Sopenharmony_ci#include <linux/regulator/of_regulator.h> 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci#include <soc/qcom/cmd-db.h> 1862306a36Sopenharmony_ci#include <soc/qcom/rpmh.h> 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci#include <dt-bindings/regulator/qcom,rpmh-regulator.h> 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci/** 2362306a36Sopenharmony_ci * enum rpmh_regulator_type - supported RPMh accelerator types 2462306a36Sopenharmony_ci * @VRM: RPMh VRM accelerator which supports voting on enable, voltage, 2562306a36Sopenharmony_ci * and mode of LDO, SMPS, and BOB type PMIC regulators. 2662306a36Sopenharmony_ci * @XOB: RPMh XOB accelerator which supports voting on the enable state 2762306a36Sopenharmony_ci * of PMIC regulators. 2862306a36Sopenharmony_ci */ 2962306a36Sopenharmony_cienum rpmh_regulator_type { 3062306a36Sopenharmony_ci VRM, 3162306a36Sopenharmony_ci XOB, 3262306a36Sopenharmony_ci}; 3362306a36Sopenharmony_ci 3462306a36Sopenharmony_ci#define RPMH_REGULATOR_REG_VRM_VOLTAGE 0x0 3562306a36Sopenharmony_ci#define RPMH_REGULATOR_REG_ENABLE 0x4 3662306a36Sopenharmony_ci#define RPMH_REGULATOR_REG_VRM_MODE 0x8 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ci#define PMIC4_LDO_MODE_RETENTION 4 3962306a36Sopenharmony_ci#define PMIC4_LDO_MODE_LPM 5 4062306a36Sopenharmony_ci#define PMIC4_LDO_MODE_HPM 7 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_ci#define PMIC4_SMPS_MODE_RETENTION 4 4362306a36Sopenharmony_ci#define PMIC4_SMPS_MODE_PFM 5 4462306a36Sopenharmony_ci#define PMIC4_SMPS_MODE_AUTO 6 4562306a36Sopenharmony_ci#define PMIC4_SMPS_MODE_PWM 7 4662306a36Sopenharmony_ci 4762306a36Sopenharmony_ci#define PMIC4_BOB_MODE_PASS 0 4862306a36Sopenharmony_ci#define PMIC4_BOB_MODE_PFM 1 4962306a36Sopenharmony_ci#define PMIC4_BOB_MODE_AUTO 2 5062306a36Sopenharmony_ci#define PMIC4_BOB_MODE_PWM 3 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ci#define PMIC5_LDO_MODE_RETENTION 3 5362306a36Sopenharmony_ci#define PMIC5_LDO_MODE_LPM 4 5462306a36Sopenharmony_ci#define PMIC5_LDO_MODE_HPM 7 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ci#define PMIC5_SMPS_MODE_RETENTION 3 5762306a36Sopenharmony_ci#define PMIC5_SMPS_MODE_PFM 4 5862306a36Sopenharmony_ci#define PMIC5_SMPS_MODE_AUTO 6 5962306a36Sopenharmony_ci#define PMIC5_SMPS_MODE_PWM 7 6062306a36Sopenharmony_ci 6162306a36Sopenharmony_ci#define PMIC5_BOB_MODE_PASS 2 6262306a36Sopenharmony_ci#define PMIC5_BOB_MODE_PFM 4 6362306a36Sopenharmony_ci#define PMIC5_BOB_MODE_AUTO 6 6462306a36Sopenharmony_ci#define PMIC5_BOB_MODE_PWM 7 6562306a36Sopenharmony_ci 6662306a36Sopenharmony_ci/** 6762306a36Sopenharmony_ci * struct rpmh_vreg_hw_data - RPMh regulator hardware configurations 6862306a36Sopenharmony_ci * @regulator_type: RPMh accelerator type used to manage this 6962306a36Sopenharmony_ci * regulator 7062306a36Sopenharmony_ci * @ops: Pointer to regulator ops callback structure 7162306a36Sopenharmony_ci * @voltage_range: The single range of voltages supported by this 7262306a36Sopenharmony_ci * PMIC regulator type 7362306a36Sopenharmony_ci * @n_voltages: The number of unique voltage set points defined 7462306a36Sopenharmony_ci * by voltage_range 7562306a36Sopenharmony_ci * @hpm_min_load_uA: Minimum load current in microamps that requires 7662306a36Sopenharmony_ci * high power mode (HPM) operation. This is used 7762306a36Sopenharmony_ci * for LDO hardware type regulators only. 7862306a36Sopenharmony_ci * @pmic_mode_map: Array indexed by regulator framework mode 7962306a36Sopenharmony_ci * containing PMIC hardware modes. Must be large 8062306a36Sopenharmony_ci * enough to index all framework modes supported 8162306a36Sopenharmony_ci * by this regulator hardware type. 8262306a36Sopenharmony_ci * @of_map_mode: Maps an RPMH_REGULATOR_MODE_* mode value defined 8362306a36Sopenharmony_ci * in device tree to a regulator framework mode 8462306a36Sopenharmony_ci */ 8562306a36Sopenharmony_cistruct rpmh_vreg_hw_data { 8662306a36Sopenharmony_ci enum rpmh_regulator_type regulator_type; 8762306a36Sopenharmony_ci const struct regulator_ops *ops; 8862306a36Sopenharmony_ci const struct linear_range voltage_range; 8962306a36Sopenharmony_ci int n_voltages; 9062306a36Sopenharmony_ci int hpm_min_load_uA; 9162306a36Sopenharmony_ci const int *pmic_mode_map; 9262306a36Sopenharmony_ci unsigned int (*of_map_mode)(unsigned int mode); 9362306a36Sopenharmony_ci}; 9462306a36Sopenharmony_ci 9562306a36Sopenharmony_ci/** 9662306a36Sopenharmony_ci * struct rpmh_vreg - individual RPMh regulator data structure encapsulating a 9762306a36Sopenharmony_ci * single regulator device 9862306a36Sopenharmony_ci * @dev: Device pointer for the top-level PMIC RPMh 9962306a36Sopenharmony_ci * regulator parent device. This is used as a 10062306a36Sopenharmony_ci * handle in RPMh write requests. 10162306a36Sopenharmony_ci * @addr: Base address of the regulator resource within 10262306a36Sopenharmony_ci * an RPMh accelerator 10362306a36Sopenharmony_ci * @rdesc: Regulator descriptor 10462306a36Sopenharmony_ci * @hw_data: PMIC regulator configuration data for this RPMh 10562306a36Sopenharmony_ci * regulator 10662306a36Sopenharmony_ci * @always_wait_for_ack: Boolean flag indicating if a request must always 10762306a36Sopenharmony_ci * wait for an ACK from RPMh before continuing even 10862306a36Sopenharmony_ci * if it corresponds to a strictly lower power 10962306a36Sopenharmony_ci * state (e.g. enabled --> disabled). 11062306a36Sopenharmony_ci * @enabled: Flag indicating if the regulator is enabled or 11162306a36Sopenharmony_ci * not 11262306a36Sopenharmony_ci * @bypassed: Boolean indicating if the regulator is in 11362306a36Sopenharmony_ci * bypass (pass-through) mode or not. This is 11462306a36Sopenharmony_ci * only used by BOB rpmh-regulator resources. 11562306a36Sopenharmony_ci * @voltage_selector: Selector used for get_voltage_sel() and 11662306a36Sopenharmony_ci * set_voltage_sel() callbacks 11762306a36Sopenharmony_ci * @mode: RPMh VRM regulator current framework mode 11862306a36Sopenharmony_ci */ 11962306a36Sopenharmony_cistruct rpmh_vreg { 12062306a36Sopenharmony_ci struct device *dev; 12162306a36Sopenharmony_ci u32 addr; 12262306a36Sopenharmony_ci struct regulator_desc rdesc; 12362306a36Sopenharmony_ci const struct rpmh_vreg_hw_data *hw_data; 12462306a36Sopenharmony_ci bool always_wait_for_ack; 12562306a36Sopenharmony_ci 12662306a36Sopenharmony_ci int enabled; 12762306a36Sopenharmony_ci bool bypassed; 12862306a36Sopenharmony_ci int voltage_selector; 12962306a36Sopenharmony_ci unsigned int mode; 13062306a36Sopenharmony_ci}; 13162306a36Sopenharmony_ci 13262306a36Sopenharmony_ci/** 13362306a36Sopenharmony_ci * struct rpmh_vreg_init_data - initialization data for an RPMh regulator 13462306a36Sopenharmony_ci * @name: Name for the regulator which also corresponds 13562306a36Sopenharmony_ci * to the device tree subnode name of the regulator 13662306a36Sopenharmony_ci * @resource_name: RPMh regulator resource name format string. 13762306a36Sopenharmony_ci * This must include exactly one field: '%s' which 13862306a36Sopenharmony_ci * is filled at run-time with the PMIC ID provided 13962306a36Sopenharmony_ci * by device tree property qcom,pmic-id. Example: 14062306a36Sopenharmony_ci * "ldo%s1" for RPMh resource "ldoa1". 14162306a36Sopenharmony_ci * @supply_name: Parent supply regulator name 14262306a36Sopenharmony_ci * @hw_data: Configuration data for this PMIC regulator type 14362306a36Sopenharmony_ci */ 14462306a36Sopenharmony_cistruct rpmh_vreg_init_data { 14562306a36Sopenharmony_ci const char *name; 14662306a36Sopenharmony_ci const char *resource_name; 14762306a36Sopenharmony_ci const char *supply_name; 14862306a36Sopenharmony_ci const struct rpmh_vreg_hw_data *hw_data; 14962306a36Sopenharmony_ci}; 15062306a36Sopenharmony_ci 15162306a36Sopenharmony_ci/** 15262306a36Sopenharmony_ci * rpmh_regulator_send_request() - send the request to RPMh 15362306a36Sopenharmony_ci * @vreg: Pointer to the RPMh regulator 15462306a36Sopenharmony_ci * @cmd: Pointer to the RPMh command to send 15562306a36Sopenharmony_ci * @wait_for_ack: Boolean indicating if execution must wait until the 15662306a36Sopenharmony_ci * request has been acknowledged as complete 15762306a36Sopenharmony_ci * 15862306a36Sopenharmony_ci * Return: 0 on success, errno on failure 15962306a36Sopenharmony_ci */ 16062306a36Sopenharmony_cistatic int rpmh_regulator_send_request(struct rpmh_vreg *vreg, 16162306a36Sopenharmony_ci struct tcs_cmd *cmd, bool wait_for_ack) 16262306a36Sopenharmony_ci{ 16362306a36Sopenharmony_ci int ret; 16462306a36Sopenharmony_ci 16562306a36Sopenharmony_ci if (wait_for_ack || vreg->always_wait_for_ack) 16662306a36Sopenharmony_ci ret = rpmh_write(vreg->dev, RPMH_ACTIVE_ONLY_STATE, cmd, 1); 16762306a36Sopenharmony_ci else 16862306a36Sopenharmony_ci ret = rpmh_write_async(vreg->dev, RPMH_ACTIVE_ONLY_STATE, cmd, 16962306a36Sopenharmony_ci 1); 17062306a36Sopenharmony_ci 17162306a36Sopenharmony_ci return ret; 17262306a36Sopenharmony_ci} 17362306a36Sopenharmony_ci 17462306a36Sopenharmony_cistatic int _rpmh_regulator_vrm_set_voltage_sel(struct regulator_dev *rdev, 17562306a36Sopenharmony_ci unsigned int selector, bool wait_for_ack) 17662306a36Sopenharmony_ci{ 17762306a36Sopenharmony_ci struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); 17862306a36Sopenharmony_ci struct tcs_cmd cmd = { 17962306a36Sopenharmony_ci .addr = vreg->addr + RPMH_REGULATOR_REG_VRM_VOLTAGE, 18062306a36Sopenharmony_ci }; 18162306a36Sopenharmony_ci int ret; 18262306a36Sopenharmony_ci 18362306a36Sopenharmony_ci /* VRM voltage control register is set with voltage in millivolts. */ 18462306a36Sopenharmony_ci cmd.data = DIV_ROUND_UP(regulator_list_voltage_linear_range(rdev, 18562306a36Sopenharmony_ci selector), 1000); 18662306a36Sopenharmony_ci 18762306a36Sopenharmony_ci ret = rpmh_regulator_send_request(vreg, &cmd, wait_for_ack); 18862306a36Sopenharmony_ci if (!ret) 18962306a36Sopenharmony_ci vreg->voltage_selector = selector; 19062306a36Sopenharmony_ci 19162306a36Sopenharmony_ci return ret; 19262306a36Sopenharmony_ci} 19362306a36Sopenharmony_ci 19462306a36Sopenharmony_cistatic int rpmh_regulator_vrm_set_voltage_sel(struct regulator_dev *rdev, 19562306a36Sopenharmony_ci unsigned int selector) 19662306a36Sopenharmony_ci{ 19762306a36Sopenharmony_ci struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); 19862306a36Sopenharmony_ci 19962306a36Sopenharmony_ci if (vreg->enabled == -EINVAL) { 20062306a36Sopenharmony_ci /* 20162306a36Sopenharmony_ci * Cache the voltage and send it later when the regulator is 20262306a36Sopenharmony_ci * enabled or disabled. 20362306a36Sopenharmony_ci */ 20462306a36Sopenharmony_ci vreg->voltage_selector = selector; 20562306a36Sopenharmony_ci return 0; 20662306a36Sopenharmony_ci } 20762306a36Sopenharmony_ci 20862306a36Sopenharmony_ci return _rpmh_regulator_vrm_set_voltage_sel(rdev, selector, 20962306a36Sopenharmony_ci selector > vreg->voltage_selector); 21062306a36Sopenharmony_ci} 21162306a36Sopenharmony_ci 21262306a36Sopenharmony_cistatic int rpmh_regulator_vrm_get_voltage_sel(struct regulator_dev *rdev) 21362306a36Sopenharmony_ci{ 21462306a36Sopenharmony_ci struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); 21562306a36Sopenharmony_ci 21662306a36Sopenharmony_ci return vreg->voltage_selector; 21762306a36Sopenharmony_ci} 21862306a36Sopenharmony_ci 21962306a36Sopenharmony_cistatic int rpmh_regulator_is_enabled(struct regulator_dev *rdev) 22062306a36Sopenharmony_ci{ 22162306a36Sopenharmony_ci struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); 22262306a36Sopenharmony_ci 22362306a36Sopenharmony_ci return vreg->enabled; 22462306a36Sopenharmony_ci} 22562306a36Sopenharmony_ci 22662306a36Sopenharmony_cistatic int rpmh_regulator_set_enable_state(struct regulator_dev *rdev, 22762306a36Sopenharmony_ci bool enable) 22862306a36Sopenharmony_ci{ 22962306a36Sopenharmony_ci struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); 23062306a36Sopenharmony_ci struct tcs_cmd cmd = { 23162306a36Sopenharmony_ci .addr = vreg->addr + RPMH_REGULATOR_REG_ENABLE, 23262306a36Sopenharmony_ci .data = enable, 23362306a36Sopenharmony_ci }; 23462306a36Sopenharmony_ci int ret; 23562306a36Sopenharmony_ci 23662306a36Sopenharmony_ci if (vreg->enabled == -EINVAL && 23762306a36Sopenharmony_ci vreg->voltage_selector != -ENOTRECOVERABLE) { 23862306a36Sopenharmony_ci ret = _rpmh_regulator_vrm_set_voltage_sel(rdev, 23962306a36Sopenharmony_ci vreg->voltage_selector, true); 24062306a36Sopenharmony_ci if (ret < 0) 24162306a36Sopenharmony_ci return ret; 24262306a36Sopenharmony_ci } 24362306a36Sopenharmony_ci 24462306a36Sopenharmony_ci ret = rpmh_regulator_send_request(vreg, &cmd, enable); 24562306a36Sopenharmony_ci if (!ret) 24662306a36Sopenharmony_ci vreg->enabled = enable; 24762306a36Sopenharmony_ci 24862306a36Sopenharmony_ci return ret; 24962306a36Sopenharmony_ci} 25062306a36Sopenharmony_ci 25162306a36Sopenharmony_cistatic int rpmh_regulator_enable(struct regulator_dev *rdev) 25262306a36Sopenharmony_ci{ 25362306a36Sopenharmony_ci return rpmh_regulator_set_enable_state(rdev, true); 25462306a36Sopenharmony_ci} 25562306a36Sopenharmony_ci 25662306a36Sopenharmony_cistatic int rpmh_regulator_disable(struct regulator_dev *rdev) 25762306a36Sopenharmony_ci{ 25862306a36Sopenharmony_ci return rpmh_regulator_set_enable_state(rdev, false); 25962306a36Sopenharmony_ci} 26062306a36Sopenharmony_ci 26162306a36Sopenharmony_cistatic int rpmh_regulator_vrm_set_mode_bypass(struct rpmh_vreg *vreg, 26262306a36Sopenharmony_ci unsigned int mode, bool bypassed) 26362306a36Sopenharmony_ci{ 26462306a36Sopenharmony_ci struct tcs_cmd cmd = { 26562306a36Sopenharmony_ci .addr = vreg->addr + RPMH_REGULATOR_REG_VRM_MODE, 26662306a36Sopenharmony_ci }; 26762306a36Sopenharmony_ci int pmic_mode; 26862306a36Sopenharmony_ci 26962306a36Sopenharmony_ci if (mode > REGULATOR_MODE_STANDBY) 27062306a36Sopenharmony_ci return -EINVAL; 27162306a36Sopenharmony_ci 27262306a36Sopenharmony_ci pmic_mode = vreg->hw_data->pmic_mode_map[mode]; 27362306a36Sopenharmony_ci if (pmic_mode < 0) 27462306a36Sopenharmony_ci return pmic_mode; 27562306a36Sopenharmony_ci 27662306a36Sopenharmony_ci if (bypassed) 27762306a36Sopenharmony_ci cmd.data = PMIC4_BOB_MODE_PASS; 27862306a36Sopenharmony_ci else 27962306a36Sopenharmony_ci cmd.data = pmic_mode; 28062306a36Sopenharmony_ci 28162306a36Sopenharmony_ci return rpmh_regulator_send_request(vreg, &cmd, true); 28262306a36Sopenharmony_ci} 28362306a36Sopenharmony_ci 28462306a36Sopenharmony_cistatic int rpmh_regulator_vrm_set_mode(struct regulator_dev *rdev, 28562306a36Sopenharmony_ci unsigned int mode) 28662306a36Sopenharmony_ci{ 28762306a36Sopenharmony_ci struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); 28862306a36Sopenharmony_ci int ret; 28962306a36Sopenharmony_ci 29062306a36Sopenharmony_ci if (mode == vreg->mode) 29162306a36Sopenharmony_ci return 0; 29262306a36Sopenharmony_ci 29362306a36Sopenharmony_ci ret = rpmh_regulator_vrm_set_mode_bypass(vreg, mode, vreg->bypassed); 29462306a36Sopenharmony_ci if (!ret) 29562306a36Sopenharmony_ci vreg->mode = mode; 29662306a36Sopenharmony_ci 29762306a36Sopenharmony_ci return ret; 29862306a36Sopenharmony_ci} 29962306a36Sopenharmony_ci 30062306a36Sopenharmony_cistatic unsigned int rpmh_regulator_vrm_get_mode(struct regulator_dev *rdev) 30162306a36Sopenharmony_ci{ 30262306a36Sopenharmony_ci struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); 30362306a36Sopenharmony_ci 30462306a36Sopenharmony_ci return vreg->mode; 30562306a36Sopenharmony_ci} 30662306a36Sopenharmony_ci 30762306a36Sopenharmony_ci/** 30862306a36Sopenharmony_ci * rpmh_regulator_vrm_get_optimum_mode() - get the mode based on the load 30962306a36Sopenharmony_ci * @rdev: Regulator device pointer for the rpmh-regulator 31062306a36Sopenharmony_ci * @input_uV: Input voltage 31162306a36Sopenharmony_ci * @output_uV: Output voltage 31262306a36Sopenharmony_ci * @load_uA: Aggregated load current in microamps 31362306a36Sopenharmony_ci * 31462306a36Sopenharmony_ci * This function is used in the regulator_ops for VRM type RPMh regulator 31562306a36Sopenharmony_ci * devices. 31662306a36Sopenharmony_ci * 31762306a36Sopenharmony_ci * Return: 0 on success, errno on failure 31862306a36Sopenharmony_ci */ 31962306a36Sopenharmony_cistatic unsigned int rpmh_regulator_vrm_get_optimum_mode( 32062306a36Sopenharmony_ci struct regulator_dev *rdev, int input_uV, int output_uV, int load_uA) 32162306a36Sopenharmony_ci{ 32262306a36Sopenharmony_ci struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); 32362306a36Sopenharmony_ci 32462306a36Sopenharmony_ci if (load_uA >= vreg->hw_data->hpm_min_load_uA) 32562306a36Sopenharmony_ci return REGULATOR_MODE_NORMAL; 32662306a36Sopenharmony_ci else 32762306a36Sopenharmony_ci return REGULATOR_MODE_IDLE; 32862306a36Sopenharmony_ci} 32962306a36Sopenharmony_ci 33062306a36Sopenharmony_cistatic int rpmh_regulator_vrm_set_bypass(struct regulator_dev *rdev, 33162306a36Sopenharmony_ci bool enable) 33262306a36Sopenharmony_ci{ 33362306a36Sopenharmony_ci struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); 33462306a36Sopenharmony_ci int ret; 33562306a36Sopenharmony_ci 33662306a36Sopenharmony_ci if (vreg->bypassed == enable) 33762306a36Sopenharmony_ci return 0; 33862306a36Sopenharmony_ci 33962306a36Sopenharmony_ci ret = rpmh_regulator_vrm_set_mode_bypass(vreg, vreg->mode, enable); 34062306a36Sopenharmony_ci if (!ret) 34162306a36Sopenharmony_ci vreg->bypassed = enable; 34262306a36Sopenharmony_ci 34362306a36Sopenharmony_ci return ret; 34462306a36Sopenharmony_ci} 34562306a36Sopenharmony_ci 34662306a36Sopenharmony_cistatic int rpmh_regulator_vrm_get_bypass(struct regulator_dev *rdev, 34762306a36Sopenharmony_ci bool *enable) 34862306a36Sopenharmony_ci{ 34962306a36Sopenharmony_ci struct rpmh_vreg *vreg = rdev_get_drvdata(rdev); 35062306a36Sopenharmony_ci 35162306a36Sopenharmony_ci *enable = vreg->bypassed; 35262306a36Sopenharmony_ci 35362306a36Sopenharmony_ci return 0; 35462306a36Sopenharmony_ci} 35562306a36Sopenharmony_ci 35662306a36Sopenharmony_cistatic const struct regulator_ops rpmh_regulator_vrm_ops = { 35762306a36Sopenharmony_ci .enable = rpmh_regulator_enable, 35862306a36Sopenharmony_ci .disable = rpmh_regulator_disable, 35962306a36Sopenharmony_ci .is_enabled = rpmh_regulator_is_enabled, 36062306a36Sopenharmony_ci .set_voltage_sel = rpmh_regulator_vrm_set_voltage_sel, 36162306a36Sopenharmony_ci .get_voltage_sel = rpmh_regulator_vrm_get_voltage_sel, 36262306a36Sopenharmony_ci .list_voltage = regulator_list_voltage_linear_range, 36362306a36Sopenharmony_ci .set_mode = rpmh_regulator_vrm_set_mode, 36462306a36Sopenharmony_ci .get_mode = rpmh_regulator_vrm_get_mode, 36562306a36Sopenharmony_ci}; 36662306a36Sopenharmony_ci 36762306a36Sopenharmony_cistatic const struct regulator_ops rpmh_regulator_vrm_drms_ops = { 36862306a36Sopenharmony_ci .enable = rpmh_regulator_enable, 36962306a36Sopenharmony_ci .disable = rpmh_regulator_disable, 37062306a36Sopenharmony_ci .is_enabled = rpmh_regulator_is_enabled, 37162306a36Sopenharmony_ci .set_voltage_sel = rpmh_regulator_vrm_set_voltage_sel, 37262306a36Sopenharmony_ci .get_voltage_sel = rpmh_regulator_vrm_get_voltage_sel, 37362306a36Sopenharmony_ci .list_voltage = regulator_list_voltage_linear_range, 37462306a36Sopenharmony_ci .set_mode = rpmh_regulator_vrm_set_mode, 37562306a36Sopenharmony_ci .get_mode = rpmh_regulator_vrm_get_mode, 37662306a36Sopenharmony_ci .get_optimum_mode = rpmh_regulator_vrm_get_optimum_mode, 37762306a36Sopenharmony_ci}; 37862306a36Sopenharmony_ci 37962306a36Sopenharmony_cistatic const struct regulator_ops rpmh_regulator_vrm_bypass_ops = { 38062306a36Sopenharmony_ci .enable = rpmh_regulator_enable, 38162306a36Sopenharmony_ci .disable = rpmh_regulator_disable, 38262306a36Sopenharmony_ci .is_enabled = rpmh_regulator_is_enabled, 38362306a36Sopenharmony_ci .set_voltage_sel = rpmh_regulator_vrm_set_voltage_sel, 38462306a36Sopenharmony_ci .get_voltage_sel = rpmh_regulator_vrm_get_voltage_sel, 38562306a36Sopenharmony_ci .list_voltage = regulator_list_voltage_linear_range, 38662306a36Sopenharmony_ci .set_mode = rpmh_regulator_vrm_set_mode, 38762306a36Sopenharmony_ci .get_mode = rpmh_regulator_vrm_get_mode, 38862306a36Sopenharmony_ci .set_bypass = rpmh_regulator_vrm_set_bypass, 38962306a36Sopenharmony_ci .get_bypass = rpmh_regulator_vrm_get_bypass, 39062306a36Sopenharmony_ci}; 39162306a36Sopenharmony_ci 39262306a36Sopenharmony_cistatic const struct regulator_ops rpmh_regulator_xob_ops = { 39362306a36Sopenharmony_ci .enable = rpmh_regulator_enable, 39462306a36Sopenharmony_ci .disable = rpmh_regulator_disable, 39562306a36Sopenharmony_ci .is_enabled = rpmh_regulator_is_enabled, 39662306a36Sopenharmony_ci}; 39762306a36Sopenharmony_ci 39862306a36Sopenharmony_ci/** 39962306a36Sopenharmony_ci * rpmh_regulator_init_vreg() - initialize all attributes of an rpmh-regulator 40062306a36Sopenharmony_ci * @vreg: Pointer to the individual rpmh-regulator resource 40162306a36Sopenharmony_ci * @dev: Pointer to the top level rpmh-regulator PMIC device 40262306a36Sopenharmony_ci * @node: Pointer to the individual rpmh-regulator resource 40362306a36Sopenharmony_ci * device node 40462306a36Sopenharmony_ci * @pmic_id: String used to identify the top level rpmh-regulator 40562306a36Sopenharmony_ci * PMIC device on the board 40662306a36Sopenharmony_ci * @pmic_rpmh_data: Pointer to a null-terminated array of rpmh-regulator 40762306a36Sopenharmony_ci * resources defined for the top level PMIC device 40862306a36Sopenharmony_ci * 40962306a36Sopenharmony_ci * Return: 0 on success, errno on failure 41062306a36Sopenharmony_ci */ 41162306a36Sopenharmony_cistatic int rpmh_regulator_init_vreg(struct rpmh_vreg *vreg, struct device *dev, 41262306a36Sopenharmony_ci struct device_node *node, const char *pmic_id, 41362306a36Sopenharmony_ci const struct rpmh_vreg_init_data *pmic_rpmh_data) 41462306a36Sopenharmony_ci{ 41562306a36Sopenharmony_ci struct regulator_config reg_config = {}; 41662306a36Sopenharmony_ci char rpmh_resource_name[20] = ""; 41762306a36Sopenharmony_ci const struct rpmh_vreg_init_data *rpmh_data; 41862306a36Sopenharmony_ci struct regulator_init_data *init_data; 41962306a36Sopenharmony_ci struct regulator_dev *rdev; 42062306a36Sopenharmony_ci int ret; 42162306a36Sopenharmony_ci 42262306a36Sopenharmony_ci vreg->dev = dev; 42362306a36Sopenharmony_ci 42462306a36Sopenharmony_ci for (rpmh_data = pmic_rpmh_data; rpmh_data->name; rpmh_data++) 42562306a36Sopenharmony_ci if (of_node_name_eq(node, rpmh_data->name)) 42662306a36Sopenharmony_ci break; 42762306a36Sopenharmony_ci 42862306a36Sopenharmony_ci if (!rpmh_data->name) { 42962306a36Sopenharmony_ci dev_err(dev, "Unknown regulator %pOFn\n", node); 43062306a36Sopenharmony_ci return -EINVAL; 43162306a36Sopenharmony_ci } 43262306a36Sopenharmony_ci 43362306a36Sopenharmony_ci scnprintf(rpmh_resource_name, sizeof(rpmh_resource_name), 43462306a36Sopenharmony_ci rpmh_data->resource_name, pmic_id); 43562306a36Sopenharmony_ci 43662306a36Sopenharmony_ci vreg->addr = cmd_db_read_addr(rpmh_resource_name); 43762306a36Sopenharmony_ci if (!vreg->addr) { 43862306a36Sopenharmony_ci dev_err(dev, "%pOFn: could not find RPMh address for resource %s\n", 43962306a36Sopenharmony_ci node, rpmh_resource_name); 44062306a36Sopenharmony_ci return -ENODEV; 44162306a36Sopenharmony_ci } 44262306a36Sopenharmony_ci 44362306a36Sopenharmony_ci vreg->rdesc.name = rpmh_data->name; 44462306a36Sopenharmony_ci vreg->rdesc.supply_name = rpmh_data->supply_name; 44562306a36Sopenharmony_ci vreg->hw_data = rpmh_data->hw_data; 44662306a36Sopenharmony_ci 44762306a36Sopenharmony_ci vreg->enabled = -EINVAL; 44862306a36Sopenharmony_ci vreg->voltage_selector = -ENOTRECOVERABLE; 44962306a36Sopenharmony_ci vreg->mode = REGULATOR_MODE_INVALID; 45062306a36Sopenharmony_ci 45162306a36Sopenharmony_ci if (rpmh_data->hw_data->n_voltages) { 45262306a36Sopenharmony_ci vreg->rdesc.linear_ranges = &rpmh_data->hw_data->voltage_range; 45362306a36Sopenharmony_ci vreg->rdesc.n_linear_ranges = 1; 45462306a36Sopenharmony_ci vreg->rdesc.n_voltages = rpmh_data->hw_data->n_voltages; 45562306a36Sopenharmony_ci } 45662306a36Sopenharmony_ci 45762306a36Sopenharmony_ci vreg->always_wait_for_ack = of_property_read_bool(node, 45862306a36Sopenharmony_ci "qcom,always-wait-for-ack"); 45962306a36Sopenharmony_ci 46062306a36Sopenharmony_ci vreg->rdesc.owner = THIS_MODULE; 46162306a36Sopenharmony_ci vreg->rdesc.type = REGULATOR_VOLTAGE; 46262306a36Sopenharmony_ci vreg->rdesc.ops = vreg->hw_data->ops; 46362306a36Sopenharmony_ci vreg->rdesc.of_map_mode = vreg->hw_data->of_map_mode; 46462306a36Sopenharmony_ci 46562306a36Sopenharmony_ci init_data = of_get_regulator_init_data(dev, node, &vreg->rdesc); 46662306a36Sopenharmony_ci if (!init_data) 46762306a36Sopenharmony_ci return -ENOMEM; 46862306a36Sopenharmony_ci 46962306a36Sopenharmony_ci if (rpmh_data->hw_data->regulator_type == XOB && 47062306a36Sopenharmony_ci init_data->constraints.min_uV && 47162306a36Sopenharmony_ci init_data->constraints.min_uV == init_data->constraints.max_uV) { 47262306a36Sopenharmony_ci vreg->rdesc.fixed_uV = init_data->constraints.min_uV; 47362306a36Sopenharmony_ci vreg->rdesc.n_voltages = 1; 47462306a36Sopenharmony_ci } 47562306a36Sopenharmony_ci 47662306a36Sopenharmony_ci reg_config.dev = dev; 47762306a36Sopenharmony_ci reg_config.init_data = init_data; 47862306a36Sopenharmony_ci reg_config.of_node = node; 47962306a36Sopenharmony_ci reg_config.driver_data = vreg; 48062306a36Sopenharmony_ci 48162306a36Sopenharmony_ci rdev = devm_regulator_register(dev, &vreg->rdesc, ®_config); 48262306a36Sopenharmony_ci if (IS_ERR(rdev)) { 48362306a36Sopenharmony_ci ret = PTR_ERR(rdev); 48462306a36Sopenharmony_ci dev_err(dev, "%pOFn: devm_regulator_register() failed, ret=%d\n", 48562306a36Sopenharmony_ci node, ret); 48662306a36Sopenharmony_ci return ret; 48762306a36Sopenharmony_ci } 48862306a36Sopenharmony_ci 48962306a36Sopenharmony_ci dev_dbg(dev, "%pOFn regulator registered for RPMh resource %s @ 0x%05X\n", 49062306a36Sopenharmony_ci node, rpmh_resource_name, vreg->addr); 49162306a36Sopenharmony_ci 49262306a36Sopenharmony_ci return 0; 49362306a36Sopenharmony_ci} 49462306a36Sopenharmony_ci 49562306a36Sopenharmony_cistatic const int pmic_mode_map_pmic4_ldo[REGULATOR_MODE_STANDBY + 1] = { 49662306a36Sopenharmony_ci [REGULATOR_MODE_INVALID] = -EINVAL, 49762306a36Sopenharmony_ci [REGULATOR_MODE_STANDBY] = PMIC4_LDO_MODE_RETENTION, 49862306a36Sopenharmony_ci [REGULATOR_MODE_IDLE] = PMIC4_LDO_MODE_LPM, 49962306a36Sopenharmony_ci [REGULATOR_MODE_NORMAL] = PMIC4_LDO_MODE_HPM, 50062306a36Sopenharmony_ci [REGULATOR_MODE_FAST] = -EINVAL, 50162306a36Sopenharmony_ci}; 50262306a36Sopenharmony_ci 50362306a36Sopenharmony_cistatic const int pmic_mode_map_pmic5_ldo[REGULATOR_MODE_STANDBY + 1] = { 50462306a36Sopenharmony_ci [REGULATOR_MODE_INVALID] = -EINVAL, 50562306a36Sopenharmony_ci [REGULATOR_MODE_STANDBY] = PMIC5_LDO_MODE_RETENTION, 50662306a36Sopenharmony_ci [REGULATOR_MODE_IDLE] = PMIC5_LDO_MODE_LPM, 50762306a36Sopenharmony_ci [REGULATOR_MODE_NORMAL] = PMIC5_LDO_MODE_HPM, 50862306a36Sopenharmony_ci [REGULATOR_MODE_FAST] = -EINVAL, 50962306a36Sopenharmony_ci}; 51062306a36Sopenharmony_ci 51162306a36Sopenharmony_cistatic unsigned int rpmh_regulator_pmic4_ldo_of_map_mode(unsigned int rpmh_mode) 51262306a36Sopenharmony_ci{ 51362306a36Sopenharmony_ci unsigned int mode; 51462306a36Sopenharmony_ci 51562306a36Sopenharmony_ci switch (rpmh_mode) { 51662306a36Sopenharmony_ci case RPMH_REGULATOR_MODE_HPM: 51762306a36Sopenharmony_ci mode = REGULATOR_MODE_NORMAL; 51862306a36Sopenharmony_ci break; 51962306a36Sopenharmony_ci case RPMH_REGULATOR_MODE_LPM: 52062306a36Sopenharmony_ci mode = REGULATOR_MODE_IDLE; 52162306a36Sopenharmony_ci break; 52262306a36Sopenharmony_ci case RPMH_REGULATOR_MODE_RET: 52362306a36Sopenharmony_ci mode = REGULATOR_MODE_STANDBY; 52462306a36Sopenharmony_ci break; 52562306a36Sopenharmony_ci default: 52662306a36Sopenharmony_ci mode = REGULATOR_MODE_INVALID; 52762306a36Sopenharmony_ci break; 52862306a36Sopenharmony_ci } 52962306a36Sopenharmony_ci 53062306a36Sopenharmony_ci return mode; 53162306a36Sopenharmony_ci} 53262306a36Sopenharmony_ci 53362306a36Sopenharmony_cistatic const int pmic_mode_map_pmic4_smps[REGULATOR_MODE_STANDBY + 1] = { 53462306a36Sopenharmony_ci [REGULATOR_MODE_INVALID] = -EINVAL, 53562306a36Sopenharmony_ci [REGULATOR_MODE_STANDBY] = PMIC4_SMPS_MODE_RETENTION, 53662306a36Sopenharmony_ci [REGULATOR_MODE_IDLE] = PMIC4_SMPS_MODE_PFM, 53762306a36Sopenharmony_ci [REGULATOR_MODE_NORMAL] = PMIC4_SMPS_MODE_AUTO, 53862306a36Sopenharmony_ci [REGULATOR_MODE_FAST] = PMIC4_SMPS_MODE_PWM, 53962306a36Sopenharmony_ci}; 54062306a36Sopenharmony_ci 54162306a36Sopenharmony_cistatic const int pmic_mode_map_pmic5_smps[REGULATOR_MODE_STANDBY + 1] = { 54262306a36Sopenharmony_ci [REGULATOR_MODE_INVALID] = -EINVAL, 54362306a36Sopenharmony_ci [REGULATOR_MODE_STANDBY] = PMIC5_SMPS_MODE_RETENTION, 54462306a36Sopenharmony_ci [REGULATOR_MODE_IDLE] = PMIC5_SMPS_MODE_PFM, 54562306a36Sopenharmony_ci [REGULATOR_MODE_NORMAL] = PMIC5_SMPS_MODE_AUTO, 54662306a36Sopenharmony_ci [REGULATOR_MODE_FAST] = PMIC5_SMPS_MODE_PWM, 54762306a36Sopenharmony_ci}; 54862306a36Sopenharmony_ci 54962306a36Sopenharmony_cistatic unsigned int 55062306a36Sopenharmony_cirpmh_regulator_pmic4_smps_of_map_mode(unsigned int rpmh_mode) 55162306a36Sopenharmony_ci{ 55262306a36Sopenharmony_ci unsigned int mode; 55362306a36Sopenharmony_ci 55462306a36Sopenharmony_ci switch (rpmh_mode) { 55562306a36Sopenharmony_ci case RPMH_REGULATOR_MODE_HPM: 55662306a36Sopenharmony_ci mode = REGULATOR_MODE_FAST; 55762306a36Sopenharmony_ci break; 55862306a36Sopenharmony_ci case RPMH_REGULATOR_MODE_AUTO: 55962306a36Sopenharmony_ci mode = REGULATOR_MODE_NORMAL; 56062306a36Sopenharmony_ci break; 56162306a36Sopenharmony_ci case RPMH_REGULATOR_MODE_LPM: 56262306a36Sopenharmony_ci mode = REGULATOR_MODE_IDLE; 56362306a36Sopenharmony_ci break; 56462306a36Sopenharmony_ci case RPMH_REGULATOR_MODE_RET: 56562306a36Sopenharmony_ci mode = REGULATOR_MODE_STANDBY; 56662306a36Sopenharmony_ci break; 56762306a36Sopenharmony_ci default: 56862306a36Sopenharmony_ci mode = REGULATOR_MODE_INVALID; 56962306a36Sopenharmony_ci break; 57062306a36Sopenharmony_ci } 57162306a36Sopenharmony_ci 57262306a36Sopenharmony_ci return mode; 57362306a36Sopenharmony_ci} 57462306a36Sopenharmony_ci 57562306a36Sopenharmony_cistatic const int pmic_mode_map_pmic4_bob[REGULATOR_MODE_STANDBY + 1] = { 57662306a36Sopenharmony_ci [REGULATOR_MODE_INVALID] = -EINVAL, 57762306a36Sopenharmony_ci [REGULATOR_MODE_STANDBY] = -EINVAL, 57862306a36Sopenharmony_ci [REGULATOR_MODE_IDLE] = PMIC4_BOB_MODE_PFM, 57962306a36Sopenharmony_ci [REGULATOR_MODE_NORMAL] = PMIC4_BOB_MODE_AUTO, 58062306a36Sopenharmony_ci [REGULATOR_MODE_FAST] = PMIC4_BOB_MODE_PWM, 58162306a36Sopenharmony_ci}; 58262306a36Sopenharmony_ci 58362306a36Sopenharmony_cistatic const int pmic_mode_map_pmic5_bob[REGULATOR_MODE_STANDBY + 1] = { 58462306a36Sopenharmony_ci [REGULATOR_MODE_INVALID] = -EINVAL, 58562306a36Sopenharmony_ci [REGULATOR_MODE_STANDBY] = -EINVAL, 58662306a36Sopenharmony_ci [REGULATOR_MODE_IDLE] = PMIC5_BOB_MODE_PFM, 58762306a36Sopenharmony_ci [REGULATOR_MODE_NORMAL] = PMIC5_BOB_MODE_AUTO, 58862306a36Sopenharmony_ci [REGULATOR_MODE_FAST] = PMIC5_BOB_MODE_PWM, 58962306a36Sopenharmony_ci}; 59062306a36Sopenharmony_ci 59162306a36Sopenharmony_cistatic unsigned int rpmh_regulator_pmic4_bob_of_map_mode(unsigned int rpmh_mode) 59262306a36Sopenharmony_ci{ 59362306a36Sopenharmony_ci unsigned int mode; 59462306a36Sopenharmony_ci 59562306a36Sopenharmony_ci switch (rpmh_mode) { 59662306a36Sopenharmony_ci case RPMH_REGULATOR_MODE_HPM: 59762306a36Sopenharmony_ci mode = REGULATOR_MODE_FAST; 59862306a36Sopenharmony_ci break; 59962306a36Sopenharmony_ci case RPMH_REGULATOR_MODE_AUTO: 60062306a36Sopenharmony_ci mode = REGULATOR_MODE_NORMAL; 60162306a36Sopenharmony_ci break; 60262306a36Sopenharmony_ci case RPMH_REGULATOR_MODE_LPM: 60362306a36Sopenharmony_ci mode = REGULATOR_MODE_IDLE; 60462306a36Sopenharmony_ci break; 60562306a36Sopenharmony_ci default: 60662306a36Sopenharmony_ci mode = REGULATOR_MODE_INVALID; 60762306a36Sopenharmony_ci break; 60862306a36Sopenharmony_ci } 60962306a36Sopenharmony_ci 61062306a36Sopenharmony_ci return mode; 61162306a36Sopenharmony_ci} 61262306a36Sopenharmony_ci 61362306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic4_pldo = { 61462306a36Sopenharmony_ci .regulator_type = VRM, 61562306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_drms_ops, 61662306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(1664000, 0, 255, 8000), 61762306a36Sopenharmony_ci .n_voltages = 256, 61862306a36Sopenharmony_ci .hpm_min_load_uA = 10000, 61962306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic4_ldo, 62062306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode, 62162306a36Sopenharmony_ci}; 62262306a36Sopenharmony_ci 62362306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic4_pldo_lv = { 62462306a36Sopenharmony_ci .regulator_type = VRM, 62562306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_drms_ops, 62662306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(1256000, 0, 127, 8000), 62762306a36Sopenharmony_ci .n_voltages = 128, 62862306a36Sopenharmony_ci .hpm_min_load_uA = 10000, 62962306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic4_ldo, 63062306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode, 63162306a36Sopenharmony_ci}; 63262306a36Sopenharmony_ci 63362306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic4_nldo = { 63462306a36Sopenharmony_ci .regulator_type = VRM, 63562306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_drms_ops, 63662306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(312000, 0, 127, 8000), 63762306a36Sopenharmony_ci .n_voltages = 128, 63862306a36Sopenharmony_ci .hpm_min_load_uA = 30000, 63962306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic4_ldo, 64062306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode, 64162306a36Sopenharmony_ci}; 64262306a36Sopenharmony_ci 64362306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic4_hfsmps3 = { 64462306a36Sopenharmony_ci .regulator_type = VRM, 64562306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_ops, 64662306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 215, 8000), 64762306a36Sopenharmony_ci .n_voltages = 216, 64862306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic4_smps, 64962306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, 65062306a36Sopenharmony_ci}; 65162306a36Sopenharmony_ci 65262306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic4_ftsmps426 = { 65362306a36Sopenharmony_ci .regulator_type = VRM, 65462306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_ops, 65562306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 258, 4000), 65662306a36Sopenharmony_ci .n_voltages = 259, 65762306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic4_smps, 65862306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, 65962306a36Sopenharmony_ci}; 66062306a36Sopenharmony_ci 66162306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic4_bob = { 66262306a36Sopenharmony_ci .regulator_type = VRM, 66362306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_bypass_ops, 66462306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(1824000, 0, 83, 32000), 66562306a36Sopenharmony_ci .n_voltages = 84, 66662306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic4_bob, 66762306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_bob_of_map_mode, 66862306a36Sopenharmony_ci}; 66962306a36Sopenharmony_ci 67062306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic4_lvs = { 67162306a36Sopenharmony_ci .regulator_type = XOB, 67262306a36Sopenharmony_ci .ops = &rpmh_regulator_xob_ops, 67362306a36Sopenharmony_ci /* LVS hardware does not support voltage or mode configuration. */ 67462306a36Sopenharmony_ci}; 67562306a36Sopenharmony_ci 67662306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_pldo = { 67762306a36Sopenharmony_ci .regulator_type = VRM, 67862306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_drms_ops, 67962306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(1504000, 0, 255, 8000), 68062306a36Sopenharmony_ci .n_voltages = 256, 68162306a36Sopenharmony_ci .hpm_min_load_uA = 10000, 68262306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_ldo, 68362306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode, 68462306a36Sopenharmony_ci}; 68562306a36Sopenharmony_ci 68662306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_pldo_lv = { 68762306a36Sopenharmony_ci .regulator_type = VRM, 68862306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_drms_ops, 68962306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(1504000, 0, 62, 8000), 69062306a36Sopenharmony_ci .n_voltages = 63, 69162306a36Sopenharmony_ci .hpm_min_load_uA = 10000, 69262306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_ldo, 69362306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode, 69462306a36Sopenharmony_ci}; 69562306a36Sopenharmony_ci 69662306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_pldo515_mv = { 69762306a36Sopenharmony_ci .regulator_type = VRM, 69862306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_drms_ops, 69962306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(1800000, 0, 187, 8000), 70062306a36Sopenharmony_ci .n_voltages = 188, 70162306a36Sopenharmony_ci .hpm_min_load_uA = 10000, 70262306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_ldo, 70362306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode, 70462306a36Sopenharmony_ci}; 70562306a36Sopenharmony_ci 70662306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_nldo = { 70762306a36Sopenharmony_ci .regulator_type = VRM, 70862306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_drms_ops, 70962306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 123, 8000), 71062306a36Sopenharmony_ci .n_voltages = 124, 71162306a36Sopenharmony_ci .hpm_min_load_uA = 30000, 71262306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_ldo, 71362306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode, 71462306a36Sopenharmony_ci}; 71562306a36Sopenharmony_ci 71662306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_nldo515 = { 71762306a36Sopenharmony_ci .regulator_type = VRM, 71862306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_drms_ops, 71962306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 210, 8000), 72062306a36Sopenharmony_ci .n_voltages = 211, 72162306a36Sopenharmony_ci .hpm_min_load_uA = 30000, 72262306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_ldo, 72362306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_ldo_of_map_mode, 72462306a36Sopenharmony_ci}; 72562306a36Sopenharmony_ci 72662306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_hfsmps510 = { 72762306a36Sopenharmony_ci .regulator_type = VRM, 72862306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_ops, 72962306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 215, 8000), 73062306a36Sopenharmony_ci .n_voltages = 216, 73162306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_smps, 73262306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, 73362306a36Sopenharmony_ci}; 73462306a36Sopenharmony_ci 73562306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_ftsmps510 = { 73662306a36Sopenharmony_ci .regulator_type = VRM, 73762306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_ops, 73862306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(300000, 0, 263, 4000), 73962306a36Sopenharmony_ci .n_voltages = 264, 74062306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_smps, 74162306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, 74262306a36Sopenharmony_ci}; 74362306a36Sopenharmony_ci 74462306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_ftsmps520 = { 74562306a36Sopenharmony_ci .regulator_type = VRM, 74662306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_ops, 74762306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(300000, 0, 263, 4000), 74862306a36Sopenharmony_ci .n_voltages = 264, 74962306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_smps, 75062306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, 75162306a36Sopenharmony_ci}; 75262306a36Sopenharmony_ci 75362306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_ftsmps525_lv = { 75462306a36Sopenharmony_ci .regulator_type = VRM, 75562306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_ops, 75662306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(300000, 0, 267, 4000), 75762306a36Sopenharmony_ci .n_voltages = 268, 75862306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_smps, 75962306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, 76062306a36Sopenharmony_ci}; 76162306a36Sopenharmony_ci 76262306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_ftsmps525_mv = { 76362306a36Sopenharmony_ci .regulator_type = VRM, 76462306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_ops, 76562306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(600000, 0, 267, 8000), 76662306a36Sopenharmony_ci .n_voltages = 268, 76762306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_smps, 76862306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, 76962306a36Sopenharmony_ci}; 77062306a36Sopenharmony_ci 77162306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_ftsmps527 = { 77262306a36Sopenharmony_ci .regulator_type = VRM, 77362306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_ops, 77462306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 215, 8000), 77562306a36Sopenharmony_ci .n_voltages = 215, 77662306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_smps, 77762306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, 77862306a36Sopenharmony_ci}; 77962306a36Sopenharmony_ci 78062306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_hfsmps515 = { 78162306a36Sopenharmony_ci .regulator_type = VRM, 78262306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_ops, 78362306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(320000, 0, 235, 16000), 78462306a36Sopenharmony_ci .n_voltages = 236, 78562306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_smps, 78662306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, 78762306a36Sopenharmony_ci}; 78862306a36Sopenharmony_ci 78962306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_hfsmps515_1 = { 79062306a36Sopenharmony_ci .regulator_type = VRM, 79162306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_ops, 79262306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(900000, 0, 4, 16000), 79362306a36Sopenharmony_ci .n_voltages = 5, 79462306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_smps, 79562306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_smps_of_map_mode, 79662306a36Sopenharmony_ci}; 79762306a36Sopenharmony_ci 79862306a36Sopenharmony_cistatic const struct rpmh_vreg_hw_data pmic5_bob = { 79962306a36Sopenharmony_ci .regulator_type = VRM, 80062306a36Sopenharmony_ci .ops = &rpmh_regulator_vrm_bypass_ops, 80162306a36Sopenharmony_ci .voltage_range = REGULATOR_LINEAR_RANGE(3000000, 0, 31, 32000), 80262306a36Sopenharmony_ci .n_voltages = 32, 80362306a36Sopenharmony_ci .pmic_mode_map = pmic_mode_map_pmic5_bob, 80462306a36Sopenharmony_ci .of_map_mode = rpmh_regulator_pmic4_bob_of_map_mode, 80562306a36Sopenharmony_ci}; 80662306a36Sopenharmony_ci 80762306a36Sopenharmony_ci#define RPMH_VREG(_name, _resource_name, _hw_data, _supply_name) \ 80862306a36Sopenharmony_ci{ \ 80962306a36Sopenharmony_ci .name = _name, \ 81062306a36Sopenharmony_ci .resource_name = _resource_name, \ 81162306a36Sopenharmony_ci .hw_data = _hw_data, \ 81262306a36Sopenharmony_ci .supply_name = _supply_name, \ 81362306a36Sopenharmony_ci} 81462306a36Sopenharmony_ci 81562306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm8998_vreg_data[] = { 81662306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic4_ftsmps426, "vdd-s1"), 81762306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic4_ftsmps426, "vdd-s2"), 81862306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic4_hfsmps3, "vdd-s3"), 81962306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic4_hfsmps3, "vdd-s4"), 82062306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic4_hfsmps3, "vdd-s5"), 82162306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic4_ftsmps426, "vdd-s6"), 82262306a36Sopenharmony_ci RPMH_VREG("smps7", "smp%s7", &pmic4_ftsmps426, "vdd-s7"), 82362306a36Sopenharmony_ci RPMH_VREG("smps8", "smp%s8", &pmic4_ftsmps426, "vdd-s8"), 82462306a36Sopenharmony_ci RPMH_VREG("smps9", "smp%s9", &pmic4_ftsmps426, "vdd-s9"), 82562306a36Sopenharmony_ci RPMH_VREG("smps10", "smp%s10", &pmic4_ftsmps426, "vdd-s10"), 82662306a36Sopenharmony_ci RPMH_VREG("smps11", "smp%s11", &pmic4_ftsmps426, "vdd-s11"), 82762306a36Sopenharmony_ci RPMH_VREG("smps12", "smp%s12", &pmic4_ftsmps426, "vdd-s12"), 82862306a36Sopenharmony_ci RPMH_VREG("smps13", "smp%s13", &pmic4_ftsmps426, "vdd-s13"), 82962306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic4_nldo, "vdd-l1-l27"), 83062306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic4_nldo, "vdd-l2-l8-l17"), 83162306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic4_nldo, "vdd-l3-l11"), 83262306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic4_nldo, "vdd-l4-l5"), 83362306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic4_nldo, "vdd-l4-l5"), 83462306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic4_pldo, "vdd-l6"), 83562306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic4_pldo_lv, "vdd-l7-l12-l14-l15"), 83662306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic4_nldo, "vdd-l2-l8-l17"), 83762306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic4_pldo, "vdd-l9"), 83862306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic4_pldo, "vdd-l10-l23-l25"), 83962306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic4_nldo, "vdd-l3-l11"), 84062306a36Sopenharmony_ci RPMH_VREG("ldo12", "ldo%s12", &pmic4_pldo_lv, "vdd-l7-l12-l14-l15"), 84162306a36Sopenharmony_ci RPMH_VREG("ldo13", "ldo%s13", &pmic4_pldo, "vdd-l13-l19-l21"), 84262306a36Sopenharmony_ci RPMH_VREG("ldo14", "ldo%s14", &pmic4_pldo_lv, "vdd-l7-l12-l14-l15"), 84362306a36Sopenharmony_ci RPMH_VREG("ldo15", "ldo%s15", &pmic4_pldo_lv, "vdd-l7-l12-l14-l15"), 84462306a36Sopenharmony_ci RPMH_VREG("ldo16", "ldo%s16", &pmic4_pldo, "vdd-l16-l28"), 84562306a36Sopenharmony_ci RPMH_VREG("ldo17", "ldo%s17", &pmic4_nldo, "vdd-l2-l8-l17"), 84662306a36Sopenharmony_ci RPMH_VREG("ldo18", "ldo%s18", &pmic4_pldo, "vdd-l18-l22"), 84762306a36Sopenharmony_ci RPMH_VREG("ldo19", "ldo%s19", &pmic4_pldo, "vdd-l13-l19-l21"), 84862306a36Sopenharmony_ci RPMH_VREG("ldo20", "ldo%s20", &pmic4_pldo, "vdd-l20-l24"), 84962306a36Sopenharmony_ci RPMH_VREG("ldo21", "ldo%s21", &pmic4_pldo, "vdd-l13-l19-l21"), 85062306a36Sopenharmony_ci RPMH_VREG("ldo22", "ldo%s22", &pmic4_pldo, "vdd-l18-l22"), 85162306a36Sopenharmony_ci RPMH_VREG("ldo23", "ldo%s23", &pmic4_pldo, "vdd-l10-l23-l25"), 85262306a36Sopenharmony_ci RPMH_VREG("ldo24", "ldo%s24", &pmic4_pldo, "vdd-l20-l24"), 85362306a36Sopenharmony_ci RPMH_VREG("ldo25", "ldo%s25", &pmic4_pldo, "vdd-l10-l23-l25"), 85462306a36Sopenharmony_ci RPMH_VREG("ldo26", "ldo%s26", &pmic4_nldo, "vdd-l26"), 85562306a36Sopenharmony_ci RPMH_VREG("ldo27", "ldo%s27", &pmic4_nldo, "vdd-l1-l27"), 85662306a36Sopenharmony_ci RPMH_VREG("ldo28", "ldo%s28", &pmic4_pldo, "vdd-l16-l28"), 85762306a36Sopenharmony_ci RPMH_VREG("lvs1", "vs%s1", &pmic4_lvs, "vin-lvs-1-2"), 85862306a36Sopenharmony_ci RPMH_VREG("lvs2", "vs%s2", &pmic4_lvs, "vin-lvs-1-2"), 85962306a36Sopenharmony_ci {} 86062306a36Sopenharmony_ci}; 86162306a36Sopenharmony_ci 86262306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pmg1110_vreg_data[] = { 86362306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps510, "vdd-s1"), 86462306a36Sopenharmony_ci {} 86562306a36Sopenharmony_ci}; 86662306a36Sopenharmony_ci 86762306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pmi8998_vreg_data[] = { 86862306a36Sopenharmony_ci RPMH_VREG("bob", "bob%s1", &pmic4_bob, "vdd-bob"), 86962306a36Sopenharmony_ci {} 87062306a36Sopenharmony_ci}; 87162306a36Sopenharmony_ci 87262306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm8005_vreg_data[] = { 87362306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic4_ftsmps426, "vdd-s1"), 87462306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic4_ftsmps426, "vdd-s2"), 87562306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic4_ftsmps426, "vdd-s3"), 87662306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic4_ftsmps426, "vdd-s4"), 87762306a36Sopenharmony_ci {} 87862306a36Sopenharmony_ci}; 87962306a36Sopenharmony_ci 88062306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm8150_vreg_data[] = { 88162306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps510, "vdd-s1"), 88262306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps510, "vdd-s2"), 88362306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps510, "vdd-s3"), 88462306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_hfsmps510, "vdd-s4"), 88562306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_hfsmps510, "vdd-s5"), 88662306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps510, "vdd-s6"), 88762306a36Sopenharmony_ci RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps510, "vdd-s7"), 88862306a36Sopenharmony_ci RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps510, "vdd-s8"), 88962306a36Sopenharmony_ci RPMH_VREG("smps9", "smp%s9", &pmic5_ftsmps510, "vdd-s9"), 89062306a36Sopenharmony_ci RPMH_VREG("smps10", "smp%s10", &pmic5_ftsmps510, "vdd-s10"), 89162306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo, "vdd-l1-l8-l11"), 89262306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_pldo, "vdd-l2-l10"), 89362306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo, "vdd-l3-l4-l5-l18"), 89462306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo, "vdd-l3-l4-l5-l18"), 89562306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_nldo, "vdd-l3-l4-l5-l18"), 89662306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_nldo, "vdd-l6-l9"), 89762306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo, "vdd-l7-l12-l14-l15"), 89862306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_nldo, "vdd-l1-l8-l11"), 89962306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_nldo, "vdd-l6-l9"), 90062306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic5_pldo, "vdd-l2-l10"), 90162306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic5_nldo, "vdd-l1-l8-l11"), 90262306a36Sopenharmony_ci RPMH_VREG("ldo12", "ldo%s12", &pmic5_pldo_lv, "vdd-l7-l12-l14-l15"), 90362306a36Sopenharmony_ci RPMH_VREG("ldo13", "ldo%s13", &pmic5_pldo, "vdd-l13-l16-l17"), 90462306a36Sopenharmony_ci RPMH_VREG("ldo14", "ldo%s14", &pmic5_pldo_lv, "vdd-l7-l12-l14-l15"), 90562306a36Sopenharmony_ci RPMH_VREG("ldo15", "ldo%s15", &pmic5_pldo_lv, "vdd-l7-l12-l14-l15"), 90662306a36Sopenharmony_ci RPMH_VREG("ldo16", "ldo%s16", &pmic5_pldo, "vdd-l13-l16-l17"), 90762306a36Sopenharmony_ci RPMH_VREG("ldo17", "ldo%s17", &pmic5_pldo, "vdd-l13-l16-l17"), 90862306a36Sopenharmony_ci RPMH_VREG("ldo18", "ldo%s18", &pmic5_nldo, "vdd-l3-l4-l5-l18"), 90962306a36Sopenharmony_ci {} 91062306a36Sopenharmony_ci}; 91162306a36Sopenharmony_ci 91262306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm8150l_vreg_data[] = { 91362306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps510, "vdd-s1"), 91462306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps510, "vdd-s2"), 91562306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps510, "vdd-s3"), 91662306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps510, "vdd-s4"), 91762306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps510, "vdd-s5"), 91862306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps510, "vdd-s6"), 91962306a36Sopenharmony_ci RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps510, "vdd-s7"), 92062306a36Sopenharmony_ci RPMH_VREG("smps8", "smp%s8", &pmic5_hfsmps510, "vdd-s8"), 92162306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_pldo_lv, "vdd-l1-l8"), 92262306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo, "vdd-l2-l3"), 92362306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo, "vdd-l2-l3"), 92462306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_pldo, "vdd-l4-l5-l6"), 92562306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo, "vdd-l4-l5-l6"), 92662306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo, "vdd-l4-l5-l6"), 92762306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo, "vdd-l7-l11"), 92862306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_pldo_lv, "vdd-l1-l8"), 92962306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_pldo, "vdd-l9-l10"), 93062306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic5_pldo, "vdd-l9-l10"), 93162306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic5_pldo, "vdd-l7-l11"), 93262306a36Sopenharmony_ci RPMH_VREG("bob", "bob%s1", &pmic5_bob, "vdd-bob"), 93362306a36Sopenharmony_ci {} 93462306a36Sopenharmony_ci}; 93562306a36Sopenharmony_ci 93662306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pmm8155au_vreg_data[] = { 93762306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps510, "vdd-s1"), 93862306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps510, "vdd-s2"), 93962306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps510, "vdd-s3"), 94062306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_hfsmps510, "vdd-s4"), 94162306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_hfsmps510, "vdd-s5"), 94262306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps510, "vdd-s6"), 94362306a36Sopenharmony_ci RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps510, "vdd-s7"), 94462306a36Sopenharmony_ci RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps510, "vdd-s8"), 94562306a36Sopenharmony_ci RPMH_VREG("smps9", "smp%s9", &pmic5_ftsmps510, "vdd-s9"), 94662306a36Sopenharmony_ci RPMH_VREG("smps10", "smp%s10", &pmic5_ftsmps510, "vdd-s10"), 94762306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo, "vdd-l1-l8-l11"), 94862306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_pldo, "vdd-l2-l10"), 94962306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo, "vdd-l3-l4-l5-l18"), 95062306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo, "vdd-l3-l4-l5-l18"), 95162306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_nldo, "vdd-l3-l4-l5-l18"), 95262306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_nldo, "vdd-l6-l9"), 95362306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo_lv, "vdd-l7-l12-l14-l15"), 95462306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_nldo, "vdd-l1-l8-l11"), 95562306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_nldo, "vdd-l6-l9"), 95662306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic5_pldo, "vdd-l2-l10"), 95762306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic5_nldo, "vdd-l1-l8-l11"), 95862306a36Sopenharmony_ci RPMH_VREG("ldo12", "ldo%s12", &pmic5_pldo_lv, "vdd-l7-l12-l14-l15"), 95962306a36Sopenharmony_ci RPMH_VREG("ldo13", "ldo%s13", &pmic5_pldo, "vdd-l13-l16-l17"), 96062306a36Sopenharmony_ci RPMH_VREG("ldo14", "ldo%s14", &pmic5_pldo_lv, "vdd-l7-l12-l14-l15"), 96162306a36Sopenharmony_ci RPMH_VREG("ldo15", "ldo%s15", &pmic5_pldo_lv, "vdd-l7-l12-l14-l15"), 96262306a36Sopenharmony_ci RPMH_VREG("ldo16", "ldo%s16", &pmic5_pldo, "vdd-l13-l16-l17"), 96362306a36Sopenharmony_ci RPMH_VREG("ldo17", "ldo%s17", &pmic5_pldo, "vdd-l13-l16-l17"), 96462306a36Sopenharmony_ci RPMH_VREG("ldo18", "ldo%s18", &pmic5_nldo, "vdd-l3-l4-l5-l18"), 96562306a36Sopenharmony_ci {} 96662306a36Sopenharmony_ci}; 96762306a36Sopenharmony_ci 96862306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pmm8654au_vreg_data[] = { 96962306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps527, "vdd-s1"), 97062306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps527, "vdd-s2"), 97162306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps527, "vdd-s3"), 97262306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps527, "vdd-s4"), 97362306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps527, "vdd-s5"), 97462306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps527, "vdd-s6"), 97562306a36Sopenharmony_ci RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps527, "vdd-s7"), 97662306a36Sopenharmony_ci RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps527, "vdd-s8"), 97762306a36Sopenharmony_ci RPMH_VREG("smps9", "smp%s9", &pmic5_ftsmps527, "vdd-s9"), 97862306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo515, "vdd-s9"), 97962306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo515, "vdd-l2-l3"), 98062306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo515, "vdd-l2-l3"), 98162306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo515, "vdd-s9"), 98262306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_nldo515, "vdd-s9"), 98362306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_nldo515, "vdd-l6-l7"), 98462306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_nldo515, "vdd-l6-l7"), 98562306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_pldo515_mv, "vdd-l8-l9"), 98662306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_pldo, "vdd-l8-l9"), 98762306a36Sopenharmony_ci {} 98862306a36Sopenharmony_ci}; 98962306a36Sopenharmony_ci 99062306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm8350_vreg_data[] = { 99162306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps510, "vdd-s1"), 99262306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps510, "vdd-s2"), 99362306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps510, "vdd-s3"), 99462306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps510, "vdd-s4"), 99562306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps510, "vdd-s5"), 99662306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps510, "vdd-s6"), 99762306a36Sopenharmony_ci RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps510, "vdd-s7"), 99862306a36Sopenharmony_ci RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps510, "vdd-s8"), 99962306a36Sopenharmony_ci RPMH_VREG("smps9", "smp%s9", &pmic5_ftsmps510, "vdd-s9"), 100062306a36Sopenharmony_ci RPMH_VREG("smps10", "smp%s10", &pmic5_hfsmps510, "vdd-s10"), 100162306a36Sopenharmony_ci RPMH_VREG("smps11", "smp%s11", &pmic5_hfsmps510, "vdd-s11"), 100262306a36Sopenharmony_ci RPMH_VREG("smps12", "smp%s12", &pmic5_hfsmps510, "vdd-s12"), 100362306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo, "vdd-l1-l4"), 100462306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_pldo, "vdd-l2-l7"), 100562306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo, "vdd-l3-l5"), 100662306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo, "vdd-l1-l4"), 100762306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_nldo, "vdd-l3-l5"), 100862306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_nldo, "vdd-l6-l9-l10"), 100962306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo, "vdd-l2-l7"), 101062306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_nldo, "vdd-l8"), 101162306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_nldo, "vdd-l6-l9-l10"), 101262306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic5_nldo, "vdd-l6-l9-l10"), 101362306a36Sopenharmony_ci {} 101462306a36Sopenharmony_ci}; 101562306a36Sopenharmony_ci 101662306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm8350c_vreg_data[] = { 101762306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_hfsmps515, "vdd-s1"), 101862306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps510, "vdd-s2"), 101962306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps510, "vdd-s3"), 102062306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps510, "vdd-s4"), 102162306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps510, "vdd-s5"), 102262306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps510, "vdd-s6"), 102362306a36Sopenharmony_ci RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps510, "vdd-s7"), 102462306a36Sopenharmony_ci RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps510, "vdd-s8"), 102562306a36Sopenharmony_ci RPMH_VREG("smps9", "smp%s9", &pmic5_ftsmps510, "vdd-s9"), 102662306a36Sopenharmony_ci RPMH_VREG("smps10", "smp%s10", &pmic5_ftsmps510, "vdd-s10"), 102762306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_pldo_lv, "vdd-l1-l12"), 102862306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_pldo_lv, "vdd-l2-l8"), 102962306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_pldo, "vdd-l3-l4-l5-l7-l13"), 103062306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_pldo, "vdd-l3-l4-l5-l7-l13"), 103162306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo, "vdd-l3-l4-l5-l7-l13"), 103262306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo, "vdd-l6-l9-l11"), 103362306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo, "vdd-l3-l4-l5-l7-l13"), 103462306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_pldo_lv, "vdd-l2-l8"), 103562306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_pldo, "vdd-l6-l9-l11"), 103662306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic5_nldo, "vdd-l10"), 103762306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic5_pldo, "vdd-l6-l9-l11"), 103862306a36Sopenharmony_ci RPMH_VREG("ldo12", "ldo%s12", &pmic5_pldo_lv, "vdd-l1-l12"), 103962306a36Sopenharmony_ci RPMH_VREG("ldo13", "ldo%s13", &pmic5_pldo, "vdd-l3-l4-l5-l7-l13"), 104062306a36Sopenharmony_ci RPMH_VREG("bob", "bob%s1", &pmic5_bob, "vdd-bob"), 104162306a36Sopenharmony_ci {} 104262306a36Sopenharmony_ci}; 104362306a36Sopenharmony_ci 104462306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm8450_vreg_data[] = { 104562306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps520, "vdd-s1"), 104662306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps520, "vdd-s2"), 104762306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps520, "vdd-s3"), 104862306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps520, "vdd-s4"), 104962306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps520, "vdd-s5"), 105062306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps520, "vdd-s6"), 105162306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo, "vdd-l1"), 105262306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo, "vdd-l2"), 105362306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo, "vdd-l3"), 105462306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_pldo_lv, "vdd-l4"), 105562306a36Sopenharmony_ci {} 105662306a36Sopenharmony_ci}; 105762306a36Sopenharmony_ci 105862306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm8550_vreg_data[] = { 105962306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo515, "vdd-l1-l4-l10"), 106062306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_pldo, "vdd-l2-l13-l14"), 106162306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo515, "vdd-l3"), 106262306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo515, "vdd-l1-l4-l10"), 106362306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo, "vdd-l5-l16"), 106462306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo, "vdd-l6-l7"), 106562306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo, "vdd-l6-l7"), 106662306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_pldo, "vdd-l8-l9"), 106762306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_pldo, "vdd-l8-l9"), 106862306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic5_nldo515, "vdd-l1-l4-l10"), 106962306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic5_nldo515, "vdd-l11"), 107062306a36Sopenharmony_ci RPMH_VREG("ldo12", "ldo%s12", &pmic5_nldo515, "vdd-l12"), 107162306a36Sopenharmony_ci RPMH_VREG("ldo13", "ldo%s13", &pmic5_pldo, "vdd-l2-l13-l14"), 107262306a36Sopenharmony_ci RPMH_VREG("ldo14", "ldo%s14", &pmic5_pldo, "vdd-l2-l13-l14"), 107362306a36Sopenharmony_ci RPMH_VREG("ldo15", "ldo%s15", &pmic5_nldo515, "vdd-l15"), 107462306a36Sopenharmony_ci RPMH_VREG("ldo16", "ldo%s16", &pmic5_pldo, "vdd-l5-l16"), 107562306a36Sopenharmony_ci RPMH_VREG("ldo17", "ldo%s17", &pmic5_pldo, "vdd-l17"), 107662306a36Sopenharmony_ci RPMH_VREG("bob1", "bob%s1", &pmic5_bob, "vdd-bob1"), 107762306a36Sopenharmony_ci RPMH_VREG("bob2", "bob%s2", &pmic5_bob, "vdd-bob2"), 107862306a36Sopenharmony_ci {} 107962306a36Sopenharmony_ci}; 108062306a36Sopenharmony_ci 108162306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm8550vs_vreg_data[] = { 108262306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps525_lv, "vdd-s1"), 108362306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps525_lv, "vdd-s2"), 108462306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps525_lv, "vdd-s3"), 108562306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525_lv, "vdd-s4"), 108662306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps525_lv, "vdd-s5"), 108762306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps525_mv, "vdd-s6"), 108862306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo515, "vdd-l1"), 108962306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo515, "vdd-l2"), 109062306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo515, "vdd-l3"), 109162306a36Sopenharmony_ci {} 109262306a36Sopenharmony_ci}; 109362306a36Sopenharmony_ci 109462306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm8550ve_vreg_data[] = { 109562306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps525_lv, "vdd-s1"), 109662306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps525_lv, "vdd-s2"), 109762306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps525_lv, "vdd-s3"), 109862306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525_mv, "vdd-s4"), 109962306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps525_lv, "vdd-s5"), 110062306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps525_lv, "vdd-s6"), 110162306a36Sopenharmony_ci RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps525_lv, "vdd-s7"), 110262306a36Sopenharmony_ci RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps525_lv, "vdd-s8"), 110362306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo515, "vdd-l1"), 110462306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo515, "vdd-l2"), 110562306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo515, "vdd-l3"), 110662306a36Sopenharmony_ci {} 110762306a36Sopenharmony_ci}; 110862306a36Sopenharmony_ci 110962306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm8009_vreg_data[] = { 111062306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_hfsmps510, "vdd-s1"), 111162306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_hfsmps515, "vdd-s2"), 111262306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo, "vdd-l1"), 111362306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo, "vdd-l2"), 111462306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo, "vdd-l3"), 111562306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo, "vdd-l4"), 111662306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo, "vdd-l5-l6"), 111762306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo, "vdd-l5-l6"), 111862306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo_lv, "vdd-l7"), 111962306a36Sopenharmony_ci {} 112062306a36Sopenharmony_ci}; 112162306a36Sopenharmony_ci 112262306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm8009_1_vreg_data[] = { 112362306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_hfsmps510, "vdd-s1"), 112462306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_hfsmps515_1, "vdd-s2"), 112562306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo, "vdd-l1"), 112662306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo, "vdd-l2"), 112762306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo, "vdd-l3"), 112862306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo, "vdd-l4"), 112962306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo, "vdd-l5-l6"), 113062306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo, "vdd-l5-l6"), 113162306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo_lv, "vdd-l7"), 113262306a36Sopenharmony_ci {} 113362306a36Sopenharmony_ci}; 113462306a36Sopenharmony_ci 113562306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm6150_vreg_data[] = { 113662306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps510, "vdd-s1"), 113762306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps510, "vdd-s2"), 113862306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps510, "vdd-s3"), 113962306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_hfsmps510, "vdd-s4"), 114062306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_hfsmps510, "vdd-s5"), 114162306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo, "vdd-l1"), 114262306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo, "vdd-l2-l3"), 114362306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo, "vdd-l2-l3"), 114462306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo, "vdd-l4-l7-l8"), 114562306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo, "vdd-l5-l16-l17-l18-l19"), 114662306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_nldo, "vdd-l6"), 114762306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_nldo, "vdd-l4-l7-l8"), 114862306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_nldo, "vdd-l4-l7-l8"), 114962306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_nldo, "vdd-l9"), 115062306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic5_pldo_lv, "vdd-l10-l14-l15"), 115162306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic5_pldo_lv, "vdd-l11-l12-l13"), 115262306a36Sopenharmony_ci RPMH_VREG("ldo12", "ldo%s12", &pmic5_pldo_lv, "vdd-l11-l12-l13"), 115362306a36Sopenharmony_ci RPMH_VREG("ldo13", "ldo%s13", &pmic5_pldo_lv, "vdd-l11-l12-l13"), 115462306a36Sopenharmony_ci RPMH_VREG("ldo14", "ldo%s14", &pmic5_pldo_lv, "vdd-l10-l14-l15"), 115562306a36Sopenharmony_ci RPMH_VREG("ldo15", "ldo%s15", &pmic5_pldo_lv, "vdd-l10-l14-l15"), 115662306a36Sopenharmony_ci RPMH_VREG("ldo16", "ldo%s16", &pmic5_pldo, "vdd-l5-l16-l17-l18-l19"), 115762306a36Sopenharmony_ci RPMH_VREG("ldo17", "ldo%s17", &pmic5_pldo, "vdd-l5-l16-l17-l18-l19"), 115862306a36Sopenharmony_ci RPMH_VREG("ldo18", "ldo%s18", &pmic5_pldo, "vdd-l5-l16-l17-l18-l19"), 115962306a36Sopenharmony_ci RPMH_VREG("ldo19", "ldo%s19", &pmic5_pldo, "vdd-l5-l16-l17-l18-l19"), 116062306a36Sopenharmony_ci {} 116162306a36Sopenharmony_ci}; 116262306a36Sopenharmony_ci 116362306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm6150l_vreg_data[] = { 116462306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps510, "vdd-s1"), 116562306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps510, "vdd-s2"), 116662306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps510, "vdd-s3"), 116762306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps510, "vdd-s4"), 116862306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps510, "vdd-s5"), 116962306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps510, "vdd-s6"), 117062306a36Sopenharmony_ci RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps510, "vdd-s7"), 117162306a36Sopenharmony_ci RPMH_VREG("smps8", "smp%s8", &pmic5_hfsmps510, "vdd-s8"), 117262306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_pldo_lv, "vdd-l1-l8"), 117362306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo, "vdd-l2-l3"), 117462306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo, "vdd-l2-l3"), 117562306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_pldo, "vdd-l4-l5-l6"), 117662306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo, "vdd-l4-l5-l6"), 117762306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo, "vdd-l4-l5-l6"), 117862306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo, "vdd-l7-l11"), 117962306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_pldo, "vdd-l1-l8"), 118062306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_pldo, "vdd-l9-l10"), 118162306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic5_pldo, "vdd-l9-l10"), 118262306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic5_pldo, "vdd-l7-l11"), 118362306a36Sopenharmony_ci RPMH_VREG("bob", "bob%s1", &pmic5_bob, "vdd-bob"), 118462306a36Sopenharmony_ci {} 118562306a36Sopenharmony_ci}; 118662306a36Sopenharmony_ci 118762306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm6350_vreg_data[] = { 118862306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps510, NULL), 118962306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_hfsmps510, NULL), 119062306a36Sopenharmony_ci /* smps3 - smps5 not configured */ 119162306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo, NULL), 119262306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_pldo, NULL), 119362306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_pldo, NULL), 119462306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo, NULL), 119562306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo, NULL), 119662306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo, NULL), 119762306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo, NULL), 119862306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_pldo, NULL), 119962306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_pldo, NULL), 120062306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic5_pldo, NULL), 120162306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic5_pldo, NULL), 120262306a36Sopenharmony_ci RPMH_VREG("ldo12", "ldo%s12", &pmic5_pldo, NULL), 120362306a36Sopenharmony_ci RPMH_VREG("ldo13", "ldo%s13", &pmic5_nldo, NULL), 120462306a36Sopenharmony_ci RPMH_VREG("ldo14", "ldo%s14", &pmic5_pldo, NULL), 120562306a36Sopenharmony_ci RPMH_VREG("ldo15", "ldo%s15", &pmic5_nldo, NULL), 120662306a36Sopenharmony_ci RPMH_VREG("ldo16", "ldo%s16", &pmic5_nldo, NULL), 120762306a36Sopenharmony_ci /* ldo17 not configured */ 120862306a36Sopenharmony_ci RPMH_VREG("ldo18", "ldo%s18", &pmic5_nldo, NULL), 120962306a36Sopenharmony_ci RPMH_VREG("ldo19", "ldo%s19", &pmic5_nldo, NULL), 121062306a36Sopenharmony_ci RPMH_VREG("ldo20", "ldo%s20", &pmic5_nldo, NULL), 121162306a36Sopenharmony_ci RPMH_VREG("ldo21", "ldo%s21", &pmic5_nldo, NULL), 121262306a36Sopenharmony_ci RPMH_VREG("ldo22", "ldo%s22", &pmic5_nldo, NULL), 121362306a36Sopenharmony_ci}; 121462306a36Sopenharmony_ci 121562306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pmx55_vreg_data[] = { 121662306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps510, "vdd-s1"), 121762306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_hfsmps510, "vdd-s2"), 121862306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_hfsmps510, "vdd-s3"), 121962306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_hfsmps510, "vdd-s4"), 122062306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_hfsmps510, "vdd-s5"), 122162306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps510, "vdd-s6"), 122262306a36Sopenharmony_ci RPMH_VREG("smps7", "smp%s7", &pmic5_hfsmps510, "vdd-s7"), 122362306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo, "vdd-l1-l2"), 122462306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo, "vdd-l1-l2"), 122562306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo, "vdd-l3-l9"), 122662306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo, "vdd-l4-l12"), 122762306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo, "vdd-l5-l6"), 122862306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo, "vdd-l5-l6"), 122962306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_nldo, "vdd-l7-l8"), 123062306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_nldo, "vdd-l7-l8"), 123162306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_nldo, "vdd-l3-l9"), 123262306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic5_pldo, "vdd-l10-l11-l13"), 123362306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic5_pldo, "vdd-l10-l11-l13"), 123462306a36Sopenharmony_ci RPMH_VREG("ldo12", "ldo%s12", &pmic5_nldo, "vdd-l4-l12"), 123562306a36Sopenharmony_ci RPMH_VREG("ldo13", "ldo%s13", &pmic5_pldo, "vdd-l10-l11-l13"), 123662306a36Sopenharmony_ci RPMH_VREG("ldo14", "ldo%s14", &pmic5_nldo, "vdd-l14"), 123762306a36Sopenharmony_ci RPMH_VREG("ldo15", "ldo%s15", &pmic5_nldo, "vdd-l15"), 123862306a36Sopenharmony_ci RPMH_VREG("ldo16", "ldo%s16", &pmic5_pldo, "vdd-l16"), 123962306a36Sopenharmony_ci {} 124062306a36Sopenharmony_ci}; 124162306a36Sopenharmony_ci 124262306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pmx65_vreg_data[] = { 124362306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps510, "vdd-s1"), 124462306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_hfsmps510, "vdd-s2"), 124562306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_hfsmps510, "vdd-s3"), 124662306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_hfsmps510, "vdd-s4"), 124762306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_hfsmps510, "vdd-s5"), 124862306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps510, "vdd-s6"), 124962306a36Sopenharmony_ci RPMH_VREG("smps7", "smp%s7", &pmic5_hfsmps510, "vdd-s7"), 125062306a36Sopenharmony_ci RPMH_VREG("smps8", "smp%s8", &pmic5_hfsmps510, "vdd-s8"), 125162306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo, "vdd-l1"), 125262306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo, "vdd-l2-l18"), 125362306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo, "vdd-l3"), 125462306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo, "vdd-l4"), 125562306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo, "vdd-l5-l6-l16"), 125662306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo, "vdd-l5-l6-l16"), 125762306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_nldo, "vdd-l7"), 125862306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_nldo, "vdd-l8-l9"), 125962306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_nldo, "vdd-l8-l9"), 126062306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic5_pldo, "vdd-l10"), 126162306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic5_pldo, "vdd-l11-l13"), 126262306a36Sopenharmony_ci RPMH_VREG("ldo12", "ldo%s12", &pmic5_nldo, "vdd-l12"), 126362306a36Sopenharmony_ci RPMH_VREG("ldo13", "ldo%s13", &pmic5_pldo, "vdd-l11-l13"), 126462306a36Sopenharmony_ci RPMH_VREG("ldo14", "ldo%s14", &pmic5_nldo, "vdd-l14"), 126562306a36Sopenharmony_ci RPMH_VREG("ldo15", "ldo%s15", &pmic5_nldo, "vdd-l15"), 126662306a36Sopenharmony_ci RPMH_VREG("ldo16", "ldo%s16", &pmic5_pldo, "vdd-l5-l6-l16"), 126762306a36Sopenharmony_ci RPMH_VREG("ldo17", "ldo%s17", &pmic5_nldo, "vdd-l17"), 126862306a36Sopenharmony_ci /* ldo18 not configured */ 126962306a36Sopenharmony_ci RPMH_VREG("ldo19", "ldo%s19", &pmic5_nldo, "vdd-l19"), 127062306a36Sopenharmony_ci RPMH_VREG("ldo20", "ldo%s20", &pmic5_nldo, "vdd-l20"), 127162306a36Sopenharmony_ci RPMH_VREG("ldo21", "ldo%s21", &pmic5_nldo, "vdd-l21"), 127262306a36Sopenharmony_ci {} 127362306a36Sopenharmony_ci}; 127462306a36Sopenharmony_ci 127562306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pmx75_vreg_data[] = { 127662306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps525_lv, "vdd-s1"), 127762306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps525_lv, "vdd-s2"), 127862306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps525_lv, "vdd-s3"), 127962306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps525_mv, "vdd-s4"), 128062306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps525_lv, "vdd-s5"), 128162306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps525_lv, "vdd-s6"), 128262306a36Sopenharmony_ci RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps525_lv, "vdd-s7"), 128362306a36Sopenharmony_ci RPMH_VREG("smps8", "smp%s8", &pmic5_ftsmps525_lv, "vdd-s8"), 128462306a36Sopenharmony_ci RPMH_VREG("smps9", "smp%s9", &pmic5_ftsmps525_lv, "vdd-s9"), 128562306a36Sopenharmony_ci RPMH_VREG("smps10", "smp%s10", &pmic5_ftsmps525_lv, "vdd-s10"), 128662306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo515, "vdd-l1"), 128762306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo515, "vdd-l2-18"), 128862306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo515, "vdd-l3"), 128962306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo515, "vdd-l4-l16"), 129062306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_pldo_lv, "vdd-l5-l6"), 129162306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_pldo_lv, "vdd-l5-l6"), 129262306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_nldo515, "vdd-l7"), 129362306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_nldo515, "vdd-l8-l9"), 129462306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_nldo515, "vdd-l8-l9"), 129562306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic5_pldo, "vdd-l10"), 129662306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic5_pldo, "vdd-l11-l13"), 129762306a36Sopenharmony_ci RPMH_VREG("ldo12", "ldo%s12", &pmic5_nldo515, "vdd-l12"), 129862306a36Sopenharmony_ci RPMH_VREG("ldo13", "ldo%s13", &pmic5_pldo, "vdd-l11-l13"), 129962306a36Sopenharmony_ci RPMH_VREG("ldo14", "ldo%s14", &pmic5_nldo515, "vdd-l14"), 130062306a36Sopenharmony_ci RPMH_VREG("ldo15", "ldo%s15", &pmic5_nldo515, "vdd-l15"), 130162306a36Sopenharmony_ci RPMH_VREG("ldo16", "ldo%s16", &pmic5_nldo515, "vdd-l4-l16"), 130262306a36Sopenharmony_ci RPMH_VREG("ldo17", "ldo%s17", &pmic5_nldo515, "vdd-l17"), 130362306a36Sopenharmony_ci /* ldo18 not configured */ 130462306a36Sopenharmony_ci RPMH_VREG("ldo19", "ldo%s19", &pmic5_nldo515, "vdd-l19"), 130562306a36Sopenharmony_ci RPMH_VREG("ldo20", "ldo%s20", &pmic5_nldo515, "vdd-l20-l21"), 130662306a36Sopenharmony_ci RPMH_VREG("ldo21", "ldo%s21", &pmic5_nldo515, "vdd-l20-l21"), 130762306a36Sopenharmony_ci}; 130862306a36Sopenharmony_ci 130962306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm7325_vreg_data[] = { 131062306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_hfsmps510, "vdd-s1"), 131162306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps520, "vdd-s2"), 131262306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_ftsmps520, "vdd-s3"), 131362306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic5_ftsmps520, "vdd-s4"), 131462306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic5_ftsmps520, "vdd-s5"), 131562306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic5_ftsmps520, "vdd-s6"), 131662306a36Sopenharmony_ci RPMH_VREG("smps7", "smp%s7", &pmic5_ftsmps520, "vdd-s7"), 131762306a36Sopenharmony_ci RPMH_VREG("smps8", "smp%s8", &pmic5_hfsmps510, "vdd-s8"), 131862306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo, "vdd-l1-l4-l12-l15"), 131962306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_pldo, "vdd-l2-l7"), 132062306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo, "vdd-l3"), 132162306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_nldo, "vdd-l1-l4-l12-l15"), 132262306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_nldo, "vdd-l5"), 132362306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_nldo, "vdd-l6-l9-l10"), 132462306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo, "vdd-l2-l7"), 132562306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic5_nldo, "vdd-l8"), 132662306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic5_nldo, "vdd-l6-l9-l10"), 132762306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic5_nldo, "vdd-l6-l9-l10"), 132862306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic5_pldo_lv, "vdd-l11-l17-l18-l19"), 132962306a36Sopenharmony_ci RPMH_VREG("ldo12", "ldo%s12", &pmic5_nldo, "vdd-l1-l4-l12-l15"), 133062306a36Sopenharmony_ci RPMH_VREG("ldo13", "ldo%s13", &pmic5_nldo, "vdd-l13"), 133162306a36Sopenharmony_ci RPMH_VREG("ldo14", "ldo%s14", &pmic5_nldo, "vdd-l14-l16"), 133262306a36Sopenharmony_ci RPMH_VREG("ldo15", "ldo%s15", &pmic5_nldo, "vdd-l1-l4-l12-l15"), 133362306a36Sopenharmony_ci RPMH_VREG("ldo16", "ldo%s16", &pmic5_nldo, "vdd-l14-l16"), 133462306a36Sopenharmony_ci RPMH_VREG("ldo17", "ldo%s17", &pmic5_pldo_lv, "vdd-l11-l17-l18-l19"), 133562306a36Sopenharmony_ci RPMH_VREG("ldo18", "ldo%s18", &pmic5_pldo_lv, "vdd-l11-l17-l18-l19"), 133662306a36Sopenharmony_ci RPMH_VREG("ldo19", "ldo%s19", &pmic5_pldo_lv, "vdd-l11-l17-l18-l19"), 133762306a36Sopenharmony_ci {} 133862306a36Sopenharmony_ci}; 133962306a36Sopenharmony_ci 134062306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pmr735a_vreg_data[] = { 134162306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic5_ftsmps520, "vdd-s1"), 134262306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic5_ftsmps520, "vdd-s2"), 134362306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic5_hfsmps515, "vdd-s3"), 134462306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic5_nldo, "vdd-l1-l2"), 134562306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic5_nldo, "vdd-l1-l2"), 134662306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic5_nldo, "vdd-l3"), 134762306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic5_pldo_lv, "vdd-l4"), 134862306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic5_nldo, "vdd-l5-l6"), 134962306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic5_nldo, "vdd-l5-l6"), 135062306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic5_pldo, "vdd-l7-bob"), 135162306a36Sopenharmony_ci {} 135262306a36Sopenharmony_ci}; 135362306a36Sopenharmony_ci 135462306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm660_vreg_data[] = { 135562306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic4_ftsmps426, "vdd-s1"), 135662306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic4_ftsmps426, "vdd-s2"), 135762306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic4_ftsmps426, "vdd-s3"), 135862306a36Sopenharmony_ci RPMH_VREG("smps4", "smp%s4", &pmic4_hfsmps3, "vdd-s4"), 135962306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic4_hfsmps3, "vdd-s5"), 136062306a36Sopenharmony_ci RPMH_VREG("smps6", "smp%s6", &pmic4_hfsmps3, "vdd-s6"), 136162306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic4_nldo, "vdd-l1-l6-l7"), 136262306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic4_nldo, "vdd-l2-l3"), 136362306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic4_nldo, "vdd-l2-l3"), 136462306a36Sopenharmony_ci /* ldo4 is inaccessible on PM660 */ 136562306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic4_nldo, "vdd-l5"), 136662306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic4_nldo, "vdd-l1-l6-l7"), 136762306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic4_nldo, "vdd-l1-l6-l7"), 136862306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), 136962306a36Sopenharmony_ci RPMH_VREG("ldo9", "ldo%s9", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), 137062306a36Sopenharmony_ci RPMH_VREG("ldo10", "ldo%s10", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), 137162306a36Sopenharmony_ci RPMH_VREG("ldo11", "ldo%s11", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), 137262306a36Sopenharmony_ci RPMH_VREG("ldo12", "ldo%s12", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), 137362306a36Sopenharmony_ci RPMH_VREG("ldo13", "ldo%s13", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), 137462306a36Sopenharmony_ci RPMH_VREG("ldo14", "ldo%s14", &pmic4_pldo_lv, "vdd-l8-l9-l10-l11-l12-l13-l14"), 137562306a36Sopenharmony_ci RPMH_VREG("ldo15", "ldo%s15", &pmic4_pldo, "vdd-l15-l16-l17-l18-l19"), 137662306a36Sopenharmony_ci RPMH_VREG("ldo16", "ldo%s16", &pmic4_pldo, "vdd-l15-l16-l17-l18-l19"), 137762306a36Sopenharmony_ci RPMH_VREG("ldo17", "ldo%s17", &pmic4_pldo, "vdd-l15-l16-l17-l18-l19"), 137862306a36Sopenharmony_ci RPMH_VREG("ldo18", "ldo%s18", &pmic4_pldo, "vdd-l15-l16-l17-l18-l19"), 137962306a36Sopenharmony_ci RPMH_VREG("ldo19", "ldo%s19", &pmic4_pldo, "vdd-l15-l16-l17-l18-l19"), 138062306a36Sopenharmony_ci {} 138162306a36Sopenharmony_ci}; 138262306a36Sopenharmony_ci 138362306a36Sopenharmony_cistatic const struct rpmh_vreg_init_data pm660l_vreg_data[] = { 138462306a36Sopenharmony_ci RPMH_VREG("smps1", "smp%s1", &pmic4_ftsmps426, "vdd-s1"), 138562306a36Sopenharmony_ci RPMH_VREG("smps2", "smp%s2", &pmic4_ftsmps426, "vdd-s2"), 138662306a36Sopenharmony_ci RPMH_VREG("smps3", "smp%s3", &pmic4_ftsmps426, "vdd-s3-s4"), 138762306a36Sopenharmony_ci RPMH_VREG("smps5", "smp%s5", &pmic4_ftsmps426, "vdd-s5"), 138862306a36Sopenharmony_ci RPMH_VREG("ldo1", "ldo%s1", &pmic4_nldo, "vdd-l1-l9-l10"), 138962306a36Sopenharmony_ci RPMH_VREG("ldo2", "ldo%s2", &pmic4_pldo, "vdd-l2"), 139062306a36Sopenharmony_ci RPMH_VREG("ldo3", "ldo%s3", &pmic4_pldo, "vdd-l3-l5-l7-l8"), 139162306a36Sopenharmony_ci RPMH_VREG("ldo4", "ldo%s4", &pmic4_pldo, "vdd-l4-l6"), 139262306a36Sopenharmony_ci RPMH_VREG("ldo5", "ldo%s5", &pmic4_pldo, "vdd-l3-l5-l7-l8"), 139362306a36Sopenharmony_ci RPMH_VREG("ldo6", "ldo%s6", &pmic4_pldo, "vdd-l4-l6"), 139462306a36Sopenharmony_ci RPMH_VREG("ldo7", "ldo%s7", &pmic4_pldo, "vdd-l3-l5-l7-l8"), 139562306a36Sopenharmony_ci RPMH_VREG("ldo8", "ldo%s8", &pmic4_pldo, "vdd-l3-l5-l7-l8"), 139662306a36Sopenharmony_ci RPMH_VREG("bob", "bob%s1", &pmic4_bob, "vdd-bob"), 139762306a36Sopenharmony_ci {} 139862306a36Sopenharmony_ci}; 139962306a36Sopenharmony_ci 140062306a36Sopenharmony_cistatic int rpmh_regulator_probe(struct platform_device *pdev) 140162306a36Sopenharmony_ci{ 140262306a36Sopenharmony_ci struct device *dev = &pdev->dev; 140362306a36Sopenharmony_ci const struct rpmh_vreg_init_data *vreg_data; 140462306a36Sopenharmony_ci struct device_node *node; 140562306a36Sopenharmony_ci struct rpmh_vreg *vreg; 140662306a36Sopenharmony_ci const char *pmic_id; 140762306a36Sopenharmony_ci int ret; 140862306a36Sopenharmony_ci 140962306a36Sopenharmony_ci vreg_data = of_device_get_match_data(dev); 141062306a36Sopenharmony_ci if (!vreg_data) 141162306a36Sopenharmony_ci return -ENODEV; 141262306a36Sopenharmony_ci 141362306a36Sopenharmony_ci ret = of_property_read_string(dev->of_node, "qcom,pmic-id", &pmic_id); 141462306a36Sopenharmony_ci if (ret < 0) { 141562306a36Sopenharmony_ci dev_err(dev, "qcom,pmic-id missing in DT node\n"); 141662306a36Sopenharmony_ci return ret; 141762306a36Sopenharmony_ci } 141862306a36Sopenharmony_ci 141962306a36Sopenharmony_ci for_each_available_child_of_node(dev->of_node, node) { 142062306a36Sopenharmony_ci vreg = devm_kzalloc(dev, sizeof(*vreg), GFP_KERNEL); 142162306a36Sopenharmony_ci if (!vreg) { 142262306a36Sopenharmony_ci of_node_put(node); 142362306a36Sopenharmony_ci return -ENOMEM; 142462306a36Sopenharmony_ci } 142562306a36Sopenharmony_ci 142662306a36Sopenharmony_ci ret = rpmh_regulator_init_vreg(vreg, dev, node, pmic_id, 142762306a36Sopenharmony_ci vreg_data); 142862306a36Sopenharmony_ci if (ret < 0) { 142962306a36Sopenharmony_ci of_node_put(node); 143062306a36Sopenharmony_ci return ret; 143162306a36Sopenharmony_ci } 143262306a36Sopenharmony_ci } 143362306a36Sopenharmony_ci 143462306a36Sopenharmony_ci return 0; 143562306a36Sopenharmony_ci} 143662306a36Sopenharmony_ci 143762306a36Sopenharmony_cistatic const struct of_device_id __maybe_unused rpmh_regulator_match_table[] = { 143862306a36Sopenharmony_ci { 143962306a36Sopenharmony_ci .compatible = "qcom,pm8005-rpmh-regulators", 144062306a36Sopenharmony_ci .data = pm8005_vreg_data, 144162306a36Sopenharmony_ci }, 144262306a36Sopenharmony_ci { 144362306a36Sopenharmony_ci .compatible = "qcom,pm8009-rpmh-regulators", 144462306a36Sopenharmony_ci .data = pm8009_vreg_data, 144562306a36Sopenharmony_ci }, 144662306a36Sopenharmony_ci { 144762306a36Sopenharmony_ci .compatible = "qcom,pm8009-1-rpmh-regulators", 144862306a36Sopenharmony_ci .data = pm8009_1_vreg_data, 144962306a36Sopenharmony_ci }, 145062306a36Sopenharmony_ci { 145162306a36Sopenharmony_ci .compatible = "qcom,pm8150-rpmh-regulators", 145262306a36Sopenharmony_ci .data = pm8150_vreg_data, 145362306a36Sopenharmony_ci }, 145462306a36Sopenharmony_ci { 145562306a36Sopenharmony_ci .compatible = "qcom,pm8150l-rpmh-regulators", 145662306a36Sopenharmony_ci .data = pm8150l_vreg_data, 145762306a36Sopenharmony_ci }, 145862306a36Sopenharmony_ci { 145962306a36Sopenharmony_ci .compatible = "qcom,pm8350-rpmh-regulators", 146062306a36Sopenharmony_ci .data = pm8350_vreg_data, 146162306a36Sopenharmony_ci }, 146262306a36Sopenharmony_ci { 146362306a36Sopenharmony_ci .compatible = "qcom,pm8350c-rpmh-regulators", 146462306a36Sopenharmony_ci .data = pm8350c_vreg_data, 146562306a36Sopenharmony_ci }, 146662306a36Sopenharmony_ci { 146762306a36Sopenharmony_ci .compatible = "qcom,pm8450-rpmh-regulators", 146862306a36Sopenharmony_ci .data = pm8450_vreg_data, 146962306a36Sopenharmony_ci }, 147062306a36Sopenharmony_ci { 147162306a36Sopenharmony_ci .compatible = "qcom,pm8550-rpmh-regulators", 147262306a36Sopenharmony_ci .data = pm8550_vreg_data, 147362306a36Sopenharmony_ci }, 147462306a36Sopenharmony_ci { 147562306a36Sopenharmony_ci .compatible = "qcom,pm8550ve-rpmh-regulators", 147662306a36Sopenharmony_ci .data = pm8550ve_vreg_data, 147762306a36Sopenharmony_ci }, 147862306a36Sopenharmony_ci { 147962306a36Sopenharmony_ci .compatible = "qcom,pm8550vs-rpmh-regulators", 148062306a36Sopenharmony_ci .data = pm8550vs_vreg_data, 148162306a36Sopenharmony_ci }, 148262306a36Sopenharmony_ci { 148362306a36Sopenharmony_ci .compatible = "qcom,pm8998-rpmh-regulators", 148462306a36Sopenharmony_ci .data = pm8998_vreg_data, 148562306a36Sopenharmony_ci }, 148662306a36Sopenharmony_ci { 148762306a36Sopenharmony_ci .compatible = "qcom,pmg1110-rpmh-regulators", 148862306a36Sopenharmony_ci .data = pmg1110_vreg_data, 148962306a36Sopenharmony_ci }, 149062306a36Sopenharmony_ci { 149162306a36Sopenharmony_ci .compatible = "qcom,pmi8998-rpmh-regulators", 149262306a36Sopenharmony_ci .data = pmi8998_vreg_data, 149362306a36Sopenharmony_ci }, 149462306a36Sopenharmony_ci { 149562306a36Sopenharmony_ci .compatible = "qcom,pm6150-rpmh-regulators", 149662306a36Sopenharmony_ci .data = pm6150_vreg_data, 149762306a36Sopenharmony_ci }, 149862306a36Sopenharmony_ci { 149962306a36Sopenharmony_ci .compatible = "qcom,pm6150l-rpmh-regulators", 150062306a36Sopenharmony_ci .data = pm6150l_vreg_data, 150162306a36Sopenharmony_ci }, 150262306a36Sopenharmony_ci { 150362306a36Sopenharmony_ci .compatible = "qcom,pm6350-rpmh-regulators", 150462306a36Sopenharmony_ci .data = pm6350_vreg_data, 150562306a36Sopenharmony_ci }, 150662306a36Sopenharmony_ci { 150762306a36Sopenharmony_ci .compatible = "qcom,pmc8180-rpmh-regulators", 150862306a36Sopenharmony_ci .data = pm8150_vreg_data, 150962306a36Sopenharmony_ci }, 151062306a36Sopenharmony_ci { 151162306a36Sopenharmony_ci .compatible = "qcom,pmc8180c-rpmh-regulators", 151262306a36Sopenharmony_ci .data = pm8150l_vreg_data, 151362306a36Sopenharmony_ci }, 151462306a36Sopenharmony_ci { 151562306a36Sopenharmony_ci .compatible = "qcom,pmm8155au-rpmh-regulators", 151662306a36Sopenharmony_ci .data = pmm8155au_vreg_data, 151762306a36Sopenharmony_ci }, 151862306a36Sopenharmony_ci { 151962306a36Sopenharmony_ci .compatible = "qcom,pmm8654au-rpmh-regulators", 152062306a36Sopenharmony_ci .data = pmm8654au_vreg_data, 152162306a36Sopenharmony_ci }, 152262306a36Sopenharmony_ci { 152362306a36Sopenharmony_ci .compatible = "qcom,pmx55-rpmh-regulators", 152462306a36Sopenharmony_ci .data = pmx55_vreg_data, 152562306a36Sopenharmony_ci }, 152662306a36Sopenharmony_ci { 152762306a36Sopenharmony_ci .compatible = "qcom,pmx65-rpmh-regulators", 152862306a36Sopenharmony_ci .data = pmx65_vreg_data, 152962306a36Sopenharmony_ci }, 153062306a36Sopenharmony_ci { 153162306a36Sopenharmony_ci .compatible = "qcom,pmx75-rpmh-regulators", 153262306a36Sopenharmony_ci .data = pmx75_vreg_data, 153362306a36Sopenharmony_ci }, 153462306a36Sopenharmony_ci { 153562306a36Sopenharmony_ci .compatible = "qcom,pm7325-rpmh-regulators", 153662306a36Sopenharmony_ci .data = pm7325_vreg_data, 153762306a36Sopenharmony_ci }, 153862306a36Sopenharmony_ci { 153962306a36Sopenharmony_ci .compatible = "qcom,pmr735a-rpmh-regulators", 154062306a36Sopenharmony_ci .data = pmr735a_vreg_data, 154162306a36Sopenharmony_ci }, 154262306a36Sopenharmony_ci { 154362306a36Sopenharmony_ci .compatible = "qcom,pm660-rpmh-regulators", 154462306a36Sopenharmony_ci .data = pm660_vreg_data, 154562306a36Sopenharmony_ci }, 154662306a36Sopenharmony_ci { 154762306a36Sopenharmony_ci .compatible = "qcom,pm660l-rpmh-regulators", 154862306a36Sopenharmony_ci .data = pm660l_vreg_data, 154962306a36Sopenharmony_ci }, 155062306a36Sopenharmony_ci {} 155162306a36Sopenharmony_ci}; 155262306a36Sopenharmony_ciMODULE_DEVICE_TABLE(of, rpmh_regulator_match_table); 155362306a36Sopenharmony_ci 155462306a36Sopenharmony_cistatic struct platform_driver rpmh_regulator_driver = { 155562306a36Sopenharmony_ci .driver = { 155662306a36Sopenharmony_ci .name = "qcom-rpmh-regulator", 155762306a36Sopenharmony_ci .probe_type = PROBE_PREFER_ASYNCHRONOUS, 155862306a36Sopenharmony_ci .of_match_table = of_match_ptr(rpmh_regulator_match_table), 155962306a36Sopenharmony_ci }, 156062306a36Sopenharmony_ci .probe = rpmh_regulator_probe, 156162306a36Sopenharmony_ci}; 156262306a36Sopenharmony_cimodule_platform_driver(rpmh_regulator_driver); 156362306a36Sopenharmony_ci 156462306a36Sopenharmony_ciMODULE_DESCRIPTION("Qualcomm RPMh regulator driver"); 156562306a36Sopenharmony_ciMODULE_LICENSE("GPL v2"); 1566