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

This commit is contained in:
qctecmdr 2021-03-09 16:39:19 -08:00 • committed by Gerrit - the friendly Code Review server
commit 39d25940c8
2 changed files with 10 additions and 3 deletions

View file

@ -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));
}

View file

@ -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);