Lines Matching full:vreg
42 static int rpm_reg_write_active(struct qcom_rpm_reg *vreg) in rpm_reg_write_active() argument
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()
86 struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev); in rpm_reg_enable() local
89 vreg->is_enabled = 1; in rpm_reg_enable()
90 vreg->enabled_updated = 1; in rpm_reg_enable()
92 ret = rpm_reg_write_active(vreg); in rpm_reg_enable()
94 vreg->is_enabled = 0; in rpm_reg_enable()
101 struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev); in rpm_reg_is_enabled() local
103 return vreg->is_enabled; in rpm_reg_is_enabled()
108 struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev); in rpm_reg_disable() local
111 vreg->is_enabled = 0; in rpm_reg_disable()
112 vreg->enabled_updated = 1; in rpm_reg_disable()
114 ret = rpm_reg_write_active(vreg); in rpm_reg_disable()
116 vreg->is_enabled = 1; in rpm_reg_disable()
123 struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev); in rpm_reg_get_voltage() local
125 return vreg->uV; in rpm_reg_get_voltage()
133 struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev); in rpm_reg_set_voltage() local
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()
140 ret = rpm_reg_write_active(vreg); in rpm_reg_set_voltage()
142 vreg->uV = old_uV; in rpm_reg_set_voltage()
149 struct qcom_rpm_reg *vreg = rdev_get_drvdata(rdev); in rpm_reg_set_load() local
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()
155 ret = rpm_reg_write_active(vreg); in rpm_reg_set_load()
157 vreg->load = old_load; in rpm_reg_set_load()
1382 * @vreg: Pointer to the individual qcom_smd-regulator resource
1391 static int rpm_regulator_init_vreg(struct qcom_rpm_reg *vreg, struct device *dev, in rpm_regulator_init_vreg() argument
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()
1422 config.driver_data = vreg; in rpm_regulator_init_vreg()
1424 rdev = devm_regulator_register(dev, &vreg->desc, &config); in rpm_regulator_init_vreg()
1438 struct qcom_rpm_reg *vreg; in rpm_reg_probe() local
1458 vreg = devm_kzalloc(&pdev->dev, sizeof(*vreg), GFP_KERNEL); in rpm_reg_probe()
1459 if (!vreg) in rpm_reg_probe()
1462 ret = rpm_regulator_init_vreg(vreg, dev, node, vreg_data); in rpm_reg_probe()