phy: sparx5-serdes: add indirection layer to register macros
authorDaniel Machon <daniel.machon@microchip.com>
Mon, 9 Sep 2024 15:14:46 +0000 (17:14 +0200)
committerVinod Koul <vkoul@kernel.org>
Mon, 21 Oct 2024 18:32:03 +0000 (00:02 +0530)
commitc8e4c8b7ea47cb9044c190e6148e994c8e04a34a
treef5dc0da9320e4559486a8e29688459f8038f4c02
parentf16df057837e06d16b5e5f978d79d80d70784b80
phy: sparx5-serdes: add indirection layer to register macros

The register macros are used to read and write to the SERDES registers.
The registers are largely the same on Sparx5 and lan969x, however some
register target sizes differ. Therefore we introduce a new indirection
to the register macros. The target sizes are looked up, using a mapping
table (sparx5_serdes_tsize) that maps the register target to the
register target size.

With this addition, we can reuse all the existing macros for lan969x.

Also the autogenerated macros are now formatted slightly different, to
adhere to a 80 character limit.

Signed-off-by: Daniel Machon <daniel.machon@microchip.com>
Reviewed-by: Steen Hegelund <Steen.Hegelund@microchip.com>
Link: https://lore.kernel.org/r/20240909-sparx5-lan969x-serdes-driver-v2-6-d695bcb57b84@microchip.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/microchip/sparx5_serdes.c
drivers/phy/microchip/sparx5_serdes.h
drivers/phy/microchip/sparx5_serdes_regs.h