Loading Documentation/devicetree/bindings/regulator/cpr3-regulator.txt +9 −0 Original line number Diff line number Diff line Loading @@ -241,6 +241,15 @@ Platform independent properties: time in order to allow hardware closed-loop CPR voltage change requests to reach the PMIC regulator. - qcom,cpr-thread-has-always-vote-en Usage: optional; only meaningful for CPR4 controller Value type: <empty> Definition: Boolean value which indicates that the CPR controller should be configured to keep thread vote always enabled. This configuration allows the CPR controller to not consider MID/DN recommendations from other thread when all sensors mapped to a thread collapsed. ================================================= Second Level Nodes - CPR Threads for a Controller ================================================= Loading arch/arm64/boot/dts/qcom/sdm632-regulator.dtsi +33 −14 Original line number Diff line number Diff line Loading @@ -114,6 +114,8 @@ qcom,cpr-count-repeat = <14>; qcom,cpr-down-error-step-limit = <1>; qcom,cpr-up-error-step-limit = <1>; qcom,cpr-reset-step-quot-loop-en; qcom,cpr-thread-has-always-vote-en; qcom,apm-ctrl = <&apc_apm>; qcom,apm-threshold-voltage = <875000>; Loading @@ -131,10 +133,13 @@ "APCS_ALIAS0_APM_CTLER_STATUS", "APCS0_CPR_CORE_ADJ_MODE_REG"; qcom,cpr-enable; qcom,cpr-hw-closed-loop; thread@0 { qcom,cpr-thread-id = <0>; qcom,cpr-consecutive-up = <0>; qcom,cpr-consecutive-down = <2>; qcom,cpr-consecutive-down = <0>; qcom,cpr-up-threshold = <2>; qcom,cpr-down-threshold = <1>; Loading @@ -156,6 +161,10 @@ <500000 500000 500000 500000 500000 500000 500000>; qcom,cpr-floor-to-ceiling-max-range = <50000 50000 50000 50000 50000 50000 50000>; qcom,mem-acc-voltage = <1 1 2 2 2 2 3>; qcom,corner-frequencies = Loading @@ -176,13 +185,19 @@ qcom,allow-voltage-interpolation; qcom,allow-quotient-interpolation; qcom,cpr-scaled-open-loop-voltage-as-ceiling; qcom,cpr-open-loop-voltage-fuse-adjustment = < 0 0 0 10000>; qcom,cpr-closed-loop-voltage-fuse-adjustment = <(-10000) 0 0 10000>; }; }; thread@1 { qcom,cpr-thread-id = <1>; qcom,cpr-consecutive-up = <0>; qcom,cpr-consecutive-down = <2>; qcom,cpr-consecutive-down = <0>; qcom,cpr-up-threshold = <2>; qcom,cpr-down-threshold = <1>; Loading @@ -204,6 +219,10 @@ <500000 500000 500000 500000 500000 500000 500000>; qcom,cpr-floor-to-ceiling-max-range = <50000 50000 50000 50000 50000 50000 50000>; qcom,mem-acc-voltage = <1 1 2 2 2 2 3>; qcom,corner-frequencies = Loading @@ -227,9 +246,9 @@ qcom,cpr-open-loop-voltage-fuse-adjustment = /* Speed bin 0; CPR rev 0..7 */ < 30000 0 0 0>, < 30000 0 0 0>, < 0 0 0 0>, < 30000 0 10000 20000>, < 30000 0 10000 20000>, < 0 0 10000 20000>, < 0 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, Loading @@ -247,9 +266,9 @@ < 0 0 0 0>, /* Speed bin 2; CPR rev 0..7 */ < 30000 0 0 0>, < 30000 0 0 0>, < 0 0 0 0>, < 30000 0 10000 20000>, < 30000 0 10000 20000>, < 0 0 10000 20000>, < 0 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, Loading Loading @@ -287,9 +306,9 @@ < 0 0 0 0>, /* Speed bin 6; CPR rev 0..7 */ < 30000 0 0 0>, < 30000 0 0 0>, < 0 0 0 0>, < 30000 0 10000 20000>, < 30000 0 10000 20000>, < 0 0 10000 20000>, < 0 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, Loading @@ -310,7 +329,7 @@ /* Speed bin 0; CPR rev 0..7 */ < 30000 0 0 0>, < 30000 0 0 0>, < 0 0 0 0>, <(-10000) 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, Loading @@ -330,7 +349,7 @@ /* Speed bin 2; CPR rev 0..7 */ < 30000 0 0 0>, < 30000 0 0 0>, < 0 0 0 0>, <(-10000) 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, Loading Loading @@ -370,7 +389,7 @@ /* Speed bin 6; CPR rev 0..7 */ < 30000 0 0 0>, < 30000 0 0 0>, < 0 0 0 0>, <(-10000) 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, Loading drivers/regulator/cpr3-regulator.c +7 −1 Original line number Diff line number Diff line /* * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -178,6 +178,7 @@ #define CPR4_REG_MISC 0x700 #define CPR4_MISC_RESET_STEP_QUOT_LOOP_EN BIT(2) #define CPR4_MISC_THREAD_HAS_ALWAYS_VOTE_EN BIT(3) #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 @@ -733,6 +734,11 @@ static int cpr3_regulator_init_cpr4(struct cpr3_controller *ctrl) CPR4_MISC_RESET_STEP_QUOT_LOOP_EN, CPR4_MISC_RESET_STEP_QUOT_LOOP_EN); if (ctrl->thread_has_always_vote_en) cpr3_masked_write(ctrl, CPR4_REG_MISC, CPR4_MISC_THREAD_HAS_ALWAYS_VOTE_EN, CPR4_MISC_THREAD_HAS_ALWAYS_VOTE_EN); if (ctrl->supports_hw_closed_loop) { if (ctrl->saw_use_unit_mV) pmic_step_size = ctrl->step_volt / 1000; Loading drivers/regulator/cpr3-regulator.h +8 −1 Original line number Diff line number Diff line /* * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -766,6 +766,12 @@ struct cpr3_panic_regs_info { * the CPR controller to first use the default step_quot * and then later switch to the run-time calibrated * step_quot. * @thread_has_always_vote_en: Boolean value which indicates that this CPR * controller should be configured to keep thread vote * always enabled. This configuration allows the CPR * controller to not consider MID/DN recommendations from * other thread when all sensors mapped to a thread * collapsed. * * This structure contains both configuration and runtime state data. The * elements cpr_allowed_sw, use_hw_closed_loop, aggr_corner, cpr_enabled, Loading Loading @@ -879,6 +885,7 @@ struct cpr3_controller { struct notifier_block panic_notifier; bool support_ldo300_vreg; bool reset_step_quot_loop_en; bool thread_has_always_vote_en; }; /* Used for rounding voltages to the closest physically available set point. */ Loading drivers/regulator/cpr3-util.c +11 −1 Original line number Diff line number Diff line /* * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -1240,6 +1240,16 @@ int cpr3_parse_common_ctrl_data(struct cpr3_controller *ctrl) = of_property_read_bool(ctrl->dev->of_node, "qcom,cpr-reset-step-quot-loop-en"); /* * Configure CPR controller to not consider MID/DN recommendations * from other thread when all sensors mapped to a thread collapsed * in a multi-thread configuration. */ if (ctrl->thread_count > 1) ctrl->thread_has_always_vote_en = of_property_read_bool(ctrl->dev->of_node, "qcom,cpr-thread-has-always-vote-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 @@ -241,6 +241,15 @@ Platform independent properties: time in order to allow hardware closed-loop CPR voltage change requests to reach the PMIC regulator. - qcom,cpr-thread-has-always-vote-en Usage: optional; only meaningful for CPR4 controller Value type: <empty> Definition: Boolean value which indicates that the CPR controller should be configured to keep thread vote always enabled. This configuration allows the CPR controller to not consider MID/DN recommendations from other thread when all sensors mapped to a thread collapsed. ================================================= Second Level Nodes - CPR Threads for a Controller ================================================= Loading
arch/arm64/boot/dts/qcom/sdm632-regulator.dtsi +33 −14 Original line number Diff line number Diff line Loading @@ -114,6 +114,8 @@ qcom,cpr-count-repeat = <14>; qcom,cpr-down-error-step-limit = <1>; qcom,cpr-up-error-step-limit = <1>; qcom,cpr-reset-step-quot-loop-en; qcom,cpr-thread-has-always-vote-en; qcom,apm-ctrl = <&apc_apm>; qcom,apm-threshold-voltage = <875000>; Loading @@ -131,10 +133,13 @@ "APCS_ALIAS0_APM_CTLER_STATUS", "APCS0_CPR_CORE_ADJ_MODE_REG"; qcom,cpr-enable; qcom,cpr-hw-closed-loop; thread@0 { qcom,cpr-thread-id = <0>; qcom,cpr-consecutive-up = <0>; qcom,cpr-consecutive-down = <2>; qcom,cpr-consecutive-down = <0>; qcom,cpr-up-threshold = <2>; qcom,cpr-down-threshold = <1>; Loading @@ -156,6 +161,10 @@ <500000 500000 500000 500000 500000 500000 500000>; qcom,cpr-floor-to-ceiling-max-range = <50000 50000 50000 50000 50000 50000 50000>; qcom,mem-acc-voltage = <1 1 2 2 2 2 3>; qcom,corner-frequencies = Loading @@ -176,13 +185,19 @@ qcom,allow-voltage-interpolation; qcom,allow-quotient-interpolation; qcom,cpr-scaled-open-loop-voltage-as-ceiling; qcom,cpr-open-loop-voltage-fuse-adjustment = < 0 0 0 10000>; qcom,cpr-closed-loop-voltage-fuse-adjustment = <(-10000) 0 0 10000>; }; }; thread@1 { qcom,cpr-thread-id = <1>; qcom,cpr-consecutive-up = <0>; qcom,cpr-consecutive-down = <2>; qcom,cpr-consecutive-down = <0>; qcom,cpr-up-threshold = <2>; qcom,cpr-down-threshold = <1>; Loading @@ -204,6 +219,10 @@ <500000 500000 500000 500000 500000 500000 500000>; qcom,cpr-floor-to-ceiling-max-range = <50000 50000 50000 50000 50000 50000 50000>; qcom,mem-acc-voltage = <1 1 2 2 2 2 3>; qcom,corner-frequencies = Loading @@ -227,9 +246,9 @@ qcom,cpr-open-loop-voltage-fuse-adjustment = /* Speed bin 0; CPR rev 0..7 */ < 30000 0 0 0>, < 30000 0 0 0>, < 0 0 0 0>, < 30000 0 10000 20000>, < 30000 0 10000 20000>, < 0 0 10000 20000>, < 0 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, Loading @@ -247,9 +266,9 @@ < 0 0 0 0>, /* Speed bin 2; CPR rev 0..7 */ < 30000 0 0 0>, < 30000 0 0 0>, < 0 0 0 0>, < 30000 0 10000 20000>, < 30000 0 10000 20000>, < 0 0 10000 20000>, < 0 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, Loading Loading @@ -287,9 +306,9 @@ < 0 0 0 0>, /* Speed bin 6; CPR rev 0..7 */ < 30000 0 0 0>, < 30000 0 0 0>, < 0 0 0 0>, < 30000 0 10000 20000>, < 30000 0 10000 20000>, < 0 0 10000 20000>, < 0 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, Loading @@ -310,7 +329,7 @@ /* Speed bin 0; CPR rev 0..7 */ < 30000 0 0 0>, < 30000 0 0 0>, < 0 0 0 0>, <(-10000) 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, Loading @@ -330,7 +349,7 @@ /* Speed bin 2; CPR rev 0..7 */ < 30000 0 0 0>, < 30000 0 0 0>, < 0 0 0 0>, <(-10000) 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, Loading Loading @@ -370,7 +389,7 @@ /* Speed bin 6; CPR rev 0..7 */ < 30000 0 0 0>, < 30000 0 0 0>, < 0 0 0 0>, <(-10000) 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, < 0 0 0 0>, Loading
drivers/regulator/cpr3-regulator.c +7 −1 Original line number Diff line number Diff line /* * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -178,6 +178,7 @@ #define CPR4_REG_MISC 0x700 #define CPR4_MISC_RESET_STEP_QUOT_LOOP_EN BIT(2) #define CPR4_MISC_THREAD_HAS_ALWAYS_VOTE_EN BIT(3) #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 @@ -733,6 +734,11 @@ static int cpr3_regulator_init_cpr4(struct cpr3_controller *ctrl) CPR4_MISC_RESET_STEP_QUOT_LOOP_EN, CPR4_MISC_RESET_STEP_QUOT_LOOP_EN); if (ctrl->thread_has_always_vote_en) cpr3_masked_write(ctrl, CPR4_REG_MISC, CPR4_MISC_THREAD_HAS_ALWAYS_VOTE_EN, CPR4_MISC_THREAD_HAS_ALWAYS_VOTE_EN); if (ctrl->supports_hw_closed_loop) { if (ctrl->saw_use_unit_mV) pmic_step_size = ctrl->step_volt / 1000; Loading
drivers/regulator/cpr3-regulator.h +8 −1 Original line number Diff line number Diff line /* * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -766,6 +766,12 @@ struct cpr3_panic_regs_info { * the CPR controller to first use the default step_quot * and then later switch to the run-time calibrated * step_quot. * @thread_has_always_vote_en: Boolean value which indicates that this CPR * controller should be configured to keep thread vote * always enabled. This configuration allows the CPR * controller to not consider MID/DN recommendations from * other thread when all sensors mapped to a thread * collapsed. * * This structure contains both configuration and runtime state data. The * elements cpr_allowed_sw, use_hw_closed_loop, aggr_corner, cpr_enabled, Loading Loading @@ -879,6 +885,7 @@ struct cpr3_controller { struct notifier_block panic_notifier; bool support_ldo300_vreg; bool reset_step_quot_loop_en; bool thread_has_always_vote_en; }; /* Used for rounding voltages to the closest physically available set point. */ Loading
drivers/regulator/cpr3-util.c +11 −1 Original line number Diff line number Diff line /* * Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -1240,6 +1240,16 @@ int cpr3_parse_common_ctrl_data(struct cpr3_controller *ctrl) = of_property_read_bool(ctrl->dev->of_node, "qcom,cpr-reset-step-quot-loop-en"); /* * Configure CPR controller to not consider MID/DN recommendations * from other thread when all sensors mapped to a thread collapsed * in a multi-thread configuration. */ if (ctrl->thread_count > 1) ctrl->thread_has_always_vote_en = of_property_read_bool(ctrl->dev->of_node, "qcom,cpr-thread-has-always-vote-en"); /* * Regulator device handles are not necessary for CPRh controllers * since communication with the regulators is completely managed Loading