Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: dp83867: allow RGMII_TXID/RGMII_RXID interface types

Currently dp83867 driver returns error if phy interface type
PHY_INTERFACE_MODE_RGMII_RXID is used to set the rx only internal
delay. Similarly issue happens for PHY_INTERFACE_MODE_RGMII_TXID.
Fix this by checking also the interface type if a particular delay
value is missing in the phy dt bindings. Also update the DT document
accordingly.

Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Karicheri, Muralidharan and committed by
David S. Miller
34c55cf2 02ca0423

+10 -4
+4 -2
Documentation/devicetree/bindings/net/ti,dp83867.txt
··· 3 3 Required properties: 4 4 - reg - The ID number for the phy, usually a small integer 5 5 - ti,rx-internal-delay - RGMII Receive Clock Delay - see dt-bindings/net/ti-dp83867.h 6 - for applicable values 6 + for applicable values. Required only if interface type is 7 + PHY_INTERFACE_MODE_RGMII_ID or PHY_INTERFACE_MODE_RGMII_RXID 7 8 - ti,tx-internal-delay - RGMII Transmit Clock Delay - see dt-bindings/net/ti-dp83867.h 8 - for applicable values 9 + for applicable values. Required only if interface type is 10 + PHY_INTERFACE_MODE_RGMII_ID or PHY_INTERFACE_MODE_RGMII_TXID 9 11 - ti,fifo-depth - Transmitt FIFO depth- see dt-bindings/net/ti-dp83867.h 10 12 for applicable values 11 13
+6 -2
drivers/net/phy/dp83867.c
··· 132 132 133 133 ret = of_property_read_u32(of_node, "ti,rx-internal-delay", 134 134 &dp83867->rx_id_delay); 135 - if (ret) 135 + if (ret && 136 + (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || 137 + phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)) 136 138 return ret; 137 139 138 140 ret = of_property_read_u32(of_node, "ti,tx-internal-delay", 139 141 &dp83867->tx_id_delay); 140 - if (ret) 142 + if (ret && 143 + (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID || 144 + phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)) 141 145 return ret; 142 146 143 147 return of_property_read_u32(of_node, "ti,fifo-depth",