diff options
author | Andrew Lunn <andrew@lunn.ch> | 2018-04-19 01:02:58 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-04-19 15:59:11 -0400 |
commit | fb78a95e22123da57cb79b98bdc62eb33965ca8a (patch) | |
tree | 19e4f0c9e0d647c5f19df7809114da463f552c62 /drivers/net | |
parent | 4029ea3a8625bc699210623a106e887c2761fead (diff) | |
download | linux-fb78a95e22123da57cb79b98bdc62eb33965ca8a.tar.bz2 |
net: phy: mdio-gpio: Add #defines for the GPIO index's
The GPIOs are described in device tree using a list, without names.
Add defines to indicate what each index in the list means. These
defines should also be used by platform devices passing GPIOs via a
GPIO lookup table.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/phy/mdio-gpio.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c index 74b982835ac1..281c905ef9fd 100644 --- a/drivers/net/phy/mdio-gpio.c +++ b/drivers/net/phy/mdio-gpio.c @@ -24,6 +24,8 @@ #include <linux/slab.h> #include <linux/interrupt.h> #include <linux/platform_device.h> +#include <linux/mdio-bitbang.h> +#include <linux/mdio-gpio.h> #include <linux/gpio.h> #include <linux/platform_data/mdio-gpio.h> @@ -38,15 +40,17 @@ struct mdio_gpio_info { static int mdio_gpio_get_data(struct device *dev, struct mdio_gpio_info *bitbang) { - bitbang->mdc = devm_gpiod_get_index(dev, NULL, 0, GPIOD_OUT_LOW); + bitbang->mdc = devm_gpiod_get_index(dev, NULL, MDIO_GPIO_MDC, + GPIOD_OUT_LOW); if (IS_ERR(bitbang->mdc)) return PTR_ERR(bitbang->mdc); - bitbang->mdio = devm_gpiod_get_index(dev, NULL, 1, GPIOD_IN); + bitbang->mdio = devm_gpiod_get_index(dev, NULL, MDIO_GPIO_MDIO, + GPIOD_IN); if (IS_ERR(bitbang->mdio)) return PTR_ERR(bitbang->mdio); - bitbang->mdo = devm_gpiod_get_index_optional(dev, NULL, 2, + bitbang->mdo = devm_gpiod_get_index_optional(dev, NULL, MDIO_GPIO_MDO, GPIOD_OUT_LOW); return PTR_ERR_OR_ZERO(bitbang->mdo); } |