Commit ca107e35 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Sekhar Nori

ARM: davinci: da850-evm: use GPIO hogs instead of the legacy API

In order to drop the hard-coded GPIO base values from the davinci GPIO
driver's platform data, we first need to get rid of all calls to the
legacy GPIO functions. Convert the mdio configuration to hogging the
relevant GPIO line in the da850-evm board file.
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: default avatarSekhar Nori <nsekhar@ti.com>
parent e430685f
...@@ -1038,6 +1038,17 @@ static const short da850_evm_rmii_pins[] = { ...@@ -1038,6 +1038,17 @@ static const short da850_evm_rmii_pins[] = {
-1 -1
}; };
static struct gpiod_hog da850_evm_emac_gpio_hogs[] = {
{
.chip_label = "davinci_gpio",
.chip_hwnum = DA850_MII_MDIO_CLKEN_PIN,
.line_name = "mdio_clk_en",
.lflags = 0,
/* dflags set in da850_evm_config_emac() */
},
{ }
};
static int __init da850_evm_config_emac(void) static int __init da850_evm_config_emac(void)
{ {
void __iomem *cfg_chip3_base; void __iomem *cfg_chip3_base;
...@@ -1076,14 +1087,9 @@ static int __init da850_evm_config_emac(void) ...@@ -1076,14 +1087,9 @@ static int __init da850_evm_config_emac(void)
if (ret) if (ret)
pr_warn("%s:GPIO(2,6) mux setup failed\n", __func__); pr_warn("%s:GPIO(2,6) mux setup failed\n", __func__);
ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en"); da850_evm_emac_gpio_hogs[0].dflags = rmii_en ? GPIOD_OUT_HIGH
if (ret) { : GPIOD_OUT_LOW;
pr_warn("Cannot open GPIO %d\n", DA850_MII_MDIO_CLKEN_PIN); gpiod_add_hogs(da850_evm_emac_gpio_hogs);
return ret;
}
/* Enable/Disable MII MDIO clock */
gpio_direction_output(DA850_MII_MDIO_CLKEN_PIN, rmii_en);
soc_info->emac_pdata->phy_id = DA850_EVM_PHY_ID; soc_info->emac_pdata->phy_id = DA850_EVM_PHY_ID;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment