]> 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)
commit246f5ff80fecbd8fcf6b974abb8d093d50a8158d
treeb451e4f0c176b1c065802c600fb95bbfbbf4ae05
parent599bcaf39e5416571dc0304ca3755bbdd9a51689
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