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>
48 if (vreg->enabled_updated) { in rpm_reg_write_active()
51 req[reqlen].value = cpu_to_le32(vreg->is_enabled); in rpm_reg_write_active()
55 if (vreg->uv_updated && vreg->is_enabled) { in rpm_reg_write_active()
58 req[reqlen].value = cpu_to_le32(vreg->uV); in rpm_reg_write_active()
62 if (vreg->load_updated && vreg->is_enabled) { in rpm_reg_write_active()
65 req[reqlen].value = cpu_to_le32(vreg->load / 1000); in rpm_reg_write_active()
73 vreg->type, vreg->id, in rpm_reg_write_active()
76 vreg->enabled_updated = 0; in rpm_reg_write_active()
77 vreg->uv_updated = 0; in rpm_reg_write_active()
78 vreg->load_updated = 0; in rpm_reg_write_active()
89 vreg->is_enabled = 1; in rpm_reg_enable()
90 vreg->enabled_updated = 1; in rpm_reg_enable()
94 vreg->is_enabled = 0; in rpm_reg_enable()
103 return vreg->is_enabled; in rpm_reg_is_enabled()
111 vreg->is_enabled = 0; in rpm_reg_disable()
112 vreg->enabled_updated = 1; in rpm_reg_disable()
116 vreg->is_enabled = 1; in rpm_reg_disable()
125 return vreg->uV; in rpm_reg_get_voltage()
135 int old_uV = vreg->uV; in rpm_reg_set_voltage()
137 vreg->uV = min_uV; in rpm_reg_set_voltage()
138 vreg->uv_updated = 1; in rpm_reg_set_voltage()
142 vreg->uV = old_uV; in rpm_reg_set_voltage()
150 u32 old_load = vreg->load; in rpm_reg_set_load()
153 vreg->load = load_uA; in rpm_reg_set_load()
154 vreg->load_updated = 1; in rpm_reg_set_load()
157 vreg->load = old_load; in rpm_reg_set_load()
1020 /* S5 - S6 are managed by SPMI */
1310 { "boost-bypass", QCOM_SMD_RPM_BBYB, 1, &pmi8994_bby, "vdd_bst_byp" },
1356 { .compatible = "qcom,rpm-mp5496-regulators", .data = &rpm_mp5496_regulators },
1357 { .compatible = "qcom,rpm-pm2250-regulators", .data = &rpm_pm2250_regulators },
1358 { .compatible = "qcom,rpm-pm6125-regulators", .data = &rpm_pm6125_regulators },
1359 { .compatible = "qcom,rpm-pm660-regulators", .data = &rpm_pm660_regulators },
1360 { .compatible = "qcom,rpm-pm660l-regulators", .data = &rpm_pm660l_regulators },
1361 { .compatible = "qcom,rpm-pm8226-regulators", .data = &rpm_pm8226_regulators },
1362 { .compatible = "qcom,rpm-pm8841-regulators", .data = &rpm_pm8841_regulators },
1363 { .compatible = "qcom,rpm-pm8909-regulators", .data = &rpm_pm8909_regulators },
1364 { .compatible = "qcom,rpm-pm8916-regulators", .data = &rpm_pm8916_regulators },
1365 { .compatible = "qcom,rpm-pm8937-regulators", .data = &rpm_pm8937_regulators },
1366 { .compatible = "qcom,rpm-pm8941-regulators", .data = &rpm_pm8941_regulators },
1367 { .compatible = "qcom,rpm-pm8950-regulators", .data = &rpm_pm8950_regulators },
1368 { .compatible = "qcom,rpm-pm8953-regulators", .data = &rpm_pm8953_regulators },
1369 { .compatible = "qcom,rpm-pm8994-regulators", .data = &rpm_pm8994_regulators },
1370 { .compatible = "qcom,rpm-pm8998-regulators", .data = &rpm_pm8998_regulators },
1371 { .compatible = "qcom,rpm-pma8084-regulators", .data = &rpm_pma8084_regulators },
1372 { .compatible = "qcom,rpm-pmi8994-regulators", .data = &rpm_pmi8994_regulators },
1373 { .compatible = "qcom,rpm-pmi8998-regulators", .data = &rpm_pmi8998_regulators },
1374 { .compatible = "qcom,rpm-pmr735a-regulators", .data = &rpm_pmr735a_regulators },
1375 { .compatible = "qcom,rpm-pms405-regulators", .data = &rpm_pms405_regulators },
1381 * rpm_regulator_init_vreg() - initialize all attributes of a qcom_smd-regulator
1382 * @vreg: Pointer to the individual qcom_smd-regulator resource
1383 * @dev: Pointer to the top level qcom_smd-regulator PMIC device
1384 * @node: Pointer to the individual qcom_smd-regulator resource
1386 * @pmic_rpm_data: Pointer to a null-terminated array of qcom_smd-regulator
1400 for (rpm_data = pmic_rpm_data; rpm_data->name; rpm_data++) in rpm_regulator_init_vreg()
1401 if (of_node_name_eq(node, rpm_data->name)) in rpm_regulator_init_vreg()
1404 if (!rpm_data->name) { in rpm_regulator_init_vreg()
1406 return -EINVAL; in rpm_regulator_init_vreg()
1409 vreg->dev = dev; in rpm_regulator_init_vreg()
1410 vreg->type = rpm_data->type; in rpm_regulator_init_vreg()
1411 vreg->id = rpm_data->id; in rpm_regulator_init_vreg()
1413 memcpy(&vreg->desc, rpm_data->desc, sizeof(vreg->desc)); in rpm_regulator_init_vreg()
1414 vreg->desc.name = rpm_data->name; in rpm_regulator_init_vreg()
1415 vreg->desc.supply_name = rpm_data->supply; in rpm_regulator_init_vreg()
1416 vreg->desc.owner = THIS_MODULE; in rpm_regulator_init_vreg()
1417 vreg->desc.type = REGULATOR_VOLTAGE; in rpm_regulator_init_vreg()
1418 vreg->desc.of_match = rpm_data->name; in rpm_regulator_init_vreg()
1424 rdev = devm_regulator_register(dev, &vreg->desc, &config); in rpm_regulator_init_vreg()
1436 struct device *dev = &pdev->dev; in rpm_reg_probe()
1439 struct qcom_smd_rpm *rpm; in rpm_reg_probe() local
1442 rpm = dev_get_drvdata(pdev->dev.parent); in rpm_reg_probe()
1443 if (!rpm) { in rpm_reg_probe()
1444 dev_err(&pdev->dev, "Unable to retrieve handle to rpm\n"); in rpm_reg_probe()
1445 return -ENODEV; in rpm_reg_probe()
1448 if (smd_vreg_rpm && rpm != smd_vreg_rpm) in rpm_reg_probe()
1449 return dev_err_probe(dev, -EINVAL, "RPM mismatch\n"); in rpm_reg_probe()
1451 smd_vreg_rpm = rpm; in rpm_reg_probe()
1455 return -ENODEV; in rpm_reg_probe()
1457 for_each_available_child_of_node_scoped(dev->of_node, node) { in rpm_reg_probe()
1458 vreg = devm_kzalloc(&pdev->dev, sizeof(*vreg), GFP_KERNEL); in rpm_reg_probe()
1460 return -ENOMEM; in rpm_reg_probe()
1491 MODULE_DESCRIPTION("Qualcomm RPM regulator driver");