Loading Documentation/devicetree/bindings/regulator/cpr3-regulator.txt +9 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,15 @@ Platform independent properties: as the corresponding addresses are specified in the qcom,cpr-panic-reg-addr-list property. - qcom,cpr-reset-step-quot-loop-en Usage: optional; only meaningful for CPR4 and CPRh controllers Value type: <empty> Definition: Boolean value which indicates that the CPR controller should be configured to reset step_quot on each loop_en = 0 transition. This configuration allows the CPR controller to first use the default step_quot and then later switch to the run-time calibrated step_quot. - qcom,saw-avs-ctrl Usage: required if "saw" registers are specified by reg and reg-names properties Loading drivers/regulator/cpr3-regulator.c +11 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,7 @@ #define CPR4_CPR_TIMER_CLAMP_THREAD_AGGREGATION_EN BIT(27) #define CPR4_REG_MISC 0x700 #define CPR4_MISC_RESET_STEP_QUOT_LOOP_EN BIT(2) #define CPR4_MISC_MARGIN_TABLE_ROW_SELECT_MASK GENMASK(23, 20) #define CPR4_MISC_MARGIN_TABLE_ROW_SELECT_SHIFT 20 #define CPR4_MISC_TEMP_SENSOR_ID_START_MASK GENMASK(27, 24) Loading Loading @@ -723,6 +724,11 @@ static int cpr3_regulator_init_cpr4(struct cpr3_controller *ctrl) int thread_id = 0; u64 temp; if (ctrl->reset_step_quot_loop_en) cpr3_masked_write(ctrl, CPR4_REG_MISC, CPR4_MISC_RESET_STEP_QUOT_LOOP_EN, CPR4_MISC_RESET_STEP_QUOT_LOOP_EN); if (ctrl->supports_hw_closed_loop) { if (ctrl->saw_use_unit_mV) pmic_step_size = ctrl->step_volt / 1000; Loading Loading @@ -1355,6 +1361,11 @@ static int cpr3_regulator_init_cprh(struct cpr3_controller *ctrl) } } if (ctrl->reset_step_quot_loop_en) cpr3_masked_write(ctrl, CPR4_REG_MISC, CPR4_MISC_RESET_STEP_QUOT_LOOP_EN, CPR4_MISC_RESET_STEP_QUOT_LOOP_EN); if (ctrl->saw_use_unit_mV) pmic_step_size = ctrl->step_volt / 1000; cpr3_masked_write(ctrl, CPR4_REG_MARGIN_ADJ_CTL, Loading drivers/regulator/cpr3-regulator.h +7 −0 Original line number Diff line number Diff line Loading @@ -756,6 +756,12 @@ struct cpr3_panic_regs_info { * @panic_notifier: Notifier block registered to global panic notifier list. * @support_ldo300_vreg: Boolean value which indicates that this CPR controller * manages an underlying LDO regulator of type LDO300. * @reset_step_quot_loop_en: Boolean value which indicates that this CPR * controller should be configured to reset step_quot on * each loop_en = 0 transition. This configuration allows * the CPR controller to first use the default step_quot * and then later switch to the run-time calibrated * step_quot. * * This structure contains both configuration and runtime state data. The * elements cpr_allowed_sw, use_hw_closed_loop, aggr_corner, cpr_enabled, Loading Loading @@ -866,6 +872,7 @@ struct cpr3_controller { struct cpr3_panic_regs_info *panic_regs_info; struct notifier_block panic_notifier; bool support_ldo300_vreg; bool reset_step_quot_loop_en; }; /* Used for rounding voltages to the closest physically available set point. */ Loading drivers/regulator/cpr3-util.c +8 −0 Original line number Diff line number Diff line Loading @@ -1223,6 +1223,14 @@ int cpr3_parse_common_ctrl_data(struct cpr3_controller *ctrl) return -ENODEV; } /* * Reset step_quot to default on each loop_en = 0 transition is * optional. */ ctrl->reset_step_quot_loop_en = of_property_read_bool(ctrl->dev->of_node, "qcom,cpr-reset-step-quot-loop-en"); /* * Regulator device handles are not necessary for CPRh controllers * since communication with the regulators is completely managed Loading Loading
Documentation/devicetree/bindings/regulator/cpr3-regulator.txt +9 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,15 @@ Platform independent properties: as the corresponding addresses are specified in the qcom,cpr-panic-reg-addr-list property. - qcom,cpr-reset-step-quot-loop-en Usage: optional; only meaningful for CPR4 and CPRh controllers Value type: <empty> Definition: Boolean value which indicates that the CPR controller should be configured to reset step_quot on each loop_en = 0 transition. This configuration allows the CPR controller to first use the default step_quot and then later switch to the run-time calibrated step_quot. - qcom,saw-avs-ctrl Usage: required if "saw" registers are specified by reg and reg-names properties Loading
drivers/regulator/cpr3-regulator.c +11 −0 Original line number Diff line number Diff line Loading @@ -177,6 +177,7 @@ #define CPR4_CPR_TIMER_CLAMP_THREAD_AGGREGATION_EN BIT(27) #define CPR4_REG_MISC 0x700 #define CPR4_MISC_RESET_STEP_QUOT_LOOP_EN BIT(2) #define CPR4_MISC_MARGIN_TABLE_ROW_SELECT_MASK GENMASK(23, 20) #define CPR4_MISC_MARGIN_TABLE_ROW_SELECT_SHIFT 20 #define CPR4_MISC_TEMP_SENSOR_ID_START_MASK GENMASK(27, 24) Loading Loading @@ -723,6 +724,11 @@ static int cpr3_regulator_init_cpr4(struct cpr3_controller *ctrl) int thread_id = 0; u64 temp; if (ctrl->reset_step_quot_loop_en) cpr3_masked_write(ctrl, CPR4_REG_MISC, CPR4_MISC_RESET_STEP_QUOT_LOOP_EN, CPR4_MISC_RESET_STEP_QUOT_LOOP_EN); if (ctrl->supports_hw_closed_loop) { if (ctrl->saw_use_unit_mV) pmic_step_size = ctrl->step_volt / 1000; Loading Loading @@ -1355,6 +1361,11 @@ static int cpr3_regulator_init_cprh(struct cpr3_controller *ctrl) } } if (ctrl->reset_step_quot_loop_en) cpr3_masked_write(ctrl, CPR4_REG_MISC, CPR4_MISC_RESET_STEP_QUOT_LOOP_EN, CPR4_MISC_RESET_STEP_QUOT_LOOP_EN); if (ctrl->saw_use_unit_mV) pmic_step_size = ctrl->step_volt / 1000; cpr3_masked_write(ctrl, CPR4_REG_MARGIN_ADJ_CTL, Loading
drivers/regulator/cpr3-regulator.h +7 −0 Original line number Diff line number Diff line Loading @@ -756,6 +756,12 @@ struct cpr3_panic_regs_info { * @panic_notifier: Notifier block registered to global panic notifier list. * @support_ldo300_vreg: Boolean value which indicates that this CPR controller * manages an underlying LDO regulator of type LDO300. * @reset_step_quot_loop_en: Boolean value which indicates that this CPR * controller should be configured to reset step_quot on * each loop_en = 0 transition. This configuration allows * the CPR controller to first use the default step_quot * and then later switch to the run-time calibrated * step_quot. * * This structure contains both configuration and runtime state data. The * elements cpr_allowed_sw, use_hw_closed_loop, aggr_corner, cpr_enabled, Loading Loading @@ -866,6 +872,7 @@ struct cpr3_controller { struct cpr3_panic_regs_info *panic_regs_info; struct notifier_block panic_notifier; bool support_ldo300_vreg; bool reset_step_quot_loop_en; }; /* Used for rounding voltages to the closest physically available set point. */ Loading
drivers/regulator/cpr3-util.c +8 −0 Original line number Diff line number Diff line Loading @@ -1223,6 +1223,14 @@ int cpr3_parse_common_ctrl_data(struct cpr3_controller *ctrl) return -ENODEV; } /* * Reset step_quot to default on each loop_en = 0 transition is * optional. */ ctrl->reset_step_quot_loop_en = of_property_read_bool(ctrl->dev->of_node, "qcom,cpr-reset-step-quot-loop-en"); /* * Regulator device handles are not necessary for CPRh controllers * since communication with the regulators is completely managed Loading