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

Commit 821ffbef authored by Gustavo Solaira's avatar Gustavo Solaira
Browse files

esoc: Bring mdm9x55 in sync with mdm9x45 functionality



Some options available for mdm9x45 esocs were missing from
the mdm9x55 setup hardware function. Add those to bring them
in sync. The way a power down is performed on mdm9x55 is also
changed to be similar to mdm9x45.

Change-Id: I14b0e77d08cb319581cfd02304eba8351c378306
Signed-off-by: default avatarGustavo Solaira <gustavos@codeaurora.org>
parent 582b961e
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1088,6 +1088,13 @@ static int mdm9x55_setup_hw(struct mdm_ctrl *mdm,
	esoc->parent = mdm->dev;
	esoc->owner = THIS_MODULE;
	esoc->np = pdev->dev.of_node;

	esoc->auto_boot = of_property_read_bool(esoc->np,
						"qcom,mdm-auto-boot");
	esoc->statusline_not_a_powersource = of_property_read_bool(esoc->np,
				"qcom,mdm-statusline-not-a-powersource");
	esoc->userspace_handle_shutdown = of_property_read_bool(esoc->np,
				"qcom,mdm-userspace-handle-shutdown");
	set_esoc_clink_data(esoc, mdm);
	ret = esoc_clink_register(esoc);
	if (ret) {
@@ -1103,6 +1110,8 @@ static int mdm9x55_setup_hw(struct mdm_ctrl *mdm,
	mdm->debug_fail = false;
	mdm->esoc = esoc;
	mdm->init = 0;
	if (esoc->auto_boot)
		gpio_direction_output(MDM_GPIO(mdm, AP2MDM_STATUS), 1);
	return 0;
}

+10 −4
Original line number Diff line number Diff line
@@ -141,13 +141,17 @@ static int mdm4x_power_down(struct mdm_ctrl *mdm)
static int mdm9x55_power_down(struct mdm_ctrl *mdm)
{
	struct device *dev = mdm->dev;
	int soft_reset_direction = mdm->soft_reset_inverted ? 1 : 0;
	int soft_reset_direction_assert = 0,
	    soft_reset_direction_de_assert = 1;

	if (mdm->soft_reset_inverted) {
		soft_reset_direction_assert = 1;
		soft_reset_direction_de_assert = 0;
	}
	/* Assert the soft reset line whether mdm2ap_status went low or not */
	gpio_direction_output(MDM_GPIO(mdm, AP2MDM_SOFT_RESET),
					soft_reset_direction);
			soft_reset_direction_assert);
	dev_dbg(dev, "Doing a hard reset\n");
	gpio_direction_output(MDM_GPIO(mdm, AP2MDM_SOFT_RESET),
						soft_reset_direction);
	/*
	* Currently, there is a debounce timer on the charm PMIC. It is
	* necessary to hold the PMIC RESET low for 406ms
@@ -155,6 +159,8 @@ static int mdm9x55_power_down(struct mdm_ctrl *mdm)
	* reset has occurred before the function exits.
	*/
	msleep(406);
	gpio_direction_output(MDM_GPIO(mdm, AP2MDM_SOFT_RESET),
			soft_reset_direction_de_assert);
	return 0;
}