Commit 120d633f authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 97ef7b4c dc9d38ce
......@@ -5610,6 +5610,7 @@ F: include/linux/of_net.h
F: include/linux/phy.h
F: include/linux/phy_fixed.h
F: include/linux/platform_data/mdio-bcm-unimac.h
F: include/linux/platform_data/mdio-gpio.h
F: include/trace/events/mdio.h
F: include/uapi/linux/mdio.h
F: include/uapi/linux/mii.h
......
......@@ -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;
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* MDIO-GPIO bus platform data structure
*/
#ifndef __LINUX_MDIO_GPIO_PDATA_H
#define __LINUX_MDIO_GPIO_PDATA_H
struct mdio_gpio_platform_data {
u32 phy_mask;
u32 phy_ignore_ta_mask;
};
#endif /* __LINUX_MDIO_GPIO_PDATA_H */
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