Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 044e9e71 authored by David Collins's avatar David Collins
Browse files

regulator: cpr3-regulator: add support to ignore invalid fuse values



Some simulator targets do not initialize fuse values.  This
causes CPR3 controller devices to fail to probe due to sanity
checks.  Make these checks conditional upon a boolean device tree
property so that CPR3 controllers can be tested on all simulator
targets.

Change-Id: Ib87b7eb46ea4842480dc09e43241e19190344672
Signed-off-by: default avatarDavid Collins <collinsd@codeaurora.org>
parent b7d205ea
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -196,6 +196,13 @@ Platform independent properties:
	Definition: Value required in the masked off "aging_allowed" register
		    bits in order for a CPR aging measurement to be possible.

- qcom,cpr-ignore-invalid-fuses
	Usage:      optional
	Value type: <empty>
	Definition: Boolean flag which indicates that software should ignore
		    invalid fuse values.  This should only be used on simulator
		    targets in which fuses are not initialized.

- qcom,cpr-panic-reg-addr-list
	Usage:      optional
	Value type: <prop-encoded-array>
+8 −0
Original line number Diff line number Diff line
@@ -1115,6 +1115,14 @@ static int cpr3_regulator_init_cprh_corners(struct cpr3_regulator *vreg)
				 * select RO 0 arbitrarily.
				 */
				ro_sel = 0;
			} else if (ctrl->ignore_invalid_fuses) {
				/*
				 * Fuses are not initialized on some simulator
				 * targets.  Select RO 0 arbitrarily.
				 */
				cpr3_debug(vreg, "ignored that corner=%d has invalid RO select value\n",
					 i);
				ro_sel = 0;
			} else {
				cpr3_err(vreg, "corner=%d has invalid RO select value\n",
					 i);
+5 −0
Original line number Diff line number Diff line
@@ -702,6 +702,9 @@ struct cpr3_panic_regs_info {
 * @aging_possible_val:	Optional value that the masked aging_possible_reg
 *			register must have in order for a CPR aging measurement
 *			to be possible.
 * @ignore_invalid_fuses: Flag which indicates that invalid fuse parameter
 *			values should be ignored.  This is used on simulator
 *			targets which do not initialize fuse parameters.
 * @step_quot_fixed:	Fixed step quotient value used for target quotient
 *			adjustment if use_dynamic_step_quot is not set.
 *			This parameter is only relevant for CPR4 controllers
@@ -822,6 +825,8 @@ struct cpr3_controller {
	u32			aging_possible_mask;
	u32			aging_possible_val;

	bool			ignore_invalid_fuses;

	u32			step_quot_fixed;
	u32			initial_temp_band;
	bool			use_dynamic_step_quot;
+3 −0
Original line number Diff line number Diff line
@@ -1165,6 +1165,9 @@ int cpr3_parse_common_ctrl_data(struct cpr3_controller *ctrl)
	if (rc)
		return rc;

	ctrl->ignore_invalid_fuses = of_property_read_bool(ctrl->dev->of_node,
				"qcom,cpr-ignore-invalid-fuses");

	/* Aging reference voltage is optional */
	ctrl->aging_ref_volt = 0;
	of_property_read_u32(ctrl->dev->of_node, "qcom,cpr-aging-ref-voltage",