ARM: davinci: da850-evm: use GPIO hogs instead of the legacy API
Subsystems (3)
PATCH 1/1 ARM: davinci: da850-evm: use GPIO hogs instead of the legacy API
From: Bartosz Golaszewski <[email protected]>
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.
--- arch/arm/mach-davinci/board-da850-evm.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
arch/arm/mach-davinci/board-da850-evm.c +14 -8
@@ -1064,6 +1064,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;
@@ -1102,14 +1113,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 ;
Signature · 1 line
2.20.1
Quoted 8 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
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.
Signed-off-by Bartosz Golaszewski <[email protected]>
Yours,
Linus Walleij
Sekhar Nori
AppliedQuoted 11 lines · Linus Walleij
Quoted 8 lines · Bartosz Golaszewski
From: Bartosz Golaszewski <[email protected]>
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.
Signed-off-by Bartosz Golaszewski <[email protected]>Reviewed-by Linus Walleij <[email protected]>
Applied to my v5.1/soc branch.
Thanks,
Sekhar
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel