Loading Documentation/devicetree/bindings/regulator/cpr-regulator.txt +8 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,13 @@ Optional properties: is present, and vise versa. - qcom,cpr-fuse-bp-cpr-disable: Bit position of the bit to indicate if CPR should be disabled - qcom,cpr-fuse-bp-scheme: Bit position of the bit to indicate if it's a global/local scheme - qcom,cpr-fuse-target-quot-size: Array of bit size in the CPR fuse for the target quotient of all corners. The elements with index[0..2] are: [0] => bit size of the SVS target quotient [1] => bit size of the NOMINAL target quotient [2] => bit size of the TURBO target quotient If this property is not present, then all target quotient fuse values are assumed to be the default length of 12 bits. - qcom,cpr-enable: Present: CPR enabled by default. Not Present: CPR disable by default. - qcom,cpr-fuse-cond-min-volt-sel: Array of 5 elements to indicate where to read the bits, what value to Loading Loading @@ -351,6 +358,7 @@ Example: qcom,cpr-fuse-bp-cpr-disable = <36>; qcom,cpr-fuse-bp-scheme = <37>; qcom,cpr-fuse-target-quot = <24 12 0>; qcom,cpr-fuse-target-quot-size = <12 12 12>; qcom,cpr-fuse-ro-sel = <54 38 41>; qcom,cpr-fuse-redun-sel = <138 57 1 1 1>; qcom,cpr-fuse-redun-row = <139 1>; Loading drivers/regulator/cpr-regulator.c +18 −1 Original line number Diff line number Diff line Loading @@ -1705,6 +1705,11 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev, u32 ro_sel, val; u64 fuse_bits, fuse_bits_2; u32 quot_adjust[CPR_FUSE_CORNER_MAX]; u32 target_quot_size[CPR_FUSE_CORNER_MAX] = { [CPR_FUSE_CORNER_SVS] = CPR_FUSE_TARGET_QUOT_BITS, [CPR_FUSE_CORNER_NORMAL] = CPR_FUSE_TARGET_QUOT_BITS, [CPR_FUSE_CORNER_TURBO] = CPR_FUSE_TARGET_QUOT_BITS, }; if (of_find_property(of_node, "qcom,cpr-fuse-redun-sel", NULL)) { rc = of_property_read_u32_array(of_node, Loading Loading @@ -1743,6 +1748,18 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev, return rc; } if (of_property_read_bool(of_node, "qcom,cpr-fuse-target-quot-size")) { rc = of_property_read_u32_array(of_node, "qcom,cpr-fuse-target-quot-size", &target_quot_size[CPR_FUSE_CORNER_SVS], CPR_FUSE_CORNER_MAX - CPR_FUSE_CORNER_SVS); if (rc < 0) { pr_err("error while reading qcom,cpr-fuse-target-quot-size: rc=%d\n", rc); return rc; } } rc = of_property_read_u32_array(of_node, ro_sel_str, &bp_ro_sel[CPR_FUSE_CORNER_SVS], Loading Loading @@ -1842,7 +1859,7 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev, ro_sel = (fuse_bits >> bp_ro_sel[i]) & CPR_FUSE_RO_SEL_BITS_MASK; val = (fuse_bits >> bp_target_quot[i]) & CPR_FUSE_TARGET_QUOT_BITS_MASK; & ((1 << target_quot_size[i]) - 1); cpr_vreg->cpr_fuse_target_quot[i] = val; cpr_vreg->cpr_fuse_ro_sel[i] = ro_sel; pr_info("Corner[%d]: ro_sel = %d, target quot = %d\n", Loading Loading
Documentation/devicetree/bindings/regulator/cpr-regulator.txt +8 −0 Original line number Diff line number Diff line Loading @@ -157,6 +157,13 @@ Optional properties: is present, and vise versa. - qcom,cpr-fuse-bp-cpr-disable: Bit position of the bit to indicate if CPR should be disabled - qcom,cpr-fuse-bp-scheme: Bit position of the bit to indicate if it's a global/local scheme - qcom,cpr-fuse-target-quot-size: Array of bit size in the CPR fuse for the target quotient of all corners. The elements with index[0..2] are: [0] => bit size of the SVS target quotient [1] => bit size of the NOMINAL target quotient [2] => bit size of the TURBO target quotient If this property is not present, then all target quotient fuse values are assumed to be the default length of 12 bits. - qcom,cpr-enable: Present: CPR enabled by default. Not Present: CPR disable by default. - qcom,cpr-fuse-cond-min-volt-sel: Array of 5 elements to indicate where to read the bits, what value to Loading Loading @@ -351,6 +358,7 @@ Example: qcom,cpr-fuse-bp-cpr-disable = <36>; qcom,cpr-fuse-bp-scheme = <37>; qcom,cpr-fuse-target-quot = <24 12 0>; qcom,cpr-fuse-target-quot-size = <12 12 12>; qcom,cpr-fuse-ro-sel = <54 38 41>; qcom,cpr-fuse-redun-sel = <138 57 1 1 1>; qcom,cpr-fuse-redun-row = <139 1>; Loading
drivers/regulator/cpr-regulator.c +18 −1 Original line number Diff line number Diff line Loading @@ -1705,6 +1705,11 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev, u32 ro_sel, val; u64 fuse_bits, fuse_bits_2; u32 quot_adjust[CPR_FUSE_CORNER_MAX]; u32 target_quot_size[CPR_FUSE_CORNER_MAX] = { [CPR_FUSE_CORNER_SVS] = CPR_FUSE_TARGET_QUOT_BITS, [CPR_FUSE_CORNER_NORMAL] = CPR_FUSE_TARGET_QUOT_BITS, [CPR_FUSE_CORNER_TURBO] = CPR_FUSE_TARGET_QUOT_BITS, }; if (of_find_property(of_node, "qcom,cpr-fuse-redun-sel", NULL)) { rc = of_property_read_u32_array(of_node, Loading Loading @@ -1743,6 +1748,18 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev, return rc; } if (of_property_read_bool(of_node, "qcom,cpr-fuse-target-quot-size")) { rc = of_property_read_u32_array(of_node, "qcom,cpr-fuse-target-quot-size", &target_quot_size[CPR_FUSE_CORNER_SVS], CPR_FUSE_CORNER_MAX - CPR_FUSE_CORNER_SVS); if (rc < 0) { pr_err("error while reading qcom,cpr-fuse-target-quot-size: rc=%d\n", rc); return rc; } } rc = of_property_read_u32_array(of_node, ro_sel_str, &bp_ro_sel[CPR_FUSE_CORNER_SVS], Loading Loading @@ -1842,7 +1859,7 @@ static int cpr_init_cpr_efuse(struct platform_device *pdev, ro_sel = (fuse_bits >> bp_ro_sel[i]) & CPR_FUSE_RO_SEL_BITS_MASK; val = (fuse_bits >> bp_target_quot[i]) & CPR_FUSE_TARGET_QUOT_BITS_MASK; & ((1 << target_quot_size[i]) - 1); cpr_vreg->cpr_fuse_target_quot[i] = val; cpr_vreg->cpr_fuse_ro_sel[i] = ro_sel; pr_info("Corner[%d]: ro_sel = %d, target quot = %d\n", Loading