mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
net: stmmac: thead: convert to use phy_interface
dwmac-thead supports either MII or RGMII interface modes only. None of the DTS files set "mac-mode", so mac_interface will be identical to phy_interface. Convert dwmac-thead to use phy_interface when determining the interface mode rather than mac_interface. Also convert the error prints to use phy_modes() so that we get a meaningful string rather than a number for the interface mode. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/E1uytpq-00000006H2q-0ajY@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
0fe080fa88
commit
3a94ecdf1a
@@ -56,7 +56,7 @@ static int thead_dwmac_set_phy_if(struct plat_stmmacenet_data *plat)
|
||||
struct thead_dwmac *dwmac = plat->bsp_priv;
|
||||
u32 phyif;
|
||||
|
||||
switch (plat->mac_interface) {
|
||||
switch (plat->phy_interface) {
|
||||
case PHY_INTERFACE_MODE_MII:
|
||||
phyif = PHY_INTF_MII_GMII;
|
||||
break;
|
||||
@@ -67,8 +67,8 @@ static int thead_dwmac_set_phy_if(struct plat_stmmacenet_data *plat)
|
||||
phyif = PHY_INTF_RGMII;
|
||||
break;
|
||||
default:
|
||||
dev_err(dwmac->dev, "unsupported phy interface %d\n",
|
||||
plat->mac_interface);
|
||||
dev_err(dwmac->dev, "unsupported phy interface %s\n",
|
||||
phy_modes(plat->phy_interface));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ static int thead_dwmac_set_txclk_dir(struct plat_stmmacenet_data *plat)
|
||||
struct thead_dwmac *dwmac = plat->bsp_priv;
|
||||
u32 txclk_dir;
|
||||
|
||||
switch (plat->mac_interface) {
|
||||
switch (plat->phy_interface) {
|
||||
case PHY_INTERFACE_MODE_MII:
|
||||
txclk_dir = TXCLK_DIR_INPUT;
|
||||
break;
|
||||
@@ -92,8 +92,8 @@ static int thead_dwmac_set_txclk_dir(struct plat_stmmacenet_data *plat)
|
||||
txclk_dir = TXCLK_DIR_OUTPUT;
|
||||
break;
|
||||
default:
|
||||
dev_err(dwmac->dev, "unsupported phy interface %d\n",
|
||||
plat->mac_interface);
|
||||
dev_err(dwmac->dev, "unsupported phy interface %s\n",
|
||||
phy_modes(plat->phy_interface));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ static int thead_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
|
||||
|
||||
plat = dwmac->plat;
|
||||
|
||||
switch (plat->mac_interface) {
|
||||
switch (plat->phy_interface) {
|
||||
/* For MII, rxc/txc is provided by phy */
|
||||
case PHY_INTERFACE_MODE_MII:
|
||||
return 0;
|
||||
@@ -143,8 +143,8 @@ static int thead_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
|
||||
return 0;
|
||||
|
||||
default:
|
||||
dev_err(dwmac->dev, "unsupported phy interface %d\n",
|
||||
plat->mac_interface);
|
||||
dev_err(dwmac->dev, "unsupported phy interface %s\n",
|
||||
phy_modes(plat->phy_interface));
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
@@ -154,7 +154,7 @@ static int thead_dwmac_enable_clk(struct plat_stmmacenet_data *plat)
|
||||
struct thead_dwmac *dwmac = plat->bsp_priv;
|
||||
u32 reg, div;
|
||||
|
||||
switch (plat->mac_interface) {
|
||||
switch (plat->phy_interface) {
|
||||
case PHY_INTERFACE_MODE_MII:
|
||||
reg = GMAC_RX_CLK_EN | GMAC_TX_CLK_EN;
|
||||
break;
|
||||
@@ -177,8 +177,8 @@ static int thead_dwmac_enable_clk(struct plat_stmmacenet_data *plat)
|
||||
break;
|
||||
|
||||
default:
|
||||
dev_err(dwmac->dev, "unsupported phy interface %d\n",
|
||||
plat->mac_interface);
|
||||
dev_err(dwmac->dev, "unsupported phy interface %s\n",
|
||||
phy_modes(plat->phy_interface));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user