net: phy: icplus: allow configuring the interrupt function on IP101GR
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sun, 18 Nov 2018 21:23:59 +0000 (22:23 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Nov 2018 00:16:20 +0000 (16:16 -0800)
commitf2f1a847e74f61fb151e0f6f689a8485345ed1fc
tree333df68449a77286cea4686ce56adda261bbcb92
parentf7e290fbeb336421ba6237548b693c9afb4d75fa
net: phy: icplus: allow configuring the interrupt function on IP101GR

The IP101GR is a 32-pin QFN package variant of the IP101G/IP101GA
Ethernet PHY. Due to it's limited amount of pins the RXER (receive
error) and INTR32 (interrupt) functions share pin 21.
By default the PHY is configured to output the "receive error" status on
pin 21. Depending on the board layout and requirements we may want to
re-configure the PHY to output the interrupt signal there.

The mode of pin 21 can be configured in the "Digital I/O Specific
Control Register" (register 29), bit 2:
- 0 = RXER function
- 1 = INTR(32) function

Depending on the devicetree configuration we will now:
- change the mode to either ther RXER or INTR32 function
- keep the SEL_INTR32 value set by the bootloader (default) if no
  configuration is provided (to ensure that we're not breaking existing
  boards)
- error out if conflicting configuration is given (RXER and INTR32 mode
  are enabled at the same time)

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/icplus.c