Lines Matching +full:rpm +full:- +full:pm8941 +full:- +full:regulators
1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
12 #include <linux/soc/qcom/smd-rpm.h>
17 struct qcom_smd_rpm *rpm; member
49 if (vreg->enabled_updated) { in rpm_reg_write_active()
52 req[reqlen].value = cpu_to_le32(vreg->is_enabled); in rpm_reg_write_active()
56 if (vreg->uv_updated && vreg->is_enabled) { in rpm_reg_write_active()
59 req[reqlen].value = cpu_to_le32(vreg->uV); in rpm_reg_write_active()
63 if (vreg->load_updated && vreg->is_enabled) { in rpm_reg_write_active()
66 req[reqlen].value = cpu_to_le32(vreg->load / 1000); in rpm_reg_write_active()
73 ret = qcom_rpm_smd_write(vreg->rpm, QCOM_SMD_RPM_ACTIVE_STATE, in rpm_reg_write_active()
74 vreg->type, vreg->id, in rpm_reg_write_active()
77 vreg->enabled_updated = 0; in rpm_reg_write_active()
78 vreg->uv_updated = 0; in rpm_reg_write_active()
79 vreg->load_updated = 0; in rpm_reg_write_active()
90 vreg->is_enabled = 1; in rpm_reg_enable()
91 vreg->enabled_updated = 1; in rpm_reg_enable()
95 vreg->is_enabled = 0; in rpm_reg_enable()
104 return vreg->is_enabled; in rpm_reg_is_enabled()
112 vreg->is_enabled = 0; in rpm_reg_disable()
113 vreg->enabled_updated = 1; in rpm_reg_disable()
117 vreg->is_enabled = 1; in rpm_reg_disable()
126 return vreg->uV; in rpm_reg_get_voltage()
136 int old_uV = vreg->uV; in rpm_reg_set_voltage()
138 vreg->uV = min_uV; in rpm_reg_set_voltage()
139 vreg->uv_updated = 1; in rpm_reg_set_voltage()
143 vreg->uV = old_uV; in rpm_reg_set_voltage()
151 u32 old_load = vreg->load; in rpm_reg_set_load()
154 vreg->load = load_uA; in rpm_reg_set_load()
155 vreg->load_updated = 1; in rpm_reg_set_load()
158 vreg->load = old_load; in rpm_reg_set_load()
965 { "boost-bypass", QCOM_SMD_RPM_BBYB, 1, &pmi8994_bby, "vdd_bst_byp" },
1092 { .compatible = "qcom,rpm-mp5496-regulators", .data = &rpm_mp5496_regulators },
1093 { .compatible = "qcom,rpm-pm8841-regulators", .data = &rpm_pm8841_regulators },
1094 { .compatible = "qcom,rpm-pm8916-regulators", .data = &rpm_pm8916_regulators },
1095 { .compatible = "qcom,rpm-pm8941-regulators", .data = &rpm_pm8941_regulators },
1096 { .compatible = "qcom,rpm-pm8950-regulators", .data = &rpm_pm8950_regulators },
1097 { .compatible = "qcom,rpm-pm8953-regulators", .data = &rpm_pm8953_regulators },
1098 { .compatible = "qcom,rpm-pm8994-regulators", .data = &rpm_pm8994_regulators },
1099 { .compatible = "qcom,rpm-pm8998-regulators", .data = &rpm_pm8998_regulators },
1100 { .compatible = "qcom,rpm-pm660-regulators", .data = &rpm_pm660_regulators },
1101 { .compatible = "qcom,rpm-pm660l-regulators", .data = &rpm_pm660l_regulators },
1102 { .compatible = "qcom,rpm-pma8084-regulators", .data = &rpm_pma8084_regulators },
1103 { .compatible = "qcom,rpm-pmi8994-regulators", .data = &rpm_pmi8994_regulators },
1104 { .compatible = "qcom,rpm-pmi8998-regulators", .data = &rpm_pmi8998_regulators },
1105 { .compatible = "qcom,rpm-pms405-regulators", .data = &rpm_pms405_regulators },
1117 struct qcom_smd_rpm *rpm; in rpm_reg_probe() local
1119 rpm = dev_get_drvdata(pdev->dev.parent); in rpm_reg_probe()
1120 if (!rpm) { in rpm_reg_probe()
1121 dev_err(&pdev->dev, "unable to retrieve handle to rpm\n"); in rpm_reg_probe()
1122 return -ENODEV; in rpm_reg_probe()
1125 match = of_match_device(rpm_of_match, &pdev->dev); in rpm_reg_probe()
1127 dev_err(&pdev->dev, "failed to match device\n"); in rpm_reg_probe()
1128 return -ENODEV; in rpm_reg_probe()
1131 for (reg = match->data; reg->name; reg++) { in rpm_reg_probe()
1132 vreg = devm_kzalloc(&pdev->dev, sizeof(*vreg), GFP_KERNEL); in rpm_reg_probe()
1134 return -ENOMEM; in rpm_reg_probe()
1136 vreg->dev = &pdev->dev; in rpm_reg_probe()
1137 vreg->type = reg->type; in rpm_reg_probe()
1138 vreg->id = reg->id; in rpm_reg_probe()
1139 vreg->rpm = rpm; in rpm_reg_probe()
1141 memcpy(&vreg->desc, reg->desc, sizeof(vreg->desc)); in rpm_reg_probe()
1143 vreg->desc.id = -1; in rpm_reg_probe()
1144 vreg->desc.owner = THIS_MODULE; in rpm_reg_probe()
1145 vreg->desc.type = REGULATOR_VOLTAGE; in rpm_reg_probe()
1146 vreg->desc.name = reg->name; in rpm_reg_probe()
1147 vreg->desc.supply_name = reg->supply; in rpm_reg_probe()
1148 vreg->desc.of_match = reg->name; in rpm_reg_probe()
1150 config.dev = &pdev->dev; in rpm_reg_probe()
1152 rdev = devm_regulator_register(&pdev->dev, &vreg->desc, &config); in rpm_reg_probe()
1154 dev_err(&pdev->dev, "failed to register %s\n", reg->name); in rpm_reg_probe()
1182 MODULE_DESCRIPTION("Qualcomm RPM regulator driver");