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

Commit 39d25940 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "net: stmmac: Fix gpio reset & other issue"

parents 95755ee9 edd74d46
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -264,7 +264,11 @@ int stmmac_mdio_reset(struct mii_bus *bus)
	struct net_device *ndev = bus->priv;
	struct stmmac_priv *priv = netdev_priv(ndev);
	unsigned int mii_address = priv->hw->mii.addr;
	bool active_high = true;

#ifdef CONFIG_DWMAC_QCOM_ETHQOS
	active_high = false;
#endif
#ifdef CONFIG_OF
	if (priv->device->of_node) {
		struct gpio_desc *reset_gpio;
@@ -283,11 +287,11 @@ int stmmac_mdio_reset(struct mii_bus *bus)
		if (delays[0])
			msleep(DIV_ROUND_UP(delays[0], 1000));

		gpiod_set_value_cansleep(reset_gpio, 1);
		gpiod_set_value_cansleep(reset_gpio, active_high ? 1 : 0);
		if (delays[1])
			msleep(DIV_ROUND_UP(delays[1], 1000));

		gpiod_set_value_cansleep(reset_gpio, 0);
		gpiod_set_value_cansleep(reset_gpio, active_high ? 0 : 1);
		if (delays[2])
			msleep(DIV_ROUND_UP(delays[2], 1000));
	}
+4 −1
Original line number Diff line number Diff line
@@ -212,12 +212,13 @@ static int stmmac_mtl_setup(struct platform_device *pdev,

		queue++;
	}
#ifndef CONFIG_DWMAC_QCOM_ETHQOS
	if (queue != plat->rx_queues_to_use) {
		ret = -EINVAL;
		dev_err(&pdev->dev, "Not all RX queues were configured\n");
		goto out;
	}

#endif
	/* Processing TX queues common config */
	if (of_property_read_u32(tx_node, "snps,tx-queues-to-use",
				 &plat->tx_queues_to_use))
@@ -278,11 +279,13 @@ static int stmmac_mtl_setup(struct platform_device *pdev,

		queue++;
	}
#ifndef CONFIG_DWMAC_QCOM_ETHQOS
	if (queue != plat->tx_queues_to_use) {
		ret = -EINVAL;
		dev_err(&pdev->dev, "Not all TX queues were configured\n");
		goto out;
	}
#endif

out:
	of_node_put(rx_node);