aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/mdio-gpio.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2018-12-08 21:33:31 -0800
committerDavid S. Miller <davem@davemloft.net>2018-12-08 21:33:31 -0800
commit120d633f199b264e0ad4c98eedc0564a89171c1d (patch)
treef6472abc7aacc40c5c41f2d3f548f3b6f1a0e974 /drivers/net/phy/mdio-gpio.c
parentip: silence udp zerocopy smatch false positive (diff)
parentnet: phy: mdio-gpio: Add phy_ignore_ta_mask to platform data (diff)
downloadlinux-dev-120d633f199b264e0ad4c98eedc0564a89171c1d.tar.xz
linux-dev-120d633f199b264e0ad4c98eedc0564a89171c1d.zip
Merge branch 'platform-data-controls-for-mdio-gpio'
Andrew Lunn says: ==================== platform data controls for mdio-gpio Soon to be mainlined is an x86 platform with a Marvell switch, and a bit-banging MDIO bus. In order to make this work, the phy_mask of the MDIO bus needs to be set to prevent scanning for PHYs, and the phy_ignore_ta_mask needs to be set because the switch has broken turnaround. Add a platform_data structure with these parameters. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/mdio-gpio.c')
-rw-r--r--drivers/net/phy/mdio-gpio.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index 0fbcedcdf6e2..ea9a0e339778 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -24,6 +24,7 @@
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
+#include <linux/platform_data/mdio-gpio.h>
#include <linux/mdio-bitbang.h>
#include <linux/mdio-gpio.h>
#include <linux/gpio/consumer.h>
@@ -112,6 +113,7 @@ static struct mii_bus *mdio_gpio_bus_init(struct device *dev,
struct mdio_gpio_info *bitbang,
int bus_id)
{
+ struct mdio_gpio_platform_data *pdata = dev_get_platdata(dev);
struct mii_bus *new_bus;
bitbang->ctrl.ops = &mdio_gpio_ops;
@@ -128,6 +130,11 @@ static struct mii_bus *mdio_gpio_bus_init(struct device *dev,
else
strncpy(new_bus->id, "gpio", MII_BUS_ID_SIZE);
+ if (pdata) {
+ new_bus->phy_mask = pdata->phy_mask;
+ new_bus->phy_ignore_ta_mask = pdata->phy_ignore_ta_mask;
+ }
+
dev_set_drvdata(dev, new_bus);
return new_bus;