197fb5e8dSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-only 2da65e367SBjorn Andersson /* 3da65e367SBjorn Andersson * Copyright (c) 2015, Sony Mobile Communications AB. 4da65e367SBjorn Andersson * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. 5da65e367SBjorn Andersson */ 6da65e367SBjorn Andersson 7da65e367SBjorn Andersson #include <linux/module.h> 8da65e367SBjorn Andersson #include <linux/of.h> 9da65e367SBjorn Andersson #include <linux/of_device.h> 10da65e367SBjorn Andersson #include <linux/platform_device.h> 11da65e367SBjorn Andersson #include <linux/regulator/driver.h> 1214e2976fSKonrad Dybcio #include <linux/regulator/of_regulator.h> 13da65e367SBjorn Andersson #include <linux/soc/qcom/smd-rpm.h> 14da65e367SBjorn Andersson 15da65e367SBjorn Andersson struct qcom_rpm_reg { 16da65e367SBjorn Andersson struct device *dev; 17da65e367SBjorn Andersson 18da65e367SBjorn Andersson struct qcom_smd_rpm *rpm; 19da65e367SBjorn Andersson 20da65e367SBjorn Andersson u32 type; 21da65e367SBjorn Andersson u32 id; 22da65e367SBjorn Andersson 23da65e367SBjorn Andersson struct regulator_desc desc; 24da65e367SBjorn Andersson 25da65e367SBjorn Andersson int is_enabled; 26da65e367SBjorn Andersson int uV; 27fd805d99SBjorn Andersson u32 load; 28fd805d99SBjorn Andersson 29fd805d99SBjorn Andersson unsigned int enabled_updated:1; 30fd805d99SBjorn Andersson unsigned int uv_updated:1; 31fd805d99SBjorn Andersson unsigned int load_updated:1; 32da65e367SBjorn Andersson }; 33da65e367SBjorn Andersson 34da65e367SBjorn Andersson struct rpm_regulator_req { 352c652a98SStephen Boyd __le32 key; 362c652a98SStephen Boyd __le32 nbytes; 372c652a98SStephen Boyd __le32 value; 38da65e367SBjorn Andersson }; 39da65e367SBjorn Andersson 40da65e367SBjorn Andersson #define RPM_KEY_SWEN 0x6e657773 /* "swen" */ 41da65e367SBjorn Andersson #define RPM_KEY_UV 0x00007675 /* "uv" */ 42da65e367SBjorn Andersson #define RPM_KEY_MA 0x0000616d /* "ma" */ 43da65e367SBjorn Andersson 44fd805d99SBjorn Andersson static int rpm_reg_write_active(struct qcom_rpm_reg *vreg) 45da65e367SBjorn Andersson { 46fd805d99SBjorn Andersson struct rpm_regulator_req req[3]; 47fd805d99SBjorn Andersson int reqlen = 0; 48fd805d99SBjorn Andersson int ret; 49fd805d99SBjorn Andersson 50fd805d99SBjorn Andersson if (vreg->enabled_updated) { 51fd805d99SBjorn Andersson req[reqlen].key = cpu_to_le32(RPM_KEY_SWEN); 52fd805d99SBjorn Andersson req[reqlen].nbytes = cpu_to_le32(sizeof(u32)); 53fd805d99SBjorn Andersson req[reqlen].value = cpu_to_le32(vreg->is_enabled); 54fd805d99SBjorn Andersson reqlen++; 55fd805d99SBjorn Andersson } 56fd805d99SBjorn Andersson 57fd805d99SBjorn Andersson if (vreg->uv_updated && vreg->is_enabled) { 58fd805d99SBjorn Andersson req[reqlen].key = cpu_to_le32(RPM_KEY_UV); 59fd805d99SBjorn Andersson req[reqlen].nbytes = cpu_to_le32(sizeof(u32)); 60fd805d99SBjorn Andersson req[reqlen].value = cpu_to_le32(vreg->uV); 61fd805d99SBjorn Andersson reqlen++; 62fd805d99SBjorn Andersson } 63fd805d99SBjorn Andersson 64fd805d99SBjorn Andersson if (vreg->load_updated && vreg->is_enabled) { 65fd805d99SBjorn Andersson req[reqlen].key = cpu_to_le32(RPM_KEY_MA); 66fd805d99SBjorn Andersson req[reqlen].nbytes = cpu_to_le32(sizeof(u32)); 67fd805d99SBjorn Andersson req[reqlen].value = cpu_to_le32(vreg->load / 1000); 68fd805d99SBjorn Andersson reqlen++; 69fd805d99SBjorn Andersson } 70fd805d99SBjorn Andersson 71fd805d99SBjorn Andersson if (!reqlen) 72fd805d99SBjorn Andersson return 0; 73fd805d99SBjorn Andersson 74fd805d99SBjorn Andersson ret = qcom_rpm_smd_write(vreg->rpm, QCOM_SMD_RPM_ACTIVE_STATE, 75fd805d99SBjorn Andersson vreg->type, vreg->id, 76fd805d99SBjorn Andersson req, sizeof(req[0]) * reqlen); 77fd805d99SBjorn Andersson if (!ret) { 78fd805d99SBjorn Andersson vreg->enabled_updated = 0; 79fd805d99SBjorn Andersson vreg->uv_updated = 0; 80fd805d99SBjorn Andersson vreg->load_updated = 0; 81fd805d99SBjorn Andersson } 82fd805d99SBjorn Andersson 83fd805d99SBjorn Andersson return ret; 84da65e367SBjorn Andersson } 85da65e367SBjorn Andersson 86da65e367SBjorn Andersson static int rpm_reg_enable(struct regulator_dev *rdev) 87da65e367SBjorn Andersson { 88da65e367SBjorn Andersson struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev); 89da65e367SBjorn Andersson int ret; 90da65e367SBjorn Andersson 91da65e367SBjorn Andersson vreg->is_enabled = 1; 92fd805d99SBjorn Andersson vreg->enabled_updated = 1; 93fd805d99SBjorn Andersson 94fd805d99SBjorn Andersson ret = rpm_reg_write_active(vreg); 95fd805d99SBjorn Andersson if (ret) 96fd805d99SBjorn Andersson vreg->is_enabled = 0; 97da65e367SBjorn Andersson 98da65e367SBjorn Andersson return ret; 99da65e367SBjorn Andersson } 100da65e367SBjorn Andersson 101da65e367SBjorn Andersson static int rpm_reg_is_enabled(struct regulator_dev *rdev) 102da65e367SBjorn Andersson { 103da65e367SBjorn Andersson struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev); 104da65e367SBjorn Andersson 105da65e367SBjorn Andersson return vreg->is_enabled; 106da65e367SBjorn Andersson } 107da65e367SBjorn Andersson 108da65e367SBjorn Andersson static int rpm_reg_disable(struct regulator_dev *rdev) 109da65e367SBjorn Andersson { 110da65e367SBjorn Andersson struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev); 111da65e367SBjorn Andersson int ret; 112da65e367SBjorn Andersson 113da65e367SBjorn Andersson vreg->is_enabled = 0; 114fd805d99SBjorn Andersson vreg->enabled_updated = 1; 115fd805d99SBjorn Andersson 116fd805d99SBjorn Andersson ret = rpm_reg_write_active(vreg); 117fd805d99SBjorn Andersson if (ret) 118fd805d99SBjorn Andersson vreg->is_enabled = 1; 119da65e367SBjorn Andersson 120da65e367SBjorn Andersson return ret; 121da65e367SBjorn Andersson } 122da65e367SBjorn Andersson 123da65e367SBjorn Andersson static int rpm_reg_get_voltage(struct regulator_dev *rdev) 124da65e367SBjorn Andersson { 125da65e367SBjorn Andersson struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev); 126da65e367SBjorn Andersson 127da65e367SBjorn Andersson return vreg->uV; 128da65e367SBjorn Andersson } 129da65e367SBjorn Andersson 130da65e367SBjorn Andersson static int rpm_reg_set_voltage(struct regulator_dev *rdev, 131da65e367SBjorn Andersson int min_uV, 132da65e367SBjorn Andersson int max_uV, 133da65e367SBjorn Andersson unsigned *selector) 134da65e367SBjorn Andersson { 135da65e367SBjorn Andersson struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev); 136fd805d99SBjorn Andersson int ret; 137fd805d99SBjorn Andersson int old_uV = vreg->uV; 138da65e367SBjorn Andersson 139da65e367SBjorn Andersson vreg->uV = min_uV; 140fd805d99SBjorn Andersson vreg->uv_updated = 1; 141fd805d99SBjorn Andersson 142fd805d99SBjorn Andersson ret = rpm_reg_write_active(vreg); 143fd805d99SBjorn Andersson if (ret) 144fd805d99SBjorn Andersson vreg->uV = old_uV; 145da65e367SBjorn Andersson 146da65e367SBjorn Andersson return ret; 147da65e367SBjorn Andersson } 148da65e367SBjorn Andersson 149da65e367SBjorn Andersson static int rpm_reg_set_load(struct regulator_dev *rdev, int load_uA) 150da65e367SBjorn Andersson { 151da65e367SBjorn Andersson struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev); 152fd805d99SBjorn Andersson u32 old_load = vreg->load; 153fd805d99SBjorn Andersson int ret; 154da65e367SBjorn Andersson 155fd805d99SBjorn Andersson vreg->load = load_uA; 156fd805d99SBjorn Andersson vreg->load_updated = 1; 157fd805d99SBjorn Andersson ret = rpm_reg_write_active(vreg); 158fd805d99SBjorn Andersson if (ret) 159fd805d99SBjorn Andersson vreg->load = old_load; 160da65e367SBjorn Andersson 161fd805d99SBjorn Andersson return ret; 162da65e367SBjorn Andersson } 163da65e367SBjorn Andersson 164da65e367SBjorn Andersson static const struct regulator_ops rpm_smps_ldo_ops = { 165da65e367SBjorn Andersson .enable = rpm_reg_enable, 166da65e367SBjorn Andersson .disable = rpm_reg_disable, 167da65e367SBjorn Andersson .is_enabled = rpm_reg_is_enabled, 168a8a47540SSrinivas Kandagatla .list_voltage = regulator_list_voltage_linear_range, 169da65e367SBjorn Andersson 170da65e367SBjorn Andersson .get_voltage = rpm_reg_get_voltage, 171da65e367SBjorn Andersson .set_voltage = rpm_reg_set_voltage, 172da65e367SBjorn Andersson 173da65e367SBjorn Andersson .set_load = rpm_reg_set_load, 174da65e367SBjorn Andersson }; 175da65e367SBjorn Andersson 176d1e44b6bSSrinivas Kandagatla static const struct regulator_ops rpm_smps_ldo_ops_fixed = { 177d1e44b6bSSrinivas Kandagatla .enable = rpm_reg_enable, 178d1e44b6bSSrinivas Kandagatla .disable = rpm_reg_disable, 179d1e44b6bSSrinivas Kandagatla .is_enabled = rpm_reg_is_enabled, 180d1e44b6bSSrinivas Kandagatla 181d1e44b6bSSrinivas Kandagatla .get_voltage = rpm_reg_get_voltage, 182d1e44b6bSSrinivas Kandagatla .set_voltage = rpm_reg_set_voltage, 183d1e44b6bSSrinivas Kandagatla 184d1e44b6bSSrinivas Kandagatla .set_load = rpm_reg_set_load, 185d1e44b6bSSrinivas Kandagatla }; 186d1e44b6bSSrinivas Kandagatla 187da65e367SBjorn Andersson static const struct regulator_ops rpm_switch_ops = { 188da65e367SBjorn Andersson .enable = rpm_reg_enable, 189da65e367SBjorn Andersson .disable = rpm_reg_disable, 190da65e367SBjorn Andersson .is_enabled = rpm_reg_is_enabled, 191da65e367SBjorn Andersson }; 192da65e367SBjorn Andersson 1933cdb741eSBjorn Andersson static const struct regulator_ops rpm_bob_ops = { 1943cdb741eSBjorn Andersson .enable = rpm_reg_enable, 1953cdb741eSBjorn Andersson .disable = rpm_reg_disable, 1963cdb741eSBjorn Andersson .is_enabled = rpm_reg_is_enabled, 1973cdb741eSBjorn Andersson 1983cdb741eSBjorn Andersson .get_voltage = rpm_reg_get_voltage, 1993cdb741eSBjorn Andersson .set_voltage = rpm_reg_set_voltage, 2003cdb741eSBjorn Andersson }; 2013cdb741eSBjorn Andersson 20247894c85SKathiravan T static const struct regulator_ops rpm_mp5496_ops = { 20347894c85SKathiravan T .enable = rpm_reg_enable, 20447894c85SKathiravan T .disable = rpm_reg_disable, 20547894c85SKathiravan T .is_enabled = rpm_reg_is_enabled, 20647894c85SKathiravan T .list_voltage = regulator_list_voltage_linear_range, 20747894c85SKathiravan T 20847894c85SKathiravan T .set_voltage = rpm_reg_set_voltage, 20947894c85SKathiravan T }; 21047894c85SKathiravan T 211ee01d0c9SAndy Gross static const struct regulator_desc pma8084_hfsmps = { 21260ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 213ee01d0c9SAndy Gross REGULATOR_LINEAR_RANGE(375000, 0, 95, 12500), 214ee01d0c9SAndy Gross REGULATOR_LINEAR_RANGE(1550000, 96, 158, 25000), 215ee01d0c9SAndy Gross }, 216ee01d0c9SAndy Gross .n_linear_ranges = 2, 217ee01d0c9SAndy Gross .n_voltages = 159, 218ee01d0c9SAndy Gross .ops = &rpm_smps_ldo_ops, 219ee01d0c9SAndy Gross }; 220ee01d0c9SAndy Gross 221ee01d0c9SAndy Gross static const struct regulator_desc pma8084_ftsmps = { 22260ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 223ee01d0c9SAndy Gross REGULATOR_LINEAR_RANGE(350000, 0, 184, 5000), 224c488f007SStephen Boyd REGULATOR_LINEAR_RANGE(1280000, 185, 261, 10000), 225ee01d0c9SAndy Gross }, 226ee01d0c9SAndy Gross .n_linear_ranges = 2, 227c488f007SStephen Boyd .n_voltages = 262, 228ee01d0c9SAndy Gross .ops = &rpm_smps_ldo_ops, 229ee01d0c9SAndy Gross }; 230ee01d0c9SAndy Gross 231ee01d0c9SAndy Gross static const struct regulator_desc pma8084_pldo = { 23260ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 233c488f007SStephen Boyd REGULATOR_LINEAR_RANGE( 750000, 0, 63, 12500), 234c488f007SStephen Boyd REGULATOR_LINEAR_RANGE(1550000, 64, 126, 25000), 235c488f007SStephen Boyd REGULATOR_LINEAR_RANGE(3100000, 127, 163, 50000), 236ee01d0c9SAndy Gross }, 237c488f007SStephen Boyd .n_linear_ranges = 3, 238c488f007SStephen Boyd .n_voltages = 164, 239ee01d0c9SAndy Gross .ops = &rpm_smps_ldo_ops, 240ee01d0c9SAndy Gross }; 241ee01d0c9SAndy Gross 242ee01d0c9SAndy Gross static const struct regulator_desc pma8084_nldo = { 24360ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 244ee01d0c9SAndy Gross REGULATOR_LINEAR_RANGE(750000, 0, 63, 12500), 245ee01d0c9SAndy Gross }, 246ee01d0c9SAndy Gross .n_linear_ranges = 1, 247ee01d0c9SAndy Gross .n_voltages = 64, 248ee01d0c9SAndy Gross .ops = &rpm_smps_ldo_ops, 249ee01d0c9SAndy Gross }; 250ee01d0c9SAndy Gross 251ee01d0c9SAndy Gross static const struct regulator_desc pma8084_switch = { 252ee01d0c9SAndy Gross .ops = &rpm_switch_ops, 253ee01d0c9SAndy Gross }; 254ee01d0c9SAndy Gross 2558c816d56SBartosz Dudziak static const struct regulator_desc pm8226_hfsmps = { 2568c816d56SBartosz Dudziak .linear_ranges = (struct linear_range[]) { 2578c816d56SBartosz Dudziak REGULATOR_LINEAR_RANGE(375000, 0, 95, 12500), 2588c816d56SBartosz Dudziak REGULATOR_LINEAR_RANGE(1575000, 96, 158, 25000), 2598c816d56SBartosz Dudziak }, 2608c816d56SBartosz Dudziak .n_linear_ranges = 2, 2618c816d56SBartosz Dudziak .n_voltages = 159, 2628c816d56SBartosz Dudziak .ops = &rpm_smps_ldo_ops, 2638c816d56SBartosz Dudziak }; 2648c816d56SBartosz Dudziak 2658c816d56SBartosz Dudziak static const struct regulator_desc pm8226_ftsmps = { 2668c816d56SBartosz Dudziak .linear_ranges = (struct linear_range[]) { 2678c816d56SBartosz Dudziak REGULATOR_LINEAR_RANGE(350000, 0, 184, 5000), 2688c816d56SBartosz Dudziak REGULATOR_LINEAR_RANGE(1280000, 185, 261, 10000), 2698c816d56SBartosz Dudziak }, 2708c816d56SBartosz Dudziak .n_linear_ranges = 2, 2718c816d56SBartosz Dudziak .n_voltages = 262, 2728c816d56SBartosz Dudziak .ops = &rpm_smps_ldo_ops, 2738c816d56SBartosz Dudziak }; 2748c816d56SBartosz Dudziak 2758c816d56SBartosz Dudziak static const struct regulator_desc pm8226_pldo = { 2768c816d56SBartosz Dudziak .linear_ranges = (struct linear_range[]) { 2778c816d56SBartosz Dudziak REGULATOR_LINEAR_RANGE(750000, 0, 63, 12500), 2788c816d56SBartosz Dudziak REGULATOR_LINEAR_RANGE(1550000, 64, 126, 25000), 2798c816d56SBartosz Dudziak REGULATOR_LINEAR_RANGE(3100000, 127, 163, 50000), 2808c816d56SBartosz Dudziak }, 2818c816d56SBartosz Dudziak .n_linear_ranges = 3, 2828c816d56SBartosz Dudziak .n_voltages = 164, 2838c816d56SBartosz Dudziak .ops = &rpm_smps_ldo_ops, 2848c816d56SBartosz Dudziak }; 2858c816d56SBartosz Dudziak 2868c816d56SBartosz Dudziak static const struct regulator_desc pm8226_nldo = { 2878c816d56SBartosz Dudziak .linear_ranges = (struct linear_range[]) { 2888c816d56SBartosz Dudziak REGULATOR_LINEAR_RANGE(750000, 0, 63, 12500), 2898c816d56SBartosz Dudziak }, 2908c816d56SBartosz Dudziak .n_linear_ranges = 1, 2918c816d56SBartosz Dudziak .n_voltages = 64, 2928c816d56SBartosz Dudziak .ops = &rpm_smps_ldo_ops, 2938c816d56SBartosz Dudziak }; 2948c816d56SBartosz Dudziak 2958c816d56SBartosz Dudziak static const struct regulator_desc pm8226_switch = { 2968c816d56SBartosz Dudziak .ops = &rpm_switch_ops, 2978c816d56SBartosz Dudziak }; 2988c816d56SBartosz Dudziak 299da65e367SBjorn Andersson static const struct regulator_desc pm8x41_hfsmps = { 30060ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 301da65e367SBjorn Andersson REGULATOR_LINEAR_RANGE( 375000, 0, 95, 12500), 302b7a8524cSStephen Boyd REGULATOR_LINEAR_RANGE(1575000, 96, 158, 25000), 303da65e367SBjorn Andersson }, 304da65e367SBjorn Andersson .n_linear_ranges = 2, 305da65e367SBjorn Andersson .n_voltages = 159, 306da65e367SBjorn Andersson .ops = &rpm_smps_ldo_ops, 307da65e367SBjorn Andersson }; 308da65e367SBjorn Andersson 309da65e367SBjorn Andersson static const struct regulator_desc pm8841_ftsmps = { 31060ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 311da65e367SBjorn Andersson REGULATOR_LINEAR_RANGE(350000, 0, 184, 5000), 31229028477SStephen Boyd REGULATOR_LINEAR_RANGE(1280000, 185, 261, 10000), 313da65e367SBjorn Andersson }, 314da65e367SBjorn Andersson .n_linear_ranges = 2, 31529028477SStephen Boyd .n_voltages = 262, 316da65e367SBjorn Andersson .ops = &rpm_smps_ldo_ops, 317da65e367SBjorn Andersson }; 318da65e367SBjorn Andersson 319da65e367SBjorn Andersson static const struct regulator_desc pm8941_boost = { 32060ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 32129028477SStephen Boyd REGULATOR_LINEAR_RANGE(4000000, 0, 30, 50000), 322da65e367SBjorn Andersson }, 323da65e367SBjorn Andersson .n_linear_ranges = 1, 32429028477SStephen Boyd .n_voltages = 31, 325da65e367SBjorn Andersson .ops = &rpm_smps_ldo_ops, 326da65e367SBjorn Andersson }; 327da65e367SBjorn Andersson 328da65e367SBjorn Andersson static const struct regulator_desc pm8941_pldo = { 32960ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 33029028477SStephen Boyd REGULATOR_LINEAR_RANGE( 750000, 0, 63, 12500), 33129028477SStephen Boyd REGULATOR_LINEAR_RANGE(1550000, 64, 126, 25000), 33229028477SStephen Boyd REGULATOR_LINEAR_RANGE(3100000, 127, 163, 50000), 333da65e367SBjorn Andersson }, 33429028477SStephen Boyd .n_linear_ranges = 3, 33529028477SStephen Boyd .n_voltages = 164, 336da65e367SBjorn Andersson .ops = &rpm_smps_ldo_ops, 337da65e367SBjorn Andersson }; 338da65e367SBjorn Andersson 339da65e367SBjorn Andersson static const struct regulator_desc pm8941_nldo = { 34060ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 341da65e367SBjorn Andersson REGULATOR_LINEAR_RANGE(750000, 0, 63, 12500), 342da65e367SBjorn Andersson }, 343da65e367SBjorn Andersson .n_linear_ranges = 1, 344da65e367SBjorn Andersson .n_voltages = 64, 345da65e367SBjorn Andersson .ops = &rpm_smps_ldo_ops, 346da65e367SBjorn Andersson }; 347da65e367SBjorn Andersson 348da65e367SBjorn Andersson static const struct regulator_desc pm8941_lnldo = { 349da65e367SBjorn Andersson .fixed_uV = 1740000, 3505a286aaeSAxel Lin .n_voltages = 1, 351d1e44b6bSSrinivas Kandagatla .ops = &rpm_smps_ldo_ops_fixed, 352da65e367SBjorn Andersson }; 353da65e367SBjorn Andersson 354da65e367SBjorn Andersson static const struct regulator_desc pm8941_switch = { 355da65e367SBjorn Andersson .ops = &rpm_switch_ops, 356da65e367SBjorn Andersson }; 357da65e367SBjorn Andersson 35857d65676SAndy Gross static const struct regulator_desc pm8916_pldo = { 35960ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 360*e8977917SStephan Gerhold REGULATOR_LINEAR_RANGE(1750000, 0, 127, 12500), 36157d65676SAndy Gross }, 36257d65676SAndy Gross .n_linear_ranges = 1, 363*e8977917SStephan Gerhold .n_voltages = 128, 36457d65676SAndy Gross .ops = &rpm_smps_ldo_ops, 36557d65676SAndy Gross }; 36657d65676SAndy Gross 36757d65676SAndy Gross static const struct regulator_desc pm8916_nldo = { 36860ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 36957d65676SAndy Gross REGULATOR_LINEAR_RANGE(375000, 0, 93, 12500), 37057d65676SAndy Gross }, 37157d65676SAndy Gross .n_linear_ranges = 1, 37257d65676SAndy Gross .n_voltages = 94, 37357d65676SAndy Gross .ops = &rpm_smps_ldo_ops, 37457d65676SAndy Gross }; 37557d65676SAndy Gross 37657d65676SAndy Gross static const struct regulator_desc pm8916_buck_lvo_smps = { 37760ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 37857d65676SAndy Gross REGULATOR_LINEAR_RANGE(375000, 0, 95, 12500), 37957d65676SAndy Gross REGULATOR_LINEAR_RANGE(750000, 96, 127, 25000), 38057d65676SAndy Gross }, 38157d65676SAndy Gross .n_linear_ranges = 2, 38257d65676SAndy Gross .n_voltages = 128, 38357d65676SAndy Gross .ops = &rpm_smps_ldo_ops, 38457d65676SAndy Gross }; 38557d65676SAndy Gross 38657d65676SAndy Gross static const struct regulator_desc pm8916_buck_hvo_smps = { 38760ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 38857d65676SAndy Gross REGULATOR_LINEAR_RANGE(1550000, 0, 31, 25000), 38957d65676SAndy Gross }, 39057d65676SAndy Gross .n_linear_ranges = 1, 39157d65676SAndy Gross .n_voltages = 32, 39257d65676SAndy Gross .ops = &rpm_smps_ldo_ops, 39357d65676SAndy Gross }; 39457d65676SAndy Gross 395e44adca5SAngelo G. Del Regno static const struct regulator_desc pm8950_hfsmps = { 39660ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 397e44adca5SAngelo G. Del Regno REGULATOR_LINEAR_RANGE(375000, 0, 95, 12500), 398e44adca5SAngelo G. Del Regno REGULATOR_LINEAR_RANGE(1550000, 96, 127, 25000), 399e44adca5SAngelo G. Del Regno }, 400e44adca5SAngelo G. Del Regno .n_linear_ranges = 2, 401e44adca5SAngelo G. Del Regno .n_voltages = 128, 402e44adca5SAngelo G. Del Regno .ops = &rpm_smps_ldo_ops, 403e44adca5SAngelo G. Del Regno }; 404e44adca5SAngelo G. Del Regno 405e44adca5SAngelo G. Del Regno static const struct regulator_desc pm8950_ftsmps2p5 = { 40660ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 407e44adca5SAngelo G. Del Regno REGULATOR_LINEAR_RANGE(80000, 0, 255, 5000), 408e44adca5SAngelo G. Del Regno REGULATOR_LINEAR_RANGE(160000, 256, 460, 10000), 409e44adca5SAngelo G. Del Regno }, 410e44adca5SAngelo G. Del Regno .n_linear_ranges = 2, 411e44adca5SAngelo G. Del Regno .n_voltages = 461, 412e44adca5SAngelo G. Del Regno .ops = &rpm_smps_ldo_ops, 413e44adca5SAngelo G. Del Regno }; 414e44adca5SAngelo G. Del Regno 415e44adca5SAngelo G. Del Regno static const struct regulator_desc pm8950_ult_nldo = { 41660ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 417e44adca5SAngelo G. Del Regno REGULATOR_LINEAR_RANGE(375000, 0, 202, 12500), 418e44adca5SAngelo G. Del Regno }, 419e44adca5SAngelo G. Del Regno .n_linear_ranges = 1, 420e44adca5SAngelo G. Del Regno .n_voltages = 203, 421e44adca5SAngelo G. Del Regno .ops = &rpm_smps_ldo_ops, 422e44adca5SAngelo G. Del Regno }; 423e44adca5SAngelo G. Del Regno 424e44adca5SAngelo G. Del Regno static const struct regulator_desc pm8950_ult_pldo = { 42560ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 426e44adca5SAngelo G. Del Regno REGULATOR_LINEAR_RANGE(1750000, 0, 127, 12500), 427e44adca5SAngelo G. Del Regno }, 428e44adca5SAngelo G. Del Regno .n_linear_ranges = 1, 429e44adca5SAngelo G. Del Regno .n_voltages = 128, 430e44adca5SAngelo G. Del Regno .ops = &rpm_smps_ldo_ops, 431e44adca5SAngelo G. Del Regno }; 432e44adca5SAngelo G. Del Regno 433e44adca5SAngelo G. Del Regno static const struct regulator_desc pm8950_pldo_lv = { 43460ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 435e44adca5SAngelo G. Del Regno REGULATOR_LINEAR_RANGE(1500000, 0, 16, 25000), 436e44adca5SAngelo G. Del Regno }, 437e44adca5SAngelo G. Del Regno .n_linear_ranges = 1, 438e44adca5SAngelo G. Del Regno .n_voltages = 17, 439e44adca5SAngelo G. Del Regno .ops = &rpm_smps_ldo_ops, 440e44adca5SAngelo G. Del Regno }; 441e44adca5SAngelo G. Del Regno 442e44adca5SAngelo G. Del Regno static const struct regulator_desc pm8950_pldo = { 44360ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 444e44adca5SAngelo G. Del Regno REGULATOR_LINEAR_RANGE(975000, 0, 164, 12500), 445e44adca5SAngelo G. Del Regno }, 446e44adca5SAngelo G. Del Regno .n_linear_ranges = 1, 447e44adca5SAngelo G. Del Regno .n_voltages = 165, 448e44adca5SAngelo G. Del Regno .ops = &rpm_smps_ldo_ops, 449e44adca5SAngelo G. Del Regno }; 450e44adca5SAngelo G. Del Regno 451b1a2fb10SVladimir Lypak static const struct regulator_desc pm8953_lnldo = { 452b1a2fb10SVladimir Lypak .linear_ranges = (struct linear_range[]) { 453b1a2fb10SVladimir Lypak REGULATOR_LINEAR_RANGE(690000, 0, 7, 60000), 454e0f33921SAxel Lin REGULATOR_LINEAR_RANGE(1380000, 8, 15, 120000), 455b1a2fb10SVladimir Lypak }, 456b1a2fb10SVladimir Lypak .n_linear_ranges = 2, 457b1a2fb10SVladimir Lypak .n_voltages = 16, 458b1a2fb10SVladimir Lypak .ops = &rpm_smps_ldo_ops, 459b1a2fb10SVladimir Lypak }; 460b1a2fb10SVladimir Lypak 461b1a2fb10SVladimir Lypak static const struct regulator_desc pm8953_ult_nldo = { 462b1a2fb10SVladimir Lypak .linear_ranges = (struct linear_range[]) { 463b1a2fb10SVladimir Lypak REGULATOR_LINEAR_RANGE(375000, 0, 93, 12500), 464b1a2fb10SVladimir Lypak }, 465b1a2fb10SVladimir Lypak .n_linear_ranges = 1, 466b1a2fb10SVladimir Lypak .n_voltages = 94, 467b1a2fb10SVladimir Lypak .ops = &rpm_smps_ldo_ops, 468b1a2fb10SVladimir Lypak }; 469e44adca5SAngelo G. Del Regno 47014a16992SRajendra Nayak static const struct regulator_desc pm8994_hfsmps = { 47160ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 47214a16992SRajendra Nayak REGULATOR_LINEAR_RANGE( 375000, 0, 95, 12500), 47314a16992SRajendra Nayak REGULATOR_LINEAR_RANGE(1550000, 96, 158, 25000), 47414a16992SRajendra Nayak }, 47514a16992SRajendra Nayak .n_linear_ranges = 2, 47614a16992SRajendra Nayak .n_voltages = 159, 47714a16992SRajendra Nayak .ops = &rpm_smps_ldo_ops, 47814a16992SRajendra Nayak }; 47914a16992SRajendra Nayak 48014a16992SRajendra Nayak static const struct regulator_desc pm8994_ftsmps = { 48160ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 48214a16992SRajendra Nayak REGULATOR_LINEAR_RANGE(350000, 0, 199, 5000), 48314a16992SRajendra Nayak REGULATOR_LINEAR_RANGE(700000, 200, 349, 10000), 48414a16992SRajendra Nayak }, 48514a16992SRajendra Nayak .n_linear_ranges = 2, 48614a16992SRajendra Nayak .n_voltages = 350, 48714a16992SRajendra Nayak .ops = &rpm_smps_ldo_ops, 48814a16992SRajendra Nayak }; 48914a16992SRajendra Nayak 49014a16992SRajendra Nayak static const struct regulator_desc pm8994_nldo = { 49160ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 49214a16992SRajendra Nayak REGULATOR_LINEAR_RANGE(750000, 0, 63, 12500), 49314a16992SRajendra Nayak }, 49414a16992SRajendra Nayak .n_linear_ranges = 1, 49514a16992SRajendra Nayak .n_voltages = 64, 49614a16992SRajendra Nayak .ops = &rpm_smps_ldo_ops, 49714a16992SRajendra Nayak }; 49814a16992SRajendra Nayak 49914a16992SRajendra Nayak static const struct regulator_desc pm8994_pldo = { 50060ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 50114a16992SRajendra Nayak REGULATOR_LINEAR_RANGE( 750000, 0, 63, 12500), 50214a16992SRajendra Nayak REGULATOR_LINEAR_RANGE(1550000, 64, 126, 25000), 50314a16992SRajendra Nayak REGULATOR_LINEAR_RANGE(3100000, 127, 163, 50000), 50414a16992SRajendra Nayak }, 50514a16992SRajendra Nayak .n_linear_ranges = 3, 50614a16992SRajendra Nayak .n_voltages = 164, 50714a16992SRajendra Nayak .ops = &rpm_smps_ldo_ops, 50814a16992SRajendra Nayak }; 50914a16992SRajendra Nayak 51014a16992SRajendra Nayak static const struct regulator_desc pm8994_switch = { 51114a16992SRajendra Nayak .ops = &rpm_switch_ops, 51214a16992SRajendra Nayak }; 51314a16992SRajendra Nayak 51414a16992SRajendra Nayak static const struct regulator_desc pm8994_lnldo = { 51514a16992SRajendra Nayak .fixed_uV = 1740000, 51614a16992SRajendra Nayak .n_voltages = 1, 51714a16992SRajendra Nayak .ops = &rpm_smps_ldo_ops_fixed, 51814a16992SRajendra Nayak }; 51914a16992SRajendra Nayak 52086332c34SBjorn Andersson static const struct regulator_desc pmi8994_ftsmps = { 52160ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 52286332c34SBjorn Andersson REGULATOR_LINEAR_RANGE(350000, 0, 199, 5000), 52386332c34SBjorn Andersson REGULATOR_LINEAR_RANGE(700000, 200, 349, 10000), 52486332c34SBjorn Andersson }, 52586332c34SBjorn Andersson .n_linear_ranges = 2, 52686332c34SBjorn Andersson .n_voltages = 350, 52786332c34SBjorn Andersson .ops = &rpm_smps_ldo_ops, 52886332c34SBjorn Andersson }; 52986332c34SBjorn Andersson 53086332c34SBjorn Andersson static const struct regulator_desc pmi8994_hfsmps = { 53160ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 53286332c34SBjorn Andersson REGULATOR_LINEAR_RANGE(350000, 0, 80, 12500), 53386332c34SBjorn Andersson REGULATOR_LINEAR_RANGE(700000, 81, 141, 25000), 53486332c34SBjorn Andersson }, 53586332c34SBjorn Andersson .n_linear_ranges = 2, 53686332c34SBjorn Andersson .n_voltages = 142, 53786332c34SBjorn Andersson .ops = &rpm_smps_ldo_ops, 53886332c34SBjorn Andersson }; 53986332c34SBjorn Andersson 54086332c34SBjorn Andersson static const struct regulator_desc pmi8994_bby = { 54160ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 54286332c34SBjorn Andersson REGULATOR_LINEAR_RANGE(3000000, 0, 44, 50000), 54386332c34SBjorn Andersson }, 54486332c34SBjorn Andersson .n_linear_ranges = 1, 54586332c34SBjorn Andersson .n_voltages = 45, 54686332c34SBjorn Andersson .ops = &rpm_bob_ops, 54786332c34SBjorn Andersson }; 54886332c34SBjorn Andersson 5493cdb741eSBjorn Andersson static const struct regulator_desc pm8998_ftsmps = { 55060ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 5513cdb741eSBjorn Andersson REGULATOR_LINEAR_RANGE(320000, 0, 258, 4000), 5523cdb741eSBjorn Andersson }, 5533cdb741eSBjorn Andersson .n_linear_ranges = 1, 5543cdb741eSBjorn Andersson .n_voltages = 259, 5553cdb741eSBjorn Andersson .ops = &rpm_smps_ldo_ops, 5563cdb741eSBjorn Andersson }; 5573cdb741eSBjorn Andersson 5583cdb741eSBjorn Andersson static const struct regulator_desc pm8998_hfsmps = { 55960ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 5603cdb741eSBjorn Andersson REGULATOR_LINEAR_RANGE(320000, 0, 215, 8000), 5613cdb741eSBjorn Andersson }, 5623cdb741eSBjorn Andersson .n_linear_ranges = 1, 5633cdb741eSBjorn Andersson .n_voltages = 216, 5643cdb741eSBjorn Andersson .ops = &rpm_smps_ldo_ops, 5653cdb741eSBjorn Andersson }; 5663cdb741eSBjorn Andersson 5673cdb741eSBjorn Andersson static const struct regulator_desc pm8998_nldo = { 56860ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 5693cdb741eSBjorn Andersson REGULATOR_LINEAR_RANGE(312000, 0, 127, 8000), 5703cdb741eSBjorn Andersson }, 5713cdb741eSBjorn Andersson .n_linear_ranges = 1, 5723cdb741eSBjorn Andersson .n_voltages = 128, 5733cdb741eSBjorn Andersson .ops = &rpm_smps_ldo_ops, 5743cdb741eSBjorn Andersson }; 5753cdb741eSBjorn Andersson 5763cdb741eSBjorn Andersson static const struct regulator_desc pm8998_pldo = { 57760ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 5783cdb741eSBjorn Andersson REGULATOR_LINEAR_RANGE(1664000, 0, 255, 8000), 5793cdb741eSBjorn Andersson }, 5803cdb741eSBjorn Andersson .n_linear_ranges = 1, 5813cdb741eSBjorn Andersson .n_voltages = 256, 5823cdb741eSBjorn Andersson .ops = &rpm_smps_ldo_ops, 5833cdb741eSBjorn Andersson }; 5843cdb741eSBjorn Andersson 5853cdb741eSBjorn Andersson static const struct regulator_desc pm8998_pldo_lv = { 58660ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 5873cdb741eSBjorn Andersson REGULATOR_LINEAR_RANGE(1256000, 0, 127, 8000), 5883cdb741eSBjorn Andersson }, 5893cdb741eSBjorn Andersson .n_linear_ranges = 1, 5903cdb741eSBjorn Andersson .n_voltages = 128, 5913cdb741eSBjorn Andersson .ops = &rpm_smps_ldo_ops, 5923cdb741eSBjorn Andersson }; 5933cdb741eSBjorn Andersson 5943cdb741eSBjorn Andersson static const struct regulator_desc pm8998_switch = { 5953cdb741eSBjorn Andersson .ops = &rpm_switch_ops, 5963cdb741eSBjorn Andersson }; 5973cdb741eSBjorn Andersson 5983cdb741eSBjorn Andersson static const struct regulator_desc pmi8998_bob = { 59960ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 6003cdb741eSBjorn Andersson REGULATOR_LINEAR_RANGE(1824000, 0, 83, 32000), 6013cdb741eSBjorn Andersson }, 6023cdb741eSBjorn Andersson .n_linear_ranges = 1, 6033cdb741eSBjorn Andersson .n_voltages = 84, 6043cdb741eSBjorn Andersson .ops = &rpm_bob_ops, 6053cdb741eSBjorn Andersson }; 6063cdb741eSBjorn Andersson 6076d849653SAngeloGioacchino Del Regno static const struct regulator_desc pm660_ftsmps = { 6086d849653SAngeloGioacchino Del Regno .linear_ranges = (struct linear_range[]) { 6096d849653SAngeloGioacchino Del Regno REGULATOR_LINEAR_RANGE(355000, 0, 199, 5000), 6106d849653SAngeloGioacchino Del Regno }, 6116d849653SAngeloGioacchino Del Regno .n_linear_ranges = 1, 6126d849653SAngeloGioacchino Del Regno .n_voltages = 200, 6136d849653SAngeloGioacchino Del Regno .ops = &rpm_smps_ldo_ops, 6146d849653SAngeloGioacchino Del Regno }; 6156d849653SAngeloGioacchino Del Regno 6166d849653SAngeloGioacchino Del Regno static const struct regulator_desc pm660_hfsmps = { 6176d849653SAngeloGioacchino Del Regno .linear_ranges = (struct linear_range[]) { 6186d849653SAngeloGioacchino Del Regno REGULATOR_LINEAR_RANGE(320000, 0, 216, 8000), 6196d849653SAngeloGioacchino Del Regno }, 6206d849653SAngeloGioacchino Del Regno .n_linear_ranges = 1, 6216d849653SAngeloGioacchino Del Regno .n_voltages = 217, 6226d849653SAngeloGioacchino Del Regno .ops = &rpm_smps_ldo_ops, 6236d849653SAngeloGioacchino Del Regno }; 6246d849653SAngeloGioacchino Del Regno 6256d849653SAngeloGioacchino Del Regno static const struct regulator_desc pm660_ht_nldo = { 6266d849653SAngeloGioacchino Del Regno .linear_ranges = (struct linear_range[]) { 6276d849653SAngeloGioacchino Del Regno REGULATOR_LINEAR_RANGE(312000, 0, 124, 8000), 6286d849653SAngeloGioacchino Del Regno }, 6296d849653SAngeloGioacchino Del Regno .n_linear_ranges = 1, 6306d849653SAngeloGioacchino Del Regno .n_voltages = 125, 6316d849653SAngeloGioacchino Del Regno .ops = &rpm_smps_ldo_ops, 6326d849653SAngeloGioacchino Del Regno }; 6336d849653SAngeloGioacchino Del Regno 6346d849653SAngeloGioacchino Del Regno static const struct regulator_desc pm660_ht_lvpldo = { 6356d849653SAngeloGioacchino Del Regno .linear_ranges = (struct linear_range[]) { 6366d849653SAngeloGioacchino Del Regno REGULATOR_LINEAR_RANGE(1504000, 0, 62, 8000), 6376d849653SAngeloGioacchino Del Regno }, 6386d849653SAngeloGioacchino Del Regno .n_linear_ranges = 1, 6396d849653SAngeloGioacchino Del Regno .n_voltages = 63, 6406d849653SAngeloGioacchino Del Regno .ops = &rpm_smps_ldo_ops, 6416d849653SAngeloGioacchino Del Regno }; 6426d849653SAngeloGioacchino Del Regno 6436d849653SAngeloGioacchino Del Regno static const struct regulator_desc pm660_nldo660 = { 6446d849653SAngeloGioacchino Del Regno .linear_ranges = (struct linear_range[]) { 6456d849653SAngeloGioacchino Del Regno REGULATOR_LINEAR_RANGE(320000, 0, 123, 8000), 6466d849653SAngeloGioacchino Del Regno }, 6476d849653SAngeloGioacchino Del Regno .n_linear_ranges = 1, 6486d849653SAngeloGioacchino Del Regno .n_voltages = 124, 6496d849653SAngeloGioacchino Del Regno .ops = &rpm_smps_ldo_ops, 6506d849653SAngeloGioacchino Del Regno }; 6516d849653SAngeloGioacchino Del Regno 6526d849653SAngeloGioacchino Del Regno static const struct regulator_desc pm660_pldo660 = { 6536d849653SAngeloGioacchino Del Regno .linear_ranges = (struct linear_range[]) { 6546d849653SAngeloGioacchino Del Regno REGULATOR_LINEAR_RANGE(1504000, 0, 255, 8000), 6556d849653SAngeloGioacchino Del Regno }, 6566d849653SAngeloGioacchino Del Regno .n_linear_ranges = 1, 6576d849653SAngeloGioacchino Del Regno .n_voltages = 256, 6586d849653SAngeloGioacchino Del Regno .ops = &rpm_smps_ldo_ops, 6596d849653SAngeloGioacchino Del Regno }; 6606d849653SAngeloGioacchino Del Regno 6616d849653SAngeloGioacchino Del Regno static const struct regulator_desc pm660l_bob = { 6626d849653SAngeloGioacchino Del Regno .linear_ranges = (struct linear_range[]) { 6636d849653SAngeloGioacchino Del Regno REGULATOR_LINEAR_RANGE(1800000, 0, 84, 32000), 6646d849653SAngeloGioacchino Del Regno }, 6656d849653SAngeloGioacchino Del Regno .n_linear_ranges = 1, 6666d849653SAngeloGioacchino Del Regno .n_voltages = 85, 6676d849653SAngeloGioacchino Del Regno .ops = &rpm_bob_ops, 6686d849653SAngeloGioacchino Del Regno }; 6696d849653SAngeloGioacchino Del Regno 670f589d95bSBjorn Andersson static const struct regulator_desc pms405_hfsmps3 = { 67160ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 672f589d95bSBjorn Andersson REGULATOR_LINEAR_RANGE(320000, 0, 215, 8000), 673f589d95bSBjorn Andersson }, 674f589d95bSBjorn Andersson .n_linear_ranges = 1, 675f589d95bSBjorn Andersson .n_voltages = 216, 676f589d95bSBjorn Andersson .ops = &rpm_smps_ldo_ops, 677f589d95bSBjorn Andersson }; 678f589d95bSBjorn Andersson 679f589d95bSBjorn Andersson static const struct regulator_desc pms405_nldo300 = { 68060ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 681f589d95bSBjorn Andersson REGULATOR_LINEAR_RANGE(312000, 0, 127, 8000), 682f589d95bSBjorn Andersson }, 683f589d95bSBjorn Andersson .n_linear_ranges = 1, 684f589d95bSBjorn Andersson .n_voltages = 128, 685f589d95bSBjorn Andersson .ops = &rpm_smps_ldo_ops, 686f589d95bSBjorn Andersson }; 687f589d95bSBjorn Andersson 688f589d95bSBjorn Andersson static const struct regulator_desc pms405_nldo1200 = { 68960ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 690f589d95bSBjorn Andersson REGULATOR_LINEAR_RANGE(312000, 0, 127, 8000), 691f589d95bSBjorn Andersson }, 692f589d95bSBjorn Andersson .n_linear_ranges = 1, 693f589d95bSBjorn Andersson .n_voltages = 128, 694f589d95bSBjorn Andersson .ops = &rpm_smps_ldo_ops, 695f589d95bSBjorn Andersson }; 696f589d95bSBjorn Andersson 697f589d95bSBjorn Andersson static const struct regulator_desc pms405_pldo50 = { 69860ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 699f589d95bSBjorn Andersson REGULATOR_LINEAR_RANGE(1664000, 0, 128, 16000), 700f589d95bSBjorn Andersson }, 701f589d95bSBjorn Andersson .n_linear_ranges = 1, 702f589d95bSBjorn Andersson .n_voltages = 129, 703f589d95bSBjorn Andersson .ops = &rpm_smps_ldo_ops, 704f589d95bSBjorn Andersson }; 705f589d95bSBjorn Andersson 706f589d95bSBjorn Andersson static const struct regulator_desc pms405_pldo150 = { 70760ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 708f589d95bSBjorn Andersson REGULATOR_LINEAR_RANGE(1664000, 0, 128, 16000), 709f589d95bSBjorn Andersson }, 710f589d95bSBjorn Andersson .n_linear_ranges = 1, 711f589d95bSBjorn Andersson .n_voltages = 129, 712f589d95bSBjorn Andersson .ops = &rpm_smps_ldo_ops, 713f589d95bSBjorn Andersson }; 714f589d95bSBjorn Andersson 715f589d95bSBjorn Andersson static const struct regulator_desc pms405_pldo600 = { 71660ab7f41SMatti Vaittinen .linear_ranges = (struct linear_range[]) { 717f589d95bSBjorn Andersson REGULATOR_LINEAR_RANGE(1256000, 0, 98, 8000), 718f589d95bSBjorn Andersson }, 719f589d95bSBjorn Andersson .n_linear_ranges = 1, 720f589d95bSBjorn Andersson .n_voltages = 99, 721f589d95bSBjorn Andersson .ops = &rpm_smps_ldo_ops, 722f589d95bSBjorn Andersson }; 723f589d95bSBjorn Andersson 72447894c85SKathiravan T static const struct regulator_desc mp5496_smpa2 = { 72547894c85SKathiravan T .linear_ranges = (struct linear_range[]) { 726122e951eSRobert Marko REGULATOR_LINEAR_RANGE(600000, 0, 127, 12500), 72747894c85SKathiravan T }, 72847894c85SKathiravan T .n_linear_ranges = 1, 729122e951eSRobert Marko .n_voltages = 128, 73047894c85SKathiravan T .ops = &rpm_mp5496_ops, 73147894c85SKathiravan T }; 73247894c85SKathiravan T 73347894c85SKathiravan T static const struct regulator_desc mp5496_ldoa2 = { 73447894c85SKathiravan T .linear_ranges = (struct linear_range[]) { 735122e951eSRobert Marko REGULATOR_LINEAR_RANGE(800000, 0, 127, 25000), 73647894c85SKathiravan T }, 73747894c85SKathiravan T .n_linear_ranges = 1, 738122e951eSRobert Marko .n_voltages = 128, 73947894c85SKathiravan T .ops = &rpm_mp5496_ops, 74047894c85SKathiravan T }; 74147894c85SKathiravan T 742400c9315SShawn Guo static const struct regulator_desc pm2250_lvftsmps = { 743400c9315SShawn Guo .linear_ranges = (struct linear_range[]) { 744400c9315SShawn Guo REGULATOR_LINEAR_RANGE(320000, 0, 269, 4000), 745400c9315SShawn Guo }, 746400c9315SShawn Guo .n_linear_ranges = 1, 747400c9315SShawn Guo .n_voltages = 270, 748400c9315SShawn Guo .ops = &rpm_smps_ldo_ops, 749400c9315SShawn Guo }; 750400c9315SShawn Guo 751400c9315SShawn Guo static const struct regulator_desc pm2250_ftsmps = { 752400c9315SShawn Guo .linear_ranges = (struct linear_range[]) { 753400c9315SShawn Guo REGULATOR_LINEAR_RANGE(640000, 0, 269, 8000), 754400c9315SShawn Guo }, 755400c9315SShawn Guo .n_linear_ranges = 1, 756400c9315SShawn Guo .n_voltages = 270, 757400c9315SShawn Guo .ops = &rpm_smps_ldo_ops, 758400c9315SShawn Guo }; 759400c9315SShawn Guo 760da65e367SBjorn Andersson struct rpm_regulator_data { 761da65e367SBjorn Andersson const char *name; 762da65e367SBjorn Andersson u32 type; 763da65e367SBjorn Andersson u32 id; 764da65e367SBjorn Andersson const struct regulator_desc *desc; 765da65e367SBjorn Andersson const char *supply; 766da65e367SBjorn Andersson }; 767da65e367SBjorn Andersson 76847894c85SKathiravan T static const struct rpm_regulator_data rpm_mp5496_regulators[] = { 76947894c85SKathiravan T { "s2", QCOM_SMD_RPM_SMPA, 2, &mp5496_smpa2, "s2" }, 77047894c85SKathiravan T { "l2", QCOM_SMD_RPM_LDOA, 2, &mp5496_ldoa2, "l2" }, 77147894c85SKathiravan T {} 77247894c85SKathiravan T }; 77347894c85SKathiravan T 774da65e367SBjorn Andersson static const struct rpm_regulator_data rpm_pm8841_regulators[] = { 775da65e367SBjorn Andersson { "s1", QCOM_SMD_RPM_SMPB, 1, &pm8x41_hfsmps, "vdd_s1" }, 776da65e367SBjorn Andersson { "s2", QCOM_SMD_RPM_SMPB, 2, &pm8841_ftsmps, "vdd_s2" }, 777da65e367SBjorn Andersson { "s3", QCOM_SMD_RPM_SMPB, 3, &pm8x41_hfsmps, "vdd_s3" }, 778da65e367SBjorn Andersson { "s4", QCOM_SMD_RPM_SMPB, 4, &pm8841_ftsmps, "vdd_s4" }, 779da65e367SBjorn Andersson { "s5", QCOM_SMD_RPM_SMPB, 5, &pm8841_ftsmps, "vdd_s5" }, 780da65e367SBjorn Andersson { "s6", QCOM_SMD_RPM_SMPB, 6, &pm8841_ftsmps, "vdd_s6" }, 781da65e367SBjorn Andersson { "s7", QCOM_SMD_RPM_SMPB, 7, &pm8841_ftsmps, "vdd_s7" }, 782da65e367SBjorn Andersson { "s8", QCOM_SMD_RPM_SMPB, 8, &pm8841_ftsmps, "vdd_s8" }, 783da65e367SBjorn Andersson {} 784da65e367SBjorn Andersson }; 785da65e367SBjorn Andersson 78657d65676SAndy Gross static const struct rpm_regulator_data rpm_pm8916_regulators[] = { 78757d65676SAndy Gross { "s1", QCOM_SMD_RPM_SMPA, 1, &pm8916_buck_lvo_smps, "vdd_s1" }, 78857d65676SAndy Gross { "s2", QCOM_SMD_RPM_SMPA, 2, &pm8916_buck_lvo_smps, "vdd_s2" }, 78957d65676SAndy Gross { "s3", QCOM_SMD_RPM_SMPA, 3, &pm8916_buck_lvo_smps, "vdd_s3" }, 79057d65676SAndy Gross { "s4", QCOM_SMD_RPM_SMPA, 4, &pm8916_buck_hvo_smps, "vdd_s4" }, 79157d65676SAndy Gross { "l1", QCOM_SMD_RPM_LDOA, 1, &pm8916_nldo, "vdd_l1_l2_l3" }, 79257d65676SAndy Gross { "l2", QCOM_SMD_RPM_LDOA, 2, &pm8916_nldo, "vdd_l1_l2_l3" }, 79357d65676SAndy Gross { "l3", QCOM_SMD_RPM_LDOA, 3, &pm8916_nldo, "vdd_l1_l2_l3" }, 79457d65676SAndy Gross { "l4", QCOM_SMD_RPM_LDOA, 4, &pm8916_pldo, "vdd_l4_l5_l6" }, 79557d65676SAndy Gross { "l5", QCOM_SMD_RPM_LDOA, 5, &pm8916_pldo, "vdd_l4_l5_l6" }, 79657d65676SAndy Gross { "l6", QCOM_SMD_RPM_LDOA, 6, &pm8916_pldo, "vdd_l4_l5_l6" }, 79757d65676SAndy Gross { "l7", QCOM_SMD_RPM_LDOA, 7, &pm8916_pldo, "vdd_l7" }, 79857d65676SAndy Gross { "l8", QCOM_SMD_RPM_LDOA, 8, &pm8916_pldo, "vdd_l8_l9_l10_l11_l12_l13_l14_l15_l16_l17_l18" }, 79957d65676SAndy Gross { "l9", QCOM_SMD_RPM_LDOA, 9, &pm8916_pldo, "vdd_l8_l9_l10_l11_l12_l13_l14_l15_l16_l17_l18" }, 80057d65676SAndy Gross { "l10", QCOM_SMD_RPM_LDOA, 10, &pm8916_pldo, "vdd_l8_l9_l10_l11_l12_l13_l14_l15_l16_l17_l18"}, 80157d65676SAndy Gross { "l11", QCOM_SMD_RPM_LDOA, 11, &pm8916_pldo, "vdd_l8_l9_l10_l11_l12_l13_l14_l15_l16_l17_l18"}, 80257d65676SAndy Gross { "l12", QCOM_SMD_RPM_LDOA, 12, &pm8916_pldo, "vdd_l8_l9_l10_l11_l12_l13_l14_l15_l16_l17_l18"}, 80357d65676SAndy Gross { "l13", QCOM_SMD_RPM_LDOA, 13, &pm8916_pldo, "vdd_l8_l9_l10_l11_l12_l13_l14_l15_l16_l17_l18"}, 80457d65676SAndy Gross { "l14", QCOM_SMD_RPM_LDOA, 14, &pm8916_pldo, "vdd_l8_l9_l10_l11_l12_l13_l14_l15_l16_l17_l18"}, 80557d65676SAndy Gross { "l15", QCOM_SMD_RPM_LDOA, 15, &pm8916_pldo, "vdd_l8_l9_l10_l11_l12_l13_l14_l15_l16_l17_l18"}, 80657d65676SAndy Gross { "l16", QCOM_SMD_RPM_LDOA, 16, &pm8916_pldo, "vdd_l8_l9_l10_l11_l12_l13_l14_l15_l16_l17_l18"}, 80757d65676SAndy Gross { "l17", QCOM_SMD_RPM_LDOA, 17, &pm8916_pldo, "vdd_l8_l9_l10_l11_l12_l13_l14_l15_l16_l17_l18"}, 80857d65676SAndy Gross { "l18", QCOM_SMD_RPM_LDOA, 18, &pm8916_pldo, "vdd_l8_l9_l10_l11_l12_l13_l14_l15_l16_l17_l18"}, 80957d65676SAndy Gross {} 81057d65676SAndy Gross }; 81157d65676SAndy Gross 8128c816d56SBartosz Dudziak static const struct rpm_regulator_data rpm_pm8226_regulators[] = { 8138c816d56SBartosz Dudziak { "s1", QCOM_SMD_RPM_SMPA, 1, &pm8226_hfsmps, "vdd_s1" }, 8148c816d56SBartosz Dudziak { "s2", QCOM_SMD_RPM_SMPA, 2, &pm8226_ftsmps, "vdd_s2" }, 8158c816d56SBartosz Dudziak { "s3", QCOM_SMD_RPM_SMPA, 3, &pm8226_hfsmps, "vdd_s3" }, 8168c816d56SBartosz Dudziak { "s4", QCOM_SMD_RPM_SMPA, 4, &pm8226_hfsmps, "vdd_s4" }, 8178c816d56SBartosz Dudziak { "s5", QCOM_SMD_RPM_SMPA, 5, &pm8226_hfsmps, "vdd_s5" }, 8188c816d56SBartosz Dudziak { "l1", QCOM_SMD_RPM_LDOA, 1, &pm8226_nldo, "vdd_l1_l2_l4_l5" }, 8198c816d56SBartosz Dudziak { "l2", QCOM_SMD_RPM_LDOA, 2, &pm8226_nldo, "vdd_l1_l2_l4_l5" }, 8208c816d56SBartosz Dudziak { "l3", QCOM_SMD_RPM_LDOA, 3, &pm8226_nldo, "vdd_l3_l24_l26" }, 8218c816d56SBartosz Dudziak { "l4", QCOM_SMD_RPM_LDOA, 4, &pm8226_nldo, "vdd_l1_l2_l4_l5" }, 8228c816d56SBartosz Dudziak { "l5", QCOM_SMD_RPM_LDOA, 5, &pm8226_nldo, "vdd_l1_l2_l4_l5" }, 8238c816d56SBartosz Dudziak { "l6", QCOM_SMD_RPM_LDOA, 6, &pm8226_pldo, "vdd_l6_l7_l8_l9_l27" }, 8248c816d56SBartosz Dudziak { "l7", QCOM_SMD_RPM_LDOA, 7, &pm8226_pldo, "vdd_l6_l7_l8_l9_l27" }, 8258c816d56SBartosz Dudziak { "l8", QCOM_SMD_RPM_LDOA, 8, &pm8226_pldo, "vdd_l6_l7_l8_l9_l27" }, 8268c816d56SBartosz Dudziak { "l9", QCOM_SMD_RPM_LDOA, 9, &pm8226_pldo, "vdd_l6_l7_l8_l9_l27" }, 8278c816d56SBartosz Dudziak { "l10", QCOM_SMD_RPM_LDOA, 10, &pm8226_pldo, "vdd_l10_l11_l13" }, 8288c816d56SBartosz Dudziak { "l11", QCOM_SMD_RPM_LDOA, 11, &pm8226_pldo, "vdd_l10_l11_l13" }, 8298c816d56SBartosz Dudziak { "l12", QCOM_SMD_RPM_LDOA, 12, &pm8226_pldo, "vdd_l12_l14" }, 8308c816d56SBartosz Dudziak { "l13", QCOM_SMD_RPM_LDOA, 13, &pm8226_pldo, "vdd_l10_l11_l13" }, 8318c816d56SBartosz Dudziak { "l14", QCOM_SMD_RPM_LDOA, 14, &pm8226_pldo, "vdd_l12_l14" }, 8328c816d56SBartosz Dudziak { "l15", QCOM_SMD_RPM_LDOA, 15, &pm8226_pldo, "vdd_l15_l16_l17_l18" }, 8338c816d56SBartosz Dudziak { "l16", QCOM_SMD_RPM_LDOA, 16, &pm8226_pldo, "vdd_l15_l16_l17_l18" }, 8348c816d56SBartosz Dudziak { "l17", QCOM_SMD_RPM_LDOA, 17, &pm8226_pldo, "vdd_l15_l16_l17_l18" }, 8358c816d56SBartosz Dudziak { "l18", QCOM_SMD_RPM_LDOA, 18, &pm8226_pldo, "vdd_l15_l16_l17_l18" }, 8368c816d56SBartosz Dudziak { "l19", QCOM_SMD_RPM_LDOA, 19, &pm8226_pldo, "vdd_l19_l20_l21_l22_l23_l28" }, 8378c816d56SBartosz Dudziak { "l20", QCOM_SMD_RPM_LDOA, 20, &pm8226_pldo, "vdd_l19_l20_l21_l22_l23_l28" }, 8388c816d56SBartosz Dudziak { "l21", QCOM_SMD_RPM_LDOA, 21, &pm8226_pldo, "vdd_l19_l20_l21_l22_l23_l28" }, 8398c816d56SBartosz Dudziak { "l22", QCOM_SMD_RPM_LDOA, 22, &pm8226_pldo, "vdd_l19_l20_l21_l22_l23_l28" }, 8408c816d56SBartosz Dudziak { "l23", QCOM_SMD_RPM_LDOA, 23, &pm8226_pldo, "vdd_l19_l20_l21_l22_l23_l28" }, 8418c816d56SBartosz Dudziak { "l24", QCOM_SMD_RPM_LDOA, 24, &pm8226_nldo, "vdd_l3_l24_l26" }, 8428c816d56SBartosz Dudziak { "l25", QCOM_SMD_RPM_LDOA, 25, &pm8226_pldo, "vdd_l25" }, 8438c816d56SBartosz Dudziak { "l26", QCOM_SMD_RPM_LDOA, 26, &pm8226_nldo, "vdd_l3_l24_l26" }, 8448c816d56SBartosz Dudziak { "l27", QCOM_SMD_RPM_LDOA, 27, &pm8226_pldo, "vdd_l6_l7_l8_l9_l27" }, 8458c816d56SBartosz Dudziak { "l28", QCOM_SMD_RPM_LDOA, 28, &pm8226_pldo, "vdd_l19_l20_l21_l22_l23_l28" }, 8468c816d56SBartosz Dudziak { "lvs1", QCOM_SMD_RPM_VSA, 1, &pm8226_switch, "vdd_lvs1" }, 8478c816d56SBartosz Dudziak {} 8488c816d56SBartosz Dudziak }; 8498c816d56SBartosz Dudziak 850da65e367SBjorn Andersson static const struct rpm_regulator_data rpm_pm8941_regulators[] = { 851da65e367SBjorn Andersson { "s1", QCOM_SMD_RPM_SMPA, 1, &pm8x41_hfsmps, "vdd_s1" }, 852da65e367SBjorn Andersson { "s2", QCOM_SMD_RPM_SMPA, 2, &pm8x41_hfsmps, "vdd_s2" }, 853da65e367SBjorn Andersson { "s3", QCOM_SMD_RPM_SMPA, 3, &pm8x41_hfsmps, "vdd_s3" }, 854da65e367SBjorn Andersson { "s4", QCOM_SMD_RPM_BOOST, 1, &pm8941_boost }, 855da65e367SBjorn Andersson 856da65e367SBjorn Andersson { "l1", QCOM_SMD_RPM_LDOA, 1, &pm8941_nldo, "vdd_l1_l3" }, 857da65e367SBjorn Andersson { "l2", QCOM_SMD_RPM_LDOA, 2, &pm8941_nldo, "vdd_l2_lvs1_2_3" }, 858da65e367SBjorn Andersson { "l3", QCOM_SMD_RPM_LDOA, 3, &pm8941_nldo, "vdd_l1_l3" }, 859da65e367SBjorn Andersson { "l4", QCOM_SMD_RPM_LDOA, 4, &pm8941_nldo, "vdd_l4_l11" }, 860da65e367SBjorn Andersson { "l5", QCOM_SMD_RPM_LDOA, 5, &pm8941_lnldo, "vdd_l5_l7" }, 861da65e367SBjorn Andersson { "l6", QCOM_SMD_RPM_LDOA, 6, &pm8941_pldo, "vdd_l6_l12_l14_l15" }, 862da65e367SBjorn Andersson { "l7", QCOM_SMD_RPM_LDOA, 7, &pm8941_lnldo, "vdd_l5_l7" }, 863da65e367SBjorn Andersson { "l8", QCOM_SMD_RPM_LDOA, 8, &pm8941_pldo, "vdd_l8_l16_l18_l19" }, 864da65e367SBjorn Andersson { "l9", QCOM_SMD_RPM_LDOA, 9, &pm8941_pldo, "vdd_l9_l10_l17_l22" }, 865da65e367SBjorn Andersson { "l10", QCOM_SMD_RPM_LDOA, 10, &pm8941_pldo, "vdd_l9_l10_l17_l22" }, 866da65e367SBjorn Andersson { "l11", QCOM_SMD_RPM_LDOA, 11, &pm8941_nldo, "vdd_l4_l11" }, 867da65e367SBjorn Andersson { "l12", QCOM_SMD_RPM_LDOA, 12, &pm8941_pldo, "vdd_l6_l12_l14_l15" }, 868da65e367SBjorn Andersson { "l13", QCOM_SMD_RPM_LDOA, 13, &pm8941_pldo, "vdd_l13_l20_l23_l24" }, 869da65e367SBjorn Andersson { "l14", QCOM_SMD_RPM_LDOA, 14, &pm8941_pldo, "vdd_l6_l12_l14_l15" }, 870da65e367SBjorn Andersson { "l15", QCOM_SMD_RPM_LDOA, 15, &pm8941_pldo, "vdd_l6_l12_l14_l15" }, 871da65e367SBjorn Andersson { "l16", QCOM_SMD_RPM_LDOA, 16, &pm8941_pldo, "vdd_l8_l16_l18_l19" }, 872da65e367SBjorn Andersson { "l17", QCOM_SMD_RPM_LDOA, 17, &pm8941_pldo, "vdd_l9_l10_l17_l22" }, 873da65e367SBjorn Andersson { "l18", QCOM_SMD_RPM_LDOA, 18, &pm8941_pldo, "vdd_l8_l16_l18_l19" }, 874da65e367SBjorn Andersson { "l19", QCOM_SMD_RPM_LDOA, 19, &pm8941_pldo, "vdd_l8_l16_l18_l19" }, 875da65e367SBjorn Andersson { "l20", QCOM_SMD_RPM_LDOA, 20, &pm8941_pldo, "vdd_l13_l20_l23_l24" }, 876da65e367SBjorn Andersson { "l21", QCOM_SMD_RPM_LDOA, 21, &pm8941_pldo, "vdd_l21" }, 877da65e367SBjorn Andersson { "l22", QCOM_SMD_RPM_LDOA, 22, &pm8941_pldo, "vdd_l9_l10_l17_l22" }, 878da65e367SBjorn Andersson { "l23", QCOM_SMD_RPM_LDOA, 23, &pm8941_pldo, "vdd_l13_l20_l23_l24" }, 879da65e367SBjorn Andersson { "l24", QCOM_SMD_RPM_LDOA, 24, &pm8941_pldo, "vdd_l13_l20_l23_l24" }, 880da65e367SBjorn Andersson 881da65e367SBjorn Andersson { "lvs1", QCOM_SMD_RPM_VSA, 1, &pm8941_switch, "vdd_l2_lvs1_2_3" }, 882da65e367SBjorn Andersson { "lvs2", QCOM_SMD_RPM_VSA, 2, &pm8941_switch, "vdd_l2_lvs1_2_3" }, 883da65e367SBjorn Andersson { "lvs3", QCOM_SMD_RPM_VSA, 3, &pm8941_switch, "vdd_l2_lvs1_2_3" }, 884da65e367SBjorn Andersson 885da65e367SBjorn Andersson { "5vs1", QCOM_SMD_RPM_VSA, 4, &pm8941_switch, "vin_5vs" }, 886da65e367SBjorn Andersson { "5vs2", QCOM_SMD_RPM_VSA, 5, &pm8941_switch, "vin_5vs" }, 887da65e367SBjorn Andersson 888da65e367SBjorn Andersson {} 889da65e367SBjorn Andersson }; 890da65e367SBjorn Andersson 891ee01d0c9SAndy Gross static const struct rpm_regulator_data rpm_pma8084_regulators[] = { 892ee01d0c9SAndy Gross { "s1", QCOM_SMD_RPM_SMPA, 1, &pma8084_ftsmps, "vdd_s1" }, 893ee01d0c9SAndy Gross { "s2", QCOM_SMD_RPM_SMPA, 2, &pma8084_ftsmps, "vdd_s2" }, 894ee01d0c9SAndy Gross { "s3", QCOM_SMD_RPM_SMPA, 3, &pma8084_hfsmps, "vdd_s3" }, 895ee01d0c9SAndy Gross { "s4", QCOM_SMD_RPM_SMPA, 4, &pma8084_hfsmps, "vdd_s4" }, 896ee01d0c9SAndy Gross { "s5", QCOM_SMD_RPM_SMPA, 5, &pma8084_hfsmps, "vdd_s5" }, 897ee01d0c9SAndy Gross { "s6", QCOM_SMD_RPM_SMPA, 6, &pma8084_ftsmps, "vdd_s6" }, 898ee01d0c9SAndy Gross { "s7", QCOM_SMD_RPM_SMPA, 7, &pma8084_ftsmps, "vdd_s7" }, 899ee01d0c9SAndy Gross { "s8", QCOM_SMD_RPM_SMPA, 8, &pma8084_ftsmps, "vdd_s8" }, 900ee01d0c9SAndy Gross { "s9", QCOM_SMD_RPM_SMPA, 9, &pma8084_ftsmps, "vdd_s9" }, 901ee01d0c9SAndy Gross { "s10", QCOM_SMD_RPM_SMPA, 10, &pma8084_ftsmps, "vdd_s10" }, 902ee01d0c9SAndy Gross { "s11", QCOM_SMD_RPM_SMPA, 11, &pma8084_ftsmps, "vdd_s11" }, 903ee01d0c9SAndy Gross { "s12", QCOM_SMD_RPM_SMPA, 12, &pma8084_ftsmps, "vdd_s12" }, 904ee01d0c9SAndy Gross 905ee01d0c9SAndy Gross { "l1", QCOM_SMD_RPM_LDOA, 1, &pma8084_nldo, "vdd_l1_l11" }, 906ee01d0c9SAndy Gross { "l2", QCOM_SMD_RPM_LDOA, 2, &pma8084_nldo, "vdd_l2_l3_l4_l27" }, 907ee01d0c9SAndy Gross { "l3", QCOM_SMD_RPM_LDOA, 3, &pma8084_nldo, "vdd_l2_l3_l4_l27" }, 908ee01d0c9SAndy Gross { "l4", QCOM_SMD_RPM_LDOA, 4, &pma8084_nldo, "vdd_l2_l3_l4_l27" }, 909ee01d0c9SAndy Gross { "l5", QCOM_SMD_RPM_LDOA, 5, &pma8084_pldo, "vdd_l5_l7" }, 910ee01d0c9SAndy Gross { "l6", QCOM_SMD_RPM_LDOA, 6, &pma8084_pldo, "vdd_l6_l12_l14_l15_l26" }, 911ee01d0c9SAndy Gross { "l7", QCOM_SMD_RPM_LDOA, 7, &pma8084_pldo, "vdd_l5_l7" }, 912ee01d0c9SAndy Gross { "l8", QCOM_SMD_RPM_LDOA, 8, &pma8084_pldo, "vdd_l8" }, 913ee01d0c9SAndy Gross { "l9", QCOM_SMD_RPM_LDOA, 9, &pma8084_pldo, "vdd_l9_l10_l13_l20_l23_l24" }, 914ee01d0c9SAndy Gross { "l10", QCOM_SMD_RPM_LDOA, 10, &pma8084_pldo, "vdd_l9_l10_l13_l20_l23_l24" }, 915ee01d0c9SAndy Gross { "l11", QCOM_SMD_RPM_LDOA, 11, &pma8084_nldo, "vdd_l1_l11" }, 916ee01d0c9SAndy Gross { "l12", QCOM_SMD_RPM_LDOA, 12, &pma8084_pldo, "vdd_l6_l12_l14_l15_l26" }, 917ee01d0c9SAndy Gross { "l13", QCOM_SMD_RPM_LDOA, 13, &pma8084_pldo, "vdd_l9_l10_l13_l20_l23_l24" }, 918ee01d0c9SAndy Gross { "l14", QCOM_SMD_RPM_LDOA, 14, &pma8084_pldo, "vdd_l6_l12_l14_l15_l26" }, 919ee01d0c9SAndy Gross { "l15", QCOM_SMD_RPM_LDOA, 15, &pma8084_pldo, "vdd_l6_l12_l14_l15_l26" }, 920ee01d0c9SAndy Gross { "l16", QCOM_SMD_RPM_LDOA, 16, &pma8084_pldo, "vdd_l16_l25" }, 921ee01d0c9SAndy Gross { "l17", QCOM_SMD_RPM_LDOA, 17, &pma8084_pldo, "vdd_l17" }, 922ee01d0c9SAndy Gross { "l18", QCOM_SMD_RPM_LDOA, 18, &pma8084_pldo, "vdd_l18" }, 923ee01d0c9SAndy Gross { "l19", QCOM_SMD_RPM_LDOA, 19, &pma8084_pldo, "vdd_l19" }, 924ee01d0c9SAndy Gross { "l20", QCOM_SMD_RPM_LDOA, 20, &pma8084_pldo, "vdd_l9_l10_l13_l20_l23_l24" }, 925ee01d0c9SAndy Gross { "l21", QCOM_SMD_RPM_LDOA, 21, &pma8084_pldo, "vdd_l21" }, 926ee01d0c9SAndy Gross { "l22", QCOM_SMD_RPM_LDOA, 22, &pma8084_pldo, "vdd_l22" }, 927ee01d0c9SAndy Gross { "l23", QCOM_SMD_RPM_LDOA, 23, &pma8084_pldo, "vdd_l9_l10_l13_l20_l23_l24" }, 928ee01d0c9SAndy Gross { "l24", QCOM_SMD_RPM_LDOA, 24, &pma8084_pldo, "vdd_l9_l10_l13_l20_l23_l24" }, 929ee01d0c9SAndy Gross { "l25", QCOM_SMD_RPM_LDOA, 25, &pma8084_pldo, "vdd_l16_l25" }, 930ee01d0c9SAndy Gross { "l26", QCOM_SMD_RPM_LDOA, 26, &pma8084_pldo, "vdd_l6_l12_l14_l15_l26" }, 931ee01d0c9SAndy Gross { "l27", QCOM_SMD_RPM_LDOA, 27, &pma8084_nldo, "vdd_l2_l3_l4_l27" }, 932ee01d0c9SAndy Gross 933ee01d0c9SAndy Gross { "lvs1", QCOM_SMD_RPM_VSA, 1, &pma8084_switch }, 934ee01d0c9SAndy Gross { "lvs2", QCOM_SMD_RPM_VSA, 2, &pma8084_switch }, 935ee01d0c9SAndy Gross { "lvs3", QCOM_SMD_RPM_VSA, 3, &pma8084_switch }, 936ee01d0c9SAndy Gross { "lvs4", QCOM_SMD_RPM_VSA, 4, &pma8084_switch }, 937ee01d0c9SAndy Gross { "5vs1", QCOM_SMD_RPM_VSA, 5, &pma8084_switch }, 938ee01d0c9SAndy Gross 939ee01d0c9SAndy Gross {} 940ee01d0c9SAndy Gross }; 941ee01d0c9SAndy Gross 942e44adca5SAngelo G. Del Regno static const struct rpm_regulator_data rpm_pm8950_regulators[] = { 943e44adca5SAngelo G. Del Regno { "s1", QCOM_SMD_RPM_SMPA, 1, &pm8950_hfsmps, "vdd_s1" }, 944e44adca5SAngelo G. Del Regno { "s2", QCOM_SMD_RPM_SMPA, 2, &pm8950_hfsmps, "vdd_s2" }, 945e44adca5SAngelo G. Del Regno { "s3", QCOM_SMD_RPM_SMPA, 3, &pm8950_hfsmps, "vdd_s3" }, 946e44adca5SAngelo G. Del Regno { "s4", QCOM_SMD_RPM_SMPA, 4, &pm8950_hfsmps, "vdd_s4" }, 947b11b3d21SKonrad Dybcio /* S5 is managed via SPMI. */ 948e44adca5SAngelo G. Del Regno { "s6", QCOM_SMD_RPM_SMPA, 6, &pm8950_hfsmps, "vdd_s6" }, 949e44adca5SAngelo G. Del Regno 950e44adca5SAngelo G. Del Regno { "l1", QCOM_SMD_RPM_LDOA, 1, &pm8950_ult_nldo, "vdd_l1_l19" }, 951e44adca5SAngelo G. Del Regno { "l2", QCOM_SMD_RPM_LDOA, 2, &pm8950_ult_nldo, "vdd_l2_l23" }, 952e44adca5SAngelo G. Del Regno { "l3", QCOM_SMD_RPM_LDOA, 3, &pm8950_ult_nldo, "vdd_l3" }, 953b11b3d21SKonrad Dybcio /* L4 seems not to exist. */ 954b11b3d21SKonrad Dybcio { "l5", QCOM_SMD_RPM_LDOA, 5, &pm8950_pldo_lv, "vdd_l5_l6_l7_l16" }, 955b11b3d21SKonrad Dybcio { "l6", QCOM_SMD_RPM_LDOA, 6, &pm8950_pldo_lv, "vdd_l5_l6_l7_l16" }, 956b11b3d21SKonrad Dybcio { "l7", QCOM_SMD_RPM_LDOA, 7, &pm8950_pldo_lv, "vdd_l5_l6_l7_l16" }, 957e44adca5SAngelo G. Del Regno { "l8", QCOM_SMD_RPM_LDOA, 8, &pm8950_ult_pldo, "vdd_l8_l11_l12_l17_l22" }, 958e44adca5SAngelo G. Del Regno { "l9", QCOM_SMD_RPM_LDOA, 9, &pm8950_ult_pldo, "vdd_l9_l10_l13_l14_l15_l18" }, 959e44adca5SAngelo G. Del Regno { "l10", QCOM_SMD_RPM_LDOA, 10, &pm8950_ult_nldo, "vdd_l9_l10_l13_l14_l15_l18"}, 960e44adca5SAngelo G. Del Regno { "l11", QCOM_SMD_RPM_LDOA, 11, &pm8950_ult_pldo, "vdd_l8_l11_l12_l17_l22" }, 961e44adca5SAngelo G. Del Regno { "l12", QCOM_SMD_RPM_LDOA, 12, &pm8950_ult_pldo, "vdd_l8_l11_l12_l17_l22" }, 962e44adca5SAngelo G. Del Regno { "l13", QCOM_SMD_RPM_LDOA, 13, &pm8950_ult_pldo, "vdd_l9_l10_l13_l14_l15_l18" }, 963e44adca5SAngelo G. Del Regno { "l14", QCOM_SMD_RPM_LDOA, 14, &pm8950_ult_pldo, "vdd_l9_l10_l13_l14_l15_l18" }, 964e44adca5SAngelo G. Del Regno { "l15", QCOM_SMD_RPM_LDOA, 15, &pm8950_ult_pldo, "vdd_l9_l10_l13_l14_l15_l18" }, 965b11b3d21SKonrad Dybcio { "l16", QCOM_SMD_RPM_LDOA, 16, &pm8950_ult_pldo, "vdd_l5_l6_l7_l16" }, 966e44adca5SAngelo G. Del Regno { "l17", QCOM_SMD_RPM_LDOA, 17, &pm8950_ult_pldo, "vdd_l8_l11_l12_l17_l22" }, 967b11b3d21SKonrad Dybcio /* L18 seems not to exist. */ 968b11b3d21SKonrad Dybcio { "l19", QCOM_SMD_RPM_LDOA, 19, &pm8950_pldo, "vdd_l1_l19" }, 969b11b3d21SKonrad Dybcio /* L20 & L21 seem not to exist. */ 970b11b3d21SKonrad Dybcio { "l22", QCOM_SMD_RPM_LDOA, 22, &pm8950_pldo, "vdd_l8_l11_l12_l17_l22" }, 971b11b3d21SKonrad Dybcio { "l23", QCOM_SMD_RPM_LDOA, 23, &pm8950_pldo, "vdd_l2_l23" }, 972e44adca5SAngelo G. Del Regno {} 973e44adca5SAngelo G. Del Regno }; 974e44adca5SAngelo G. Del Regno 975b1a2fb10SVladimir Lypak static const struct rpm_regulator_data rpm_pm8953_regulators[] = { 976b1a2fb10SVladimir Lypak { "s1", QCOM_SMD_RPM_SMPA, 1, &pm8998_hfsmps, "vdd_s1" }, 977b1a2fb10SVladimir Lypak { "s2", QCOM_SMD_RPM_SMPA, 2, &pm8998_hfsmps, "vdd_s2" }, 978b1a2fb10SVladimir Lypak { "s3", QCOM_SMD_RPM_SMPA, 3, &pm8998_hfsmps, "vdd_s3" }, 979b1a2fb10SVladimir Lypak { "s4", QCOM_SMD_RPM_SMPA, 4, &pm8998_hfsmps, "vdd_s4" }, 980b1a2fb10SVladimir Lypak { "s5", QCOM_SMD_RPM_SMPA, 5, &pm8950_ftsmps2p5, "vdd_s5" }, 981b1a2fb10SVladimir Lypak { "s6", QCOM_SMD_RPM_SMPA, 6, &pm8950_ftsmps2p5, "vdd_s6" }, 982b1a2fb10SVladimir Lypak { "s7", QCOM_SMD_RPM_SMPA, 7, &pm8998_hfsmps, "vdd_s7" }, 983b1a2fb10SVladimir Lypak 984b1a2fb10SVladimir Lypak { "l1", QCOM_SMD_RPM_LDOA, 1, &pm8953_ult_nldo, "vdd_l1" }, 985b1a2fb10SVladimir Lypak { "l2", QCOM_SMD_RPM_LDOA, 2, &pm8953_ult_nldo, "vdd_l2_l3" }, 986b1a2fb10SVladimir Lypak { "l3", QCOM_SMD_RPM_LDOA, 3, &pm8953_ult_nldo, "vdd_l2_l3" }, 987b1a2fb10SVladimir Lypak { "l4", QCOM_SMD_RPM_LDOA, 4, &pm8950_ult_pldo, "vdd_l4_l5_l6_l7_l16_l19" }, 988b1a2fb10SVladimir Lypak { "l5", QCOM_SMD_RPM_LDOA, 5, &pm8950_ult_pldo, "vdd_l4_l5_l6_l7_l16_l19" }, 989b1a2fb10SVladimir Lypak { "l6", QCOM_SMD_RPM_LDOA, 6, &pm8950_ult_pldo, "vdd_l4_l5_l6_l7_l16_l19" }, 990b1a2fb10SVladimir Lypak { "l7", QCOM_SMD_RPM_LDOA, 7, &pm8950_ult_pldo, "vdd_l4_l5_l6_l7_l16_l19" }, 991b1a2fb10SVladimir Lypak { "l8", QCOM_SMD_RPM_LDOA, 8, &pm8950_ult_pldo, "vdd_l8_l11_l12_l13_l14_l15" }, 992b1a2fb10SVladimir Lypak { "l9", QCOM_SMD_RPM_LDOA, 9, &pm8950_ult_pldo, "vdd_l9_l10_l17_l18_l22" }, 993b1a2fb10SVladimir Lypak { "l10", QCOM_SMD_RPM_LDOA, 10, &pm8950_ult_pldo, "vdd_l9_l10_l17_l18_l22" }, 994b1a2fb10SVladimir Lypak { "l11", QCOM_SMD_RPM_LDOA, 11, &pm8950_ult_pldo, "vdd_l8_l11_l12_l13_l14_l15" }, 995b1a2fb10SVladimir Lypak { "l12", QCOM_SMD_RPM_LDOA, 12, &pm8950_ult_pldo, "vdd_l8_l11_l12_l13_l14_l15" }, 996b1a2fb10SVladimir Lypak { "l13", QCOM_SMD_RPM_LDOA, 13, &pm8950_ult_pldo, "vdd_l8_l11_l12_l13_l14_l15" }, 997b1a2fb10SVladimir Lypak { "l14", QCOM_SMD_RPM_LDOA, 14, &pm8950_ult_pldo, "vdd_l8_l11_l12_l13_l14_l15" }, 998b1a2fb10SVladimir Lypak { "l15", QCOM_SMD_RPM_LDOA, 15, &pm8950_ult_pldo, "vdd_l8_l11_l12_l13_l14_l15" }, 999b1a2fb10SVladimir Lypak { "l16", QCOM_SMD_RPM_LDOA, 16, &pm8950_ult_pldo, "vdd_l4_l5_l6_l7_l16_l19" }, 1000b1a2fb10SVladimir Lypak { "l17", QCOM_SMD_RPM_LDOA, 17, &pm8950_ult_pldo, "vdd_l9_l10_l17_l18_l22" }, 1001b1a2fb10SVladimir Lypak { "l18", QCOM_SMD_RPM_LDOA, 18, &pm8950_ult_pldo, "vdd_l9_l10_l17_l18_l22" }, 1002b1a2fb10SVladimir Lypak { "l19", QCOM_SMD_RPM_LDOA, 19, &pm8953_ult_nldo, "vdd_l4_l5_l6_l7_l16_l19" }, 1003b1a2fb10SVladimir Lypak { "l20", QCOM_SMD_RPM_LDOA, 20, &pm8953_lnldo, "vdd_l20" }, 1004b1a2fb10SVladimir Lypak { "l21", QCOM_SMD_RPM_LDOA, 21, &pm8953_lnldo, "vdd_l21" }, 1005b1a2fb10SVladimir Lypak { "l22", QCOM_SMD_RPM_LDOA, 22, &pm8950_ult_pldo, "vdd_l9_l10_l17_l18_l22" }, 1006b1a2fb10SVladimir Lypak { "l23", QCOM_SMD_RPM_LDOA, 23, &pm8953_ult_nldo, "vdd_l23" }, 1007b1a2fb10SVladimir Lypak {} 1008b1a2fb10SVladimir Lypak }; 1009b1a2fb10SVladimir Lypak 101014a16992SRajendra Nayak static const struct rpm_regulator_data rpm_pm8994_regulators[] = { 101114a16992SRajendra Nayak { "s1", QCOM_SMD_RPM_SMPA, 1, &pm8994_ftsmps, "vdd_s1" }, 101214a16992SRajendra Nayak { "s2", QCOM_SMD_RPM_SMPA, 2, &pm8994_ftsmps, "vdd_s2" }, 101314a16992SRajendra Nayak { "s3", QCOM_SMD_RPM_SMPA, 3, &pm8994_hfsmps, "vdd_s3" }, 101414a16992SRajendra Nayak { "s4", QCOM_SMD_RPM_SMPA, 4, &pm8994_hfsmps, "vdd_s4" }, 101514a16992SRajendra Nayak { "s5", QCOM_SMD_RPM_SMPA, 5, &pm8994_hfsmps, "vdd_s5" }, 101614a16992SRajendra Nayak { "s6", QCOM_SMD_RPM_SMPA, 6, &pm8994_ftsmps, "vdd_s6" }, 101714a16992SRajendra Nayak { "s7", QCOM_SMD_RPM_SMPA, 7, &pm8994_hfsmps, "vdd_s7" }, 101814a16992SRajendra Nayak { "s8", QCOM_SMD_RPM_SMPA, 8, &pm8994_ftsmps, "vdd_s8" }, 101914a16992SRajendra Nayak { "s9", QCOM_SMD_RPM_SMPA, 9, &pm8994_ftsmps, "vdd_s9" }, 102014a16992SRajendra Nayak { "s10", QCOM_SMD_RPM_SMPA, 10, &pm8994_ftsmps, "vdd_s10" }, 102114a16992SRajendra Nayak { "s11", QCOM_SMD_RPM_SMPA, 11, &pm8994_ftsmps, "vdd_s11" }, 102214a16992SRajendra Nayak { "s12", QCOM_SMD_RPM_SMPA, 12, &pm8994_ftsmps, "vdd_s12" }, 102314a16992SRajendra Nayak { "l1", QCOM_SMD_RPM_LDOA, 1, &pm8994_nldo, "vdd_l1" }, 102414a16992SRajendra Nayak { "l2", QCOM_SMD_RPM_LDOA, 2, &pm8994_nldo, "vdd_l2_l26_l28" }, 102514a16992SRajendra Nayak { "l3", QCOM_SMD_RPM_LDOA, 3, &pm8994_nldo, "vdd_l3_l11" }, 102614a16992SRajendra Nayak { "l4", QCOM_SMD_RPM_LDOA, 4, &pm8994_nldo, "vdd_l4_l27_l31" }, 102714a16992SRajendra Nayak { "l5", QCOM_SMD_RPM_LDOA, 5, &pm8994_lnldo, "vdd_l5_l7" }, 102814a16992SRajendra Nayak { "l6", QCOM_SMD_RPM_LDOA, 6, &pm8994_pldo, "vdd_l6_l12_l32" }, 102914a16992SRajendra Nayak { "l7", QCOM_SMD_RPM_LDOA, 7, &pm8994_lnldo, "vdd_l5_l7" }, 103014a16992SRajendra Nayak { "l8", QCOM_SMD_RPM_LDOA, 8, &pm8994_pldo, "vdd_l8_l16_l30" }, 103114a16992SRajendra Nayak { "l9", QCOM_SMD_RPM_LDOA, 9, &pm8994_pldo, "vdd_l9_l10_l18_l22" }, 103214a16992SRajendra Nayak { "l10", QCOM_SMD_RPM_LDOA, 10, &pm8994_pldo, "vdd_l9_l10_l18_l22" }, 103314a16992SRajendra Nayak { "l11", QCOM_SMD_RPM_LDOA, 11, &pm8994_nldo, "vdd_l3_l11" }, 103414a16992SRajendra Nayak { "l12", QCOM_SMD_RPM_LDOA, 12, &pm8994_pldo, "vdd_l6_l12_l32" }, 103514a16992SRajendra Nayak { "l13", QCOM_SMD_RPM_LDOA, 13, &pm8994_pldo, "vdd_l13_l19_l23_l24" }, 103614a16992SRajendra Nayak { "l14", QCOM_SMD_RPM_LDOA, 14, &pm8994_pldo, "vdd_l14_l15" }, 103714a16992SRajendra Nayak { "l15", QCOM_SMD_RPM_LDOA, 15, &pm8994_pldo, "vdd_l14_l15" }, 103814a16992SRajendra Nayak { "l16", QCOM_SMD_RPM_LDOA, 16, &pm8994_pldo, "vdd_l8_l16_l30" }, 103914a16992SRajendra Nayak { "l17", QCOM_SMD_RPM_LDOA, 17, &pm8994_pldo, "vdd_l17_l29" }, 104014a16992SRajendra Nayak { "l18", QCOM_SMD_RPM_LDOA, 18, &pm8994_pldo, "vdd_l9_l10_l18_l22" }, 104114a16992SRajendra Nayak { "l19", QCOM_SMD_RPM_LDOA, 19, &pm8994_pldo, "vdd_l13_l19_l23_l24" }, 104214a16992SRajendra Nayak { "l20", QCOM_SMD_RPM_LDOA, 20, &pm8994_pldo, "vdd_l20_l21" }, 104314a16992SRajendra Nayak { "l21", QCOM_SMD_RPM_LDOA, 21, &pm8994_pldo, "vdd_l20_l21" }, 104414a16992SRajendra Nayak { "l22", QCOM_SMD_RPM_LDOA, 22, &pm8994_pldo, "vdd_l9_l10_l18_l22" }, 104514a16992SRajendra Nayak { "l23", QCOM_SMD_RPM_LDOA, 23, &pm8994_pldo, "vdd_l13_l19_l23_l24" }, 104614a16992SRajendra Nayak { "l24", QCOM_SMD_RPM_LDOA, 24, &pm8994_pldo, "vdd_l13_l19_l23_l24" }, 104714a16992SRajendra Nayak { "l25", QCOM_SMD_RPM_LDOA, 25, &pm8994_pldo, "vdd_l25" }, 104814a16992SRajendra Nayak { "l26", QCOM_SMD_RPM_LDOA, 26, &pm8994_nldo, "vdd_l2_l26_l28" }, 104914a16992SRajendra Nayak { "l27", QCOM_SMD_RPM_LDOA, 27, &pm8994_nldo, "vdd_l4_l27_l31" }, 105014a16992SRajendra Nayak { "l28", QCOM_SMD_RPM_LDOA, 28, &pm8994_nldo, "vdd_l2_l26_l28" }, 105114a16992SRajendra Nayak { "l29", QCOM_SMD_RPM_LDOA, 29, &pm8994_pldo, "vdd_l17_l29" }, 105214a16992SRajendra Nayak { "l30", QCOM_SMD_RPM_LDOA, 30, &pm8994_pldo, "vdd_l8_l16_l30" }, 105314a16992SRajendra Nayak { "l31", QCOM_SMD_RPM_LDOA, 31, &pm8994_nldo, "vdd_l4_l27_l31" }, 105414a16992SRajendra Nayak { "l32", QCOM_SMD_RPM_LDOA, 32, &pm8994_pldo, "vdd_l6_l12_l32" }, 105514a16992SRajendra Nayak { "lvs1", QCOM_SMD_RPM_VSA, 1, &pm8994_switch, "vdd_lvs1_2" }, 105614a16992SRajendra Nayak { "lvs2", QCOM_SMD_RPM_VSA, 2, &pm8994_switch, "vdd_lvs1_2" }, 105714a16992SRajendra Nayak 105814a16992SRajendra Nayak {} 105914a16992SRajendra Nayak }; 106014a16992SRajendra Nayak 106186332c34SBjorn Andersson static const struct rpm_regulator_data rpm_pmi8994_regulators[] = { 106286332c34SBjorn Andersson { "s1", QCOM_SMD_RPM_SMPB, 1, &pmi8994_ftsmps, "vdd_s1" }, 106386332c34SBjorn Andersson { "s2", QCOM_SMD_RPM_SMPB, 2, &pmi8994_hfsmps, "vdd_s2" }, 10640d46f698SKonrad Dybcio { "s3", QCOM_SMD_RPM_SMPB, 3, &pmi8994_hfsmps, "vdd_s3" }, 106586332c34SBjorn Andersson { "boost-bypass", QCOM_SMD_RPM_BBYB, 1, &pmi8994_bby, "vdd_bst_byp" }, 106686332c34SBjorn Andersson {} 106786332c34SBjorn Andersson }; 106886332c34SBjorn Andersson 10693cdb741eSBjorn Andersson static const struct rpm_regulator_data rpm_pm8998_regulators[] = { 10703cdb741eSBjorn Andersson { "s1", QCOM_SMD_RPM_SMPA, 1, &pm8998_ftsmps, "vdd_s1" }, 10713cdb741eSBjorn Andersson { "s2", QCOM_SMD_RPM_SMPA, 2, &pm8998_ftsmps, "vdd_s2" }, 10723cdb741eSBjorn Andersson { "s3", QCOM_SMD_RPM_SMPA, 3, &pm8998_hfsmps, "vdd_s3" }, 10733cdb741eSBjorn Andersson { "s4", QCOM_SMD_RPM_SMPA, 4, &pm8998_hfsmps, "vdd_s4" }, 10743cdb741eSBjorn Andersson { "s5", QCOM_SMD_RPM_SMPA, 5, &pm8998_hfsmps, "vdd_s5" }, 10753cdb741eSBjorn Andersson { "s6", QCOM_SMD_RPM_SMPA, 6, &pm8998_ftsmps, "vdd_s6" }, 10763cdb741eSBjorn Andersson { "s7", QCOM_SMD_RPM_SMPA, 7, &pm8998_ftsmps, "vdd_s7" }, 10773cdb741eSBjorn Andersson { "s8", QCOM_SMD_RPM_SMPA, 8, &pm8998_ftsmps, "vdd_s8" }, 10783cdb741eSBjorn Andersson { "s9", QCOM_SMD_RPM_SMPA, 9, &pm8998_ftsmps, "vdd_s9" }, 10793cdb741eSBjorn Andersson { "s10", QCOM_SMD_RPM_SMPA, 10, &pm8998_ftsmps, "vdd_s10" }, 10803cdb741eSBjorn Andersson { "s11", QCOM_SMD_RPM_SMPA, 11, &pm8998_ftsmps, "vdd_s11" }, 10813cdb741eSBjorn Andersson { "s12", QCOM_SMD_RPM_SMPA, 12, &pm8998_ftsmps, "vdd_s12" }, 10823cdb741eSBjorn Andersson { "s13", QCOM_SMD_RPM_SMPA, 13, &pm8998_ftsmps, "vdd_s13" }, 10833cdb741eSBjorn Andersson { "l1", QCOM_SMD_RPM_LDOA, 1, &pm8998_nldo, "vdd_l1_l27" }, 10843cdb741eSBjorn Andersson { "l2", QCOM_SMD_RPM_LDOA, 2, &pm8998_nldo, "vdd_l2_l8_l17" }, 10853cdb741eSBjorn Andersson { "l3", QCOM_SMD_RPM_LDOA, 3, &pm8998_nldo, "vdd_l3_l11" }, 10863cdb741eSBjorn Andersson { "l4", QCOM_SMD_RPM_LDOA, 4, &pm8998_nldo, "vdd_l4_l5" }, 10873cdb741eSBjorn Andersson { "l5", QCOM_SMD_RPM_LDOA, 5, &pm8998_nldo, "vdd_l4_l5" }, 10883cdb741eSBjorn Andersson { "l6", QCOM_SMD_RPM_LDOA, 6, &pm8998_pldo, "vdd_l6" }, 10893cdb741eSBjorn Andersson { "l7", QCOM_SMD_RPM_LDOA, 7, &pm8998_pldo_lv, "vdd_l7_l12_l14_l15" }, 10903cdb741eSBjorn Andersson { "l8", QCOM_SMD_RPM_LDOA, 8, &pm8998_nldo, "vdd_l2_l8_l17" }, 10913cdb741eSBjorn Andersson { "l9", QCOM_SMD_RPM_LDOA, 9, &pm8998_pldo, "vdd_l9" }, 10923cdb741eSBjorn Andersson { "l10", QCOM_SMD_RPM_LDOA, 10, &pm8998_pldo, "vdd_l10_l23_l25" }, 10933cdb741eSBjorn Andersson { "l11", QCOM_SMD_RPM_LDOA, 11, &pm8998_nldo, "vdd_l3_l11" }, 10943cdb741eSBjorn Andersson { "l12", QCOM_SMD_RPM_LDOA, 12, &pm8998_pldo_lv, "vdd_l7_l12_l14_l15" }, 10953cdb741eSBjorn Andersson { "l13", QCOM_SMD_RPM_LDOA, 13, &pm8998_pldo, "vdd_l13_l19_l21" }, 10963cdb741eSBjorn Andersson { "l14", QCOM_SMD_RPM_LDOA, 14, &pm8998_pldo_lv, "vdd_l7_l12_l14_l15" }, 10973cdb741eSBjorn Andersson { "l15", QCOM_SMD_RPM_LDOA, 15, &pm8998_pldo_lv, "vdd_l7_l12_l14_l15" }, 10983cdb741eSBjorn Andersson { "l16", QCOM_SMD_RPM_LDOA, 16, &pm8998_pldo, "vdd_l16_l28" }, 10993cdb741eSBjorn Andersson { "l17", QCOM_SMD_RPM_LDOA, 17, &pm8998_nldo, "vdd_l2_l8_l17" }, 11003cdb741eSBjorn Andersson { "l18", QCOM_SMD_RPM_LDOA, 18, &pm8998_pldo, "vdd_l18_l22" }, 11013cdb741eSBjorn Andersson { "l19", QCOM_SMD_RPM_LDOA, 19, &pm8998_pldo, "vdd_l13_l19_l21" }, 11023cdb741eSBjorn Andersson { "l20", QCOM_SMD_RPM_LDOA, 20, &pm8998_pldo, "vdd_l20_l24" }, 11033cdb741eSBjorn Andersson { "l21", QCOM_SMD_RPM_LDOA, 21, &pm8998_pldo, "vdd_l13_l19_l21" }, 11043cdb741eSBjorn Andersson { "l22", QCOM_SMD_RPM_LDOA, 22, &pm8998_pldo, "vdd_l18_l22" }, 11053cdb741eSBjorn Andersson { "l23", QCOM_SMD_RPM_LDOA, 23, &pm8998_pldo, "vdd_l10_l23_l25" }, 11063cdb741eSBjorn Andersson { "l24", QCOM_SMD_RPM_LDOA, 24, &pm8998_pldo, "vdd_l20_l24" }, 11073cdb741eSBjorn Andersson { "l25", QCOM_SMD_RPM_LDOA, 25, &pm8998_pldo, "vdd_l10_l23_l25" }, 11083cdb741eSBjorn Andersson { "l26", QCOM_SMD_RPM_LDOA, 26, &pm8998_nldo, "vdd_l26" }, 11093cdb741eSBjorn Andersson { "l27", QCOM_SMD_RPM_LDOA, 27, &pm8998_nldo, "vdd_l1_l27" }, 11103cdb741eSBjorn Andersson { "l28", QCOM_SMD_RPM_LDOA, 28, &pm8998_pldo, "vdd_l16_l28" }, 11113cdb741eSBjorn Andersson { "lvs1", QCOM_SMD_RPM_VSA, 1, &pm8998_switch, "vdd_lvs1_lvs2" }, 11123cdb741eSBjorn Andersson { "lvs2", QCOM_SMD_RPM_VSA, 2, &pm8998_switch, "vdd_lvs1_lvs2" }, 11133cdb741eSBjorn Andersson {} 11143cdb741eSBjorn Andersson }; 11153cdb741eSBjorn Andersson 11163cdb741eSBjorn Andersson static const struct rpm_regulator_data rpm_pmi8998_regulators[] = { 11173cdb741eSBjorn Andersson { "bob", QCOM_SMD_RPM_BOBB, 1, &pmi8998_bob, "vdd_bob" }, 11183cdb741eSBjorn Andersson {} 11193cdb741eSBjorn Andersson }; 11203cdb741eSBjorn Andersson 11216d849653SAngeloGioacchino Del Regno static const struct rpm_regulator_data rpm_pm660_regulators[] = { 11226d849653SAngeloGioacchino Del Regno { "s1", QCOM_SMD_RPM_SMPA, 1, &pm660_ftsmps, "vdd_s1" }, 11236d849653SAngeloGioacchino Del Regno { "s2", QCOM_SMD_RPM_SMPA, 2, &pm660_ftsmps, "vdd_s2" }, 11246d849653SAngeloGioacchino Del Regno { "s3", QCOM_SMD_RPM_SMPA, 3, &pm660_ftsmps, "vdd_s3" }, 11256d849653SAngeloGioacchino Del Regno { "s4", QCOM_SMD_RPM_SMPA, 4, &pm660_hfsmps, "vdd_s4" }, 11266d849653SAngeloGioacchino Del Regno { "s5", QCOM_SMD_RPM_SMPA, 5, &pm660_hfsmps, "vdd_s5" }, 11276d849653SAngeloGioacchino Del Regno { "s6", QCOM_SMD_RPM_SMPA, 6, &pm660_hfsmps, "vdd_s6" }, 11286d849653SAngeloGioacchino Del Regno { "l1", QCOM_SMD_RPM_LDOA, 1, &pm660_nldo660, "vdd_l1_l6_l7" }, 11296d849653SAngeloGioacchino Del Regno { "l2", QCOM_SMD_RPM_LDOA, 2, &pm660_ht_nldo, "vdd_l2_l3" }, 11306d849653SAngeloGioacchino Del Regno { "l3", QCOM_SMD_RPM_LDOA, 3, &pm660_nldo660, "vdd_l2_l3" }, 11316d849653SAngeloGioacchino Del Regno /* l4 is unaccessible on PM660 */ 11326d849653SAngeloGioacchino Del Regno { "l5", QCOM_SMD_RPM_LDOA, 5, &pm660_ht_nldo, "vdd_l5" }, 11336d849653SAngeloGioacchino Del Regno { "l6", QCOM_SMD_RPM_LDOA, 6, &pm660_ht_nldo, "vdd_l1_l6_l7" }, 11346d849653SAngeloGioacchino Del Regno { "l7", QCOM_SMD_RPM_LDOA, 7, &pm660_ht_nldo, "vdd_l1_l6_l7" }, 11356d849653SAngeloGioacchino Del Regno { "l8", QCOM_SMD_RPM_LDOA, 8, &pm660_ht_lvpldo, "vdd_l8_l9_l10_l11_l12_l13_l14" }, 11366d849653SAngeloGioacchino Del Regno { "l9", QCOM_SMD_RPM_LDOA, 9, &pm660_ht_lvpldo, "vdd_l8_l9_l10_l11_l12_l13_l14" }, 11376d849653SAngeloGioacchino Del Regno { "l10", QCOM_SMD_RPM_LDOA, 10, &pm660_ht_lvpldo, "vdd_l8_l9_l10_l11_l12_l13_l14" }, 11386d849653SAngeloGioacchino Del Regno { "l11", QCOM_SMD_RPM_LDOA, 11, &pm660_ht_lvpldo, "vdd_l8_l9_l10_l11_l12_l13_l14" }, 11396d849653SAngeloGioacchino Del Regno { "l12", QCOM_SMD_RPM_LDOA, 12, &pm660_ht_lvpldo, "vdd_l8_l9_l10_l11_l12_l13_l14" }, 11406d849653SAngeloGioacchino Del Regno { "l13", QCOM_SMD_RPM_LDOA, 13, &pm660_ht_lvpldo, "vdd_l8_l9_l10_l11_l12_l13_l14" }, 11416d849653SAngeloGioacchino Del Regno { "l14", QCOM_SMD_RPM_LDOA, 14, &pm660_ht_lvpldo, "vdd_l8_l9_l10_l11_l12_l13_l14" }, 11426d849653SAngeloGioacchino Del Regno { "l15", QCOM_SMD_RPM_LDOA, 15, &pm660_pldo660, "vdd_l15_l16_l17_l18_l19" }, 11436d849653SAngeloGioacchino Del Regno { "l16", QCOM_SMD_RPM_LDOA, 16, &pm660_pldo660, "vdd_l15_l16_l17_l18_l19" }, 11446d849653SAngeloGioacchino Del Regno { "l17", QCOM_SMD_RPM_LDOA, 17, &pm660_pldo660, "vdd_l15_l16_l17_l18_l19" }, 11456d849653SAngeloGioacchino Del Regno { "l18", QCOM_SMD_RPM_LDOA, 18, &pm660_pldo660, "vdd_l15_l16_l17_l18_l19" }, 11466d849653SAngeloGioacchino Del Regno { "l19", QCOM_SMD_RPM_LDOA, 19, &pm660_pldo660, "vdd_l15_l16_l17_l18_l19" }, 11476d849653SAngeloGioacchino Del Regno { } 11486d849653SAngeloGioacchino Del Regno }; 11496d849653SAngeloGioacchino Del Regno 11506d849653SAngeloGioacchino Del Regno static const struct rpm_regulator_data rpm_pm660l_regulators[] = { 11516d849653SAngeloGioacchino Del Regno { "s1", QCOM_SMD_RPM_SMPB, 1, &pm660_ftsmps, "vdd_s1" }, 11526d849653SAngeloGioacchino Del Regno { "s2", QCOM_SMD_RPM_SMPB, 2, &pm660_ftsmps, "vdd_s2" }, 11536d849653SAngeloGioacchino Del Regno { "s3", QCOM_SMD_RPM_RWCX, 0, &pm660_ftsmps, "vdd_s3_s4" }, 11546d849653SAngeloGioacchino Del Regno { "s5", QCOM_SMD_RPM_RWMX, 0, &pm660_ftsmps, "vdd_s5" }, 11556d849653SAngeloGioacchino Del Regno { "l1", QCOM_SMD_RPM_LDOB, 1, &pm660_nldo660, "vdd_l1_l9_l10" }, 11566d849653SAngeloGioacchino Del Regno { "l2", QCOM_SMD_RPM_LDOB, 2, &pm660_pldo660, "vdd_l2" }, 11576d849653SAngeloGioacchino Del Regno { "l3", QCOM_SMD_RPM_LDOB, 3, &pm660_pldo660, "vdd_l3_l5_l7_l8" }, 11586d849653SAngeloGioacchino Del Regno { "l4", QCOM_SMD_RPM_LDOB, 4, &pm660_pldo660, "vdd_l4_l6" }, 11596d849653SAngeloGioacchino Del Regno { "l5", QCOM_SMD_RPM_LDOB, 5, &pm660_pldo660, "vdd_l3_l5_l7_l8" }, 11606d849653SAngeloGioacchino Del Regno { "l6", QCOM_SMD_RPM_LDOB, 6, &pm660_pldo660, "vdd_l4_l6" }, 11616d849653SAngeloGioacchino Del Regno { "l7", QCOM_SMD_RPM_LDOB, 7, &pm660_pldo660, "vdd_l3_l5_l7_l8" }, 11626d849653SAngeloGioacchino Del Regno { "l8", QCOM_SMD_RPM_LDOB, 8, &pm660_pldo660, "vdd_l3_l5_l7_l8" }, 11636d849653SAngeloGioacchino Del Regno { "l9", QCOM_SMD_RPM_RWLC, 0, &pm660_ht_nldo, "vdd_l1_l9_l10" }, 11646d849653SAngeloGioacchino Del Regno { "l10", QCOM_SMD_RPM_RWLM, 0, &pm660_ht_nldo, "vdd_l1_l9_l10" }, 11656d849653SAngeloGioacchino Del Regno { "bob", QCOM_SMD_RPM_BOBB, 1, &pm660l_bob, "vdd_bob", }, 11666d849653SAngeloGioacchino Del Regno { } 11676d849653SAngeloGioacchino Del Regno }; 11686d849653SAngeloGioacchino Del Regno 1169f589d95bSBjorn Andersson static const struct rpm_regulator_data rpm_pms405_regulators[] = { 1170f589d95bSBjorn Andersson { "s1", QCOM_SMD_RPM_SMPA, 1, &pms405_hfsmps3, "vdd_s1" }, 1171f589d95bSBjorn Andersson { "s2", QCOM_SMD_RPM_SMPA, 2, &pms405_hfsmps3, "vdd_s2" }, 1172f589d95bSBjorn Andersson { "s3", QCOM_SMD_RPM_SMPA, 3, &pms405_hfsmps3, "vdd_s3" }, 1173f589d95bSBjorn Andersson { "s4", QCOM_SMD_RPM_SMPA, 4, &pms405_hfsmps3, "vdd_s4" }, 1174f589d95bSBjorn Andersson { "s5", QCOM_SMD_RPM_SMPA, 5, &pms405_hfsmps3, "vdd_s5" }, 1175f589d95bSBjorn Andersson { "l1", QCOM_SMD_RPM_LDOA, 1, &pms405_nldo1200, "vdd_l1_l2" }, 1176f589d95bSBjorn Andersson { "l2", QCOM_SMD_RPM_LDOA, 2, &pms405_nldo1200, "vdd_l1_l2" }, 1177f589d95bSBjorn Andersson { "l3", QCOM_SMD_RPM_LDOA, 3, &pms405_nldo1200, "vdd_l3_l8" }, 1178f589d95bSBjorn Andersson { "l4", QCOM_SMD_RPM_LDOA, 4, &pms405_nldo300, "vdd_l4" }, 1179f589d95bSBjorn Andersson { "l5", QCOM_SMD_RPM_LDOA, 5, &pms405_pldo600, "vdd_l5_l6" }, 1180f589d95bSBjorn Andersson { "l6", QCOM_SMD_RPM_LDOA, 6, &pms405_pldo600, "vdd_l5_l6" }, 1181f589d95bSBjorn Andersson { "l7", QCOM_SMD_RPM_LDOA, 7, &pms405_pldo150, "vdd_l7" }, 1182f589d95bSBjorn Andersson { "l8", QCOM_SMD_RPM_LDOA, 8, &pms405_nldo1200, "vdd_l3_l8" }, 1183f589d95bSBjorn Andersson { "l9", QCOM_SMD_RPM_LDOA, 9, &pms405_nldo1200, "vdd_l9" }, 1184f589d95bSBjorn Andersson { "l10", QCOM_SMD_RPM_LDOA, 10, &pms405_pldo50, "vdd_l10_l11_l12_l13" }, 1185f589d95bSBjorn Andersson { "l11", QCOM_SMD_RPM_LDOA, 11, &pms405_pldo150, "vdd_l10_l11_l12_l13" }, 1186f589d95bSBjorn Andersson { "l12", QCOM_SMD_RPM_LDOA, 12, &pms405_pldo150, "vdd_l10_l11_l12_l13" }, 1187f589d95bSBjorn Andersson { "l13", QCOM_SMD_RPM_LDOA, 13, &pms405_pldo150, "vdd_l10_l11_l12_l13" }, 1188f589d95bSBjorn Andersson {} 1189f589d95bSBjorn Andersson }; 1190f589d95bSBjorn Andersson 1191400c9315SShawn Guo static const struct rpm_regulator_data rpm_pm2250_regulators[] = { 1192400c9315SShawn Guo { "s1", QCOM_SMD_RPM_SMPA, 1, &pm2250_lvftsmps, "vdd_s1" }, 1193400c9315SShawn Guo { "s2", QCOM_SMD_RPM_SMPA, 2, &pm2250_lvftsmps, "vdd_s2" }, 1194400c9315SShawn Guo { "s3", QCOM_SMD_RPM_SMPA, 3, &pm2250_lvftsmps, "vdd_s3" }, 1195400c9315SShawn Guo { "s4", QCOM_SMD_RPM_SMPA, 4, &pm2250_ftsmps, "vdd_s4" }, 1196400c9315SShawn Guo { "l1", QCOM_SMD_RPM_LDOA, 1, &pm660_nldo660, "vdd_l1_l2_l3_l5_l6_l7_l8_l9_l10_l11_l12" }, 1197400c9315SShawn Guo { "l2", QCOM_SMD_RPM_LDOA, 2, &pm660_nldo660, "vdd_l1_l2_l3_l5_l6_l7_l8_l9_l10_l11_l12" }, 1198400c9315SShawn Guo { "l3", QCOM_SMD_RPM_LDOA, 3, &pm660_nldo660, "vdd_l1_l2_l3_l5_l6_l7_l8_l9_l10_l11_l12" }, 1199400c9315SShawn Guo { "l4", QCOM_SMD_RPM_LDOA, 4, &pm660_pldo660, "vdd_l4_l17_l18_l19_l20_l21_l22" }, 1200400c9315SShawn Guo { "l5", QCOM_SMD_RPM_LDOA, 5, &pm660_nldo660, "vdd_l1_l2_l3_l5_l6_l7_l8_l9_l10_l11_l12" }, 1201400c9315SShawn Guo { "l6", QCOM_SMD_RPM_LDOA, 6, &pm660_nldo660, "vdd_l1_l2_l3_l5_l6_l7_l8_l9_l10_l11_l12" }, 1202400c9315SShawn Guo { "l7", QCOM_SMD_RPM_LDOA, 7, &pm660_nldo660, "vdd_l1_l2_l3_l5_l6_l7_l8_l9_l10_l11_l12" }, 1203400c9315SShawn Guo { "l8", QCOM_SMD_RPM_LDOA, 8, &pm660_nldo660, "vdd_l1_l2_l3_l5_l6_l7_l8_l9_l10_l11_l12" }, 1204400c9315SShawn Guo { "l9", QCOM_SMD_RPM_LDOA, 9, &pm660_nldo660, "vdd_l1_l2_l3_l5_l6_l7_l8_l9_l10_l11_l12" }, 1205400c9315SShawn Guo { "l10", QCOM_SMD_RPM_LDOA, 10, &pm660_nldo660, "vdd_l1_l2_l3_l5_l6_l7_l8_l9_l10_l11_l12" }, 1206400c9315SShawn Guo { "l11", QCOM_SMD_RPM_LDOA, 11, &pm660_nldo660, "vdd_l1_l2_l3_l5_l6_l7_l8_l9_l10_l11_l12" }, 1207400c9315SShawn Guo { "l12", QCOM_SMD_RPM_LDOA, 12, &pm660_nldo660, "vdd_l1_l2_l3_l5_l6_l7_l8_l9_l10_l11_l12" }, 1208400c9315SShawn Guo { "l13", QCOM_SMD_RPM_LDOA, 13, &pm660_ht_lvpldo, "vdd_l13_l14_l15_l16" }, 1209400c9315SShawn Guo { "l14", QCOM_SMD_RPM_LDOA, 14, &pm660_ht_lvpldo, "vdd_l13_l14_l15_l16" }, 1210400c9315SShawn Guo { "l15", QCOM_SMD_RPM_LDOA, 15, &pm660_ht_lvpldo, "vdd_l13_l14_l15_l16" }, 1211400c9315SShawn Guo { "l16", QCOM_SMD_RPM_LDOA, 16, &pm660_ht_lvpldo, "vdd_l13_l14_l15_l16" }, 1212400c9315SShawn Guo { "l17", QCOM_SMD_RPM_LDOA, 17, &pm660_pldo660, "vdd_l4_l17_l18_l19_l20_l21_l22" }, 1213400c9315SShawn Guo { "l18", QCOM_SMD_RPM_LDOA, 18, &pm660_pldo660, "vdd_l4_l17_l18_l19_l20_l21_l22" }, 1214400c9315SShawn Guo { "l19", QCOM_SMD_RPM_LDOA, 19, &pm660_pldo660, "vdd_l4_l17_l18_l19_l20_l21_l22" }, 1215400c9315SShawn Guo { "l20", QCOM_SMD_RPM_LDOA, 20, &pm660_pldo660, "vdd_l4_l17_l18_l19_l20_l21_l22" }, 1216400c9315SShawn Guo { "l21", QCOM_SMD_RPM_LDOA, 21, &pm660_pldo660, "vdd_l4_l17_l18_l19_l20_l21_l22" }, 1217400c9315SShawn Guo { "l22", QCOM_SMD_RPM_LDOA, 22, &pm660_pldo660, "vdd_l4_l17_l18_l19_l20_l21_l22" }, 1218400c9315SShawn Guo {} 1219400c9315SShawn Guo }; 1220400c9315SShawn Guo 1221da65e367SBjorn Andersson static const struct of_device_id rpm_of_match[] = { 122247894c85SKathiravan T { .compatible = "qcom,rpm-mp5496-regulators", .data = &rpm_mp5496_regulators }, 1223da65e367SBjorn Andersson { .compatible = "qcom,rpm-pm8841-regulators", .data = &rpm_pm8841_regulators }, 122457d65676SAndy Gross { .compatible = "qcom,rpm-pm8916-regulators", .data = &rpm_pm8916_regulators }, 12258c816d56SBartosz Dudziak { .compatible = "qcom,rpm-pm8226-regulators", .data = &rpm_pm8226_regulators }, 1226da65e367SBjorn Andersson { .compatible = "qcom,rpm-pm8941-regulators", .data = &rpm_pm8941_regulators }, 1227e44adca5SAngelo G. Del Regno { .compatible = "qcom,rpm-pm8950-regulators", .data = &rpm_pm8950_regulators }, 1228b1a2fb10SVladimir Lypak { .compatible = "qcom,rpm-pm8953-regulators", .data = &rpm_pm8953_regulators }, 122914a16992SRajendra Nayak { .compatible = "qcom,rpm-pm8994-regulators", .data = &rpm_pm8994_regulators }, 12303cdb741eSBjorn Andersson { .compatible = "qcom,rpm-pm8998-regulators", .data = &rpm_pm8998_regulators }, 12316d849653SAngeloGioacchino Del Regno { .compatible = "qcom,rpm-pm660-regulators", .data = &rpm_pm660_regulators }, 12326d849653SAngeloGioacchino Del Regno { .compatible = "qcom,rpm-pm660l-regulators", .data = &rpm_pm660l_regulators }, 1233ee01d0c9SAndy Gross { .compatible = "qcom,rpm-pma8084-regulators", .data = &rpm_pma8084_regulators }, 123486332c34SBjorn Andersson { .compatible = "qcom,rpm-pmi8994-regulators", .data = &rpm_pmi8994_regulators }, 12353cdb741eSBjorn Andersson { .compatible = "qcom,rpm-pmi8998-regulators", .data = &rpm_pmi8998_regulators }, 1236f589d95bSBjorn Andersson { .compatible = "qcom,rpm-pms405-regulators", .data = &rpm_pms405_regulators }, 1237400c9315SShawn Guo { .compatible = "qcom,rpm-pm2250-regulators", .data = &rpm_pm2250_regulators }, 1238da65e367SBjorn Andersson {} 1239da65e367SBjorn Andersson }; 1240da65e367SBjorn Andersson MODULE_DEVICE_TABLE(of, rpm_of_match); 1241da65e367SBjorn Andersson 124214e2976fSKonrad Dybcio /** 124314e2976fSKonrad Dybcio * rpm_regulator_init_vreg() - initialize all attributes of a qcom_smd-regulator 124414e2976fSKonrad Dybcio * @vreg: Pointer to the individual qcom_smd-regulator resource 124514e2976fSKonrad Dybcio * @dev: Pointer to the top level qcom_smd-regulator PMIC device 124614e2976fSKonrad Dybcio * @node: Pointer to the individual qcom_smd-regulator resource 124714e2976fSKonrad Dybcio * device node 124814e2976fSKonrad Dybcio * @rpm: Pointer to the rpm bus node 124914e2976fSKonrad Dybcio * @pmic_rpm_data: Pointer to a null-terminated array of qcom_smd-regulator 125014e2976fSKonrad Dybcio * resources defined for the top level PMIC device 125114e2976fSKonrad Dybcio * 125214e2976fSKonrad Dybcio * Return: 0 on success, errno on failure 125314e2976fSKonrad Dybcio */ 125414e2976fSKonrad Dybcio static int rpm_regulator_init_vreg(struct qcom_rpm_reg *vreg, struct device *dev, 125514e2976fSKonrad Dybcio struct device_node *node, struct qcom_smd_rpm *rpm, 125614e2976fSKonrad Dybcio const struct rpm_regulator_data *pmic_rpm_data) 125714e2976fSKonrad Dybcio { 125814e2976fSKonrad Dybcio struct regulator_config config = {}; 125914e2976fSKonrad Dybcio const struct rpm_regulator_data *rpm_data; 126014e2976fSKonrad Dybcio struct regulator_dev *rdev; 126114e2976fSKonrad Dybcio int ret; 126214e2976fSKonrad Dybcio 126314e2976fSKonrad Dybcio for (rpm_data = pmic_rpm_data; rpm_data->name; rpm_data++) 126414e2976fSKonrad Dybcio if (of_node_name_eq(node, rpm_data->name)) 126514e2976fSKonrad Dybcio break; 126614e2976fSKonrad Dybcio 126714e2976fSKonrad Dybcio if (!rpm_data->name) { 126814e2976fSKonrad Dybcio dev_err(dev, "Unknown regulator %pOFn\n", node); 126914e2976fSKonrad Dybcio return -EINVAL; 127014e2976fSKonrad Dybcio } 127114e2976fSKonrad Dybcio 127214e2976fSKonrad Dybcio vreg->dev = dev; 127314e2976fSKonrad Dybcio vreg->rpm = rpm; 127414e2976fSKonrad Dybcio vreg->type = rpm_data->type; 127514e2976fSKonrad Dybcio vreg->id = rpm_data->id; 127614e2976fSKonrad Dybcio 127714e2976fSKonrad Dybcio memcpy(&vreg->desc, rpm_data->desc, sizeof(vreg->desc)); 127814e2976fSKonrad Dybcio vreg->desc.name = rpm_data->name; 127914e2976fSKonrad Dybcio vreg->desc.supply_name = rpm_data->supply; 128014e2976fSKonrad Dybcio vreg->desc.owner = THIS_MODULE; 128114e2976fSKonrad Dybcio vreg->desc.type = REGULATOR_VOLTAGE; 128214e2976fSKonrad Dybcio vreg->desc.of_match = rpm_data->name; 128314e2976fSKonrad Dybcio 128414e2976fSKonrad Dybcio config.dev = dev; 128514e2976fSKonrad Dybcio config.of_node = node; 128614e2976fSKonrad Dybcio config.driver_data = vreg; 128714e2976fSKonrad Dybcio 128814e2976fSKonrad Dybcio rdev = devm_regulator_register(dev, &vreg->desc, &config); 128914e2976fSKonrad Dybcio if (IS_ERR(rdev)) { 129014e2976fSKonrad Dybcio ret = PTR_ERR(rdev); 129114e2976fSKonrad Dybcio dev_err(dev, "%pOFn: devm_regulator_register() failed, ret=%d\n", node, ret); 129214e2976fSKonrad Dybcio return ret; 129314e2976fSKonrad Dybcio } 129414e2976fSKonrad Dybcio 129514e2976fSKonrad Dybcio return 0; 129614e2976fSKonrad Dybcio } 129714e2976fSKonrad Dybcio 1298da65e367SBjorn Andersson static int rpm_reg_probe(struct platform_device *pdev) 1299da65e367SBjorn Andersson { 130014e2976fSKonrad Dybcio struct device *dev = &pdev->dev; 130114e2976fSKonrad Dybcio const struct rpm_regulator_data *vreg_data; 130214e2976fSKonrad Dybcio struct device_node *node; 1303da65e367SBjorn Andersson struct qcom_rpm_reg *vreg; 1304da65e367SBjorn Andersson struct qcom_smd_rpm *rpm; 130514e2976fSKonrad Dybcio int ret; 1306da65e367SBjorn Andersson 1307da65e367SBjorn Andersson rpm = dev_get_drvdata(pdev->dev.parent); 1308da65e367SBjorn Andersson if (!rpm) { 130914e2976fSKonrad Dybcio dev_err(&pdev->dev, "Unable to retrieve handle to rpm\n"); 1310da65e367SBjorn Andersson return -ENODEV; 1311da65e367SBjorn Andersson } 1312da65e367SBjorn Andersson 131314e2976fSKonrad Dybcio vreg_data = of_device_get_match_data(dev); 131414e2976fSKonrad Dybcio if (!vreg_data) 1315e3b53b8aSGustavo A. R. Silva return -ENODEV; 1316e3b53b8aSGustavo A. R. Silva 131714e2976fSKonrad Dybcio for_each_available_child_of_node(dev->of_node, node) { 1318da65e367SBjorn Andersson vreg = devm_kzalloc(&pdev->dev, sizeof(*vreg), GFP_KERNEL); 13196390d42cSkernel test robot if (!vreg) { 13206390d42cSkernel test robot of_node_put(node); 1321da65e367SBjorn Andersson return -ENOMEM; 13226390d42cSkernel test robot } 1323da65e367SBjorn Andersson 132414e2976fSKonrad Dybcio ret = rpm_regulator_init_vreg(vreg, dev, node, rpm, vreg_data); 1325da65e367SBjorn Andersson 132614e2976fSKonrad Dybcio if (ret < 0) { 132714e2976fSKonrad Dybcio of_node_put(node); 132814e2976fSKonrad Dybcio return ret; 1329da65e367SBjorn Andersson } 1330da65e367SBjorn Andersson } 1331da65e367SBjorn Andersson 1332da65e367SBjorn Andersson return 0; 1333da65e367SBjorn Andersson } 1334da65e367SBjorn Andersson 1335da65e367SBjorn Andersson static struct platform_driver rpm_reg_driver = { 1336da65e367SBjorn Andersson .probe = rpm_reg_probe, 1337da65e367SBjorn Andersson .driver = { 1338da65e367SBjorn Andersson .name = "qcom_rpm_smd_regulator", 1339da65e367SBjorn Andersson .of_match_table = rpm_of_match, 1340da65e367SBjorn Andersson }, 1341da65e367SBjorn Andersson }; 1342da65e367SBjorn Andersson 1343da65e367SBjorn Andersson static int __init rpm_reg_init(void) 1344da65e367SBjorn Andersson { 1345da65e367SBjorn Andersson return platform_driver_register(&rpm_reg_driver); 1346da65e367SBjorn Andersson } 1347da65e367SBjorn Andersson subsys_initcall(rpm_reg_init); 1348da65e367SBjorn Andersson 1349da65e367SBjorn Andersson static void __exit rpm_reg_exit(void) 1350da65e367SBjorn Andersson { 1351da65e367SBjorn Andersson platform_driver_unregister(&rpm_reg_driver); 1352da65e367SBjorn Andersson } 1353da65e367SBjorn Andersson module_exit(rpm_reg_exit) 1354da65e367SBjorn Andersson 1355da65e367SBjorn Andersson MODULE_DESCRIPTION("Qualcomm RPM regulator driver"); 1356da65e367SBjorn Andersson MODULE_LICENSE("GPL v2"); 1357