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

Commit 05f9cb6a authored by Gustavo Solaira's avatar Gustavo Solaira
Browse files

msm: ep_pcie: Apply gpio settings based on the device tree flags



Read the device tree gpio flags for all the pins but apply
them only for the MDM2AP_STATUS in order to support boards
that require an active low signal.

Change-Id: Ia1972b4b9046ff947864b7a31781919a31396ae0
Signed-off-by: default avatarGustavo Solaira <gustavos@codeaurora.org>
parent 994ee63f
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -760,6 +760,7 @@ static int ep_pcie_get_resources(struct ep_pcie_dev_t *dev,
	char prop_name[MAX_PROP_SIZE];
	const __be32 *prop;
	u32 *clkfreq = NULL;
	enum of_gpio_flags gpio_flags;

	EP_PCIE_DBG(dev, "PCIe V%d\n", dev->rev);

@@ -868,10 +869,15 @@ static int ep_pcie_get_resources(struct ep_pcie_dev_t *dev,

	for (i = 0; i < EP_PCIE_MAX_GPIO; i++) {
		gpio_info = &dev->gpio[i];
		ret = of_get_named_gpio((&pdev->dev)->of_node,
					gpio_info->name, 0);
		ret = of_get_named_gpio_flags((&pdev->dev)->of_node,
					      gpio_info->name, 0, &gpio_flags);
		if (ret >= 0) {
			gpio_info->num = ret;
			if (i == EP_PCIE_GPIO_MDM2AP) {
				gpio_info->init =
					gpio_flags & OF_GPIO_ACTIVE_LOW;
				gpio_info->on = !gpio_info->init;
			}
			ret = 0;
			EP_PCIE_DBG(dev, "GPIO num for %s is %d\n",
				gpio_info->name, gpio_info->num);