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

Commit 33094d52 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

pwm: qpnp: Read dtest configuration before checking mode



In certain cases like PWM configuration handoff from the bootloader,
it's not required to configure the PWM channel during probe. So
mode-select will not be specified. Without mode-select, driver will
skip reading dtest related configuration. However this has to be
still read from the device tree and stored for controlling the
PWM configuration further. Hence move reading the dtest related
configuration before reading the mode-select.

Change-Id: Ia3378d98e172b55f47ac6acebbc4e8c525cb963e
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 156aa1e4
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -1885,6 +1885,20 @@ static int qpnp_parse_dt_config(struct spmi_device *spmi,
		}
	}

	rc = of_property_read_u32(of_node, "qcom,lpg-dtest-line",
		&chip->dtest_line);
	if (rc) {
		chip->in_test_mode = 0;
	} else {
		chip->in_test_mode = 1;
		rc = of_property_read_u32(of_node, "qcom,dtest-output",
			&chip->dtest_output);
		if (rc) {
			pr_err("Missing DTEST output configuration\n");
			chip->dtest_output = 0;
		}
	}

	for_each_child_of_node(of_node, node) {
		rc = of_property_read_string(node, "label", &lable);
		if (rc) {
@@ -1920,20 +1934,6 @@ static int qpnp_parse_dt_config(struct spmi_device *spmi,
		goto out;
	}

	rc = of_property_read_u32(of_node, "qcom,lpg-dtest-line",
		&chip->dtest_line);
	if (rc) {
		chip->in_test_mode = 0;
	} else {
		chip->in_test_mode = 1;
		rc = of_property_read_u32(of_node, "qcom,dtest-output",
			&chip->dtest_output);
		if (rc) {
			pr_err("Missing DTEST output configuration\n");
			chip->dtest_output = 0;
		}
	}

	_pwm_change_mode(chip, enable);
	_pwm_enable(chip);