]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: microchip: add common gigabit set and get function
authorArun Ramadoss <arun.ramadoss@microchip.com>
Sun, 24 Jul 2022 09:28:15 +0000 (14:58 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Jul 2022 08:39:16 +0000 (09:39 +0100)
commitdae044b6a990bb5d066e301f275321d507463766
treeb451e4f0c176b1c065802c600fb95bbfbbf4ae05
parent6815b9a053275be56f0b67dcb6dcd6f7f94a306c
net: dsa: microchip: add common gigabit set and get function

This patch add helper function for setting and getting the gigabit
enable for the ksz series switch. KSZ8795 switch has different register
address compared to all other ksz switches. KSZ8795 series uses the Port
5 Interface control 6 Bit 6 for configuring the 1Gbps or 100/10Mbps
speed selection. All other switches uses the xMII control 1 0xN301
register Bit6 for gigabit.
Further, for KSZ8795 & KSZ9893 switches if bit 1 then 1Gbps is chosen
and if bit 0 then 100/10Mbps is chosen. It is other way around for
other switches bit 0 is for 1Gbps. So, this patch implements the common
function for configuring the gigabit set and get capability.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/microchip/ksz9477.c
drivers/net/dsa/microchip/ksz9477_reg.h
drivers/net/dsa/microchip/ksz_common.c
drivers/net/dsa/microchip/ksz_common.h
drivers/net/dsa/microchip/lan937x_main.c
drivers/net/dsa/microchip/lan937x_reg.h