int __rtl8366_mdio_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data)
{
- u32 phy_id = MDC_REALTEK_PHY_ADDR;
+ u32 phy_id = smi->phy_id;
struct mii_bus *mbus = smi->ext_mbus;
BUG_ON(in_interrupt());
static int __rtl8366_mdio_write_reg(struct rtl8366_smi *smi, u32 addr, u32 data)
{
- u32 phy_id = MDC_REALTEK_PHY_ADDR;
+ u32 phy_id = smi->phy_id;
struct mii_bus *mbus = smi->ext_mbus;
BUG_ON(in_interrupt());
goto try_gpio;
}
+ if (of_property_read_u32(np, "phy-id", &smi->phy_id))
+ smi->phy_id = MDC_REALTEK_PHY_ADDR;
+
return 0;
try_gpio:
smi->gpio_sda = pdata->gpio_sda;
smi->gpio_sck = pdata->gpio_sck;
smi->hw_reset = pdata->hw_reset;
+ smi->phy_id = MDC_REALTEK_PHY_ADDR;
return 0;
}