]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ARM: davinci: da850-evm: use GPIO hogs instead of the legacy API
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 5 Feb 2019 09:49:37 +0000 (10:49 +0100)
committerSekhar Nori <nsekhar@ti.com>
Fri, 8 Feb 2019 13:35:46 +0000 (19:05 +0530)
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: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arch/arm/mach-davinci/board-da850-evm.c

index 128dd7d8dff60a069b5251b70cd63779f0a63ac1..8b1afcf13263d97c8302842562c5ef4e0d139ce8 100644 (file)
@@ -1038,6 +1038,17 @@ static const short da850_evm_rmii_pins[] = {
        -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)
 {
        void __iomem *cfg_chip3_base;
@@ -1076,14 +1087,9 @@ static int __init da850_evm_config_emac(void)
        if (ret)
                pr_warn("%s:GPIO(2,6) mux setup failed\n", __func__);
 
-       ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en");
-       if (ret) {
-               pr_warn("Cannot open GPIO %d\n", DA850_MII_MDIO_CLKEN_PIN);
-               return ret;
-       }
-
-       /* Enable/Disable MII MDIO clock */
-       gpio_direction_output(DA850_MII_MDIO_CLKEN_PIN, rmii_en);
+       da850_evm_emac_gpio_hogs[0].dflags = rmii_en ? GPIOD_OUT_HIGH
+                                                    : GPIOD_OUT_LOW;
+       gpiod_add_hogs(da850_evm_emac_gpio_hogs);
 
        soc_info->emac_pdata->phy_id = DA850_EVM_PHY_ID;