mbox series

[net-next,v3,0/5] net: phy: split at803x

Message ID 20240128120451.31219-1-ansuelsmth@gmail.com
Headers show
Series net: phy: split at803x | expand

Message

Christian Marangi Jan. 28, 2024, 12:04 p.m. UTC
This is the last patchset of a long series of cleanup and
preparation to make at803x better maintainable and permit
the addition of other QCOM PHY Families.

A shared library modules is created since many QCOM PHY share
similar/exact implementation and are reused.

This series doesn't introduce any new code but just move the
function around and introduce a new module for all the functions
that are shared between the 3 different PHY family.

Since the drivers are actually detached, new probe function are
introduced that allocate the specific priv struct for the PHYs.

After this patch, qca808x will be further generalized as LED
and cable test function are also used by the QCA807x PHYs.
This is just for reference and the additional function move will
be done on the relates specific series.

This is also needed in preparation for the introduction of
qca807x PHYs family and PHY package concept.

Changes v3:
- Fix compilation error on testing single change till
  patch 4. (improve bisectability of the series)
Changes v2:
- Out of RFC (at808x dependency got merged)

Christian Marangi (5):
  net: phy: move at803x PHY driver to dedicated directory
  net: phy: qcom: create and move functions to shared library
  net: phy: qcom: deatch qca83xx PHY driver from at803x
  net: phy: qcom: move additional functions to shared library
  net: phy: qcom: detach qca808x PHY driver from at803x

 drivers/net/phy/Kconfig             |    7 +-
 drivers/net/phy/Makefile            |    2 +-
 drivers/net/phy/at803x.c            | 2759 ---------------------------
 drivers/net/phy/qcom/Kconfig        |   22 +
 drivers/net/phy/qcom/Makefile       |    5 +
 drivers/net/phy/qcom/at803x.c       | 1140 +++++++++++
 drivers/net/phy/qcom/qca808x.c      |  934 +++++++++
 drivers/net/phy/qcom/qca83xx.c      |  275 +++
 drivers/net/phy/qcom/qcom-phy-lib.c |  429 +++++
 drivers/net/phy/qcom/qcom.h         |  120 ++
 10 files changed, 2927 insertions(+), 2766 deletions(-)
 delete mode 100644 drivers/net/phy/at803x.c
 create mode 100644 drivers/net/phy/qcom/Kconfig
 create mode 100644 drivers/net/phy/qcom/Makefile
 create mode 100644 drivers/net/phy/qcom/at803x.c
 create mode 100644 drivers/net/phy/qcom/qca808x.c
 create mode 100644 drivers/net/phy/qcom/qca83xx.c
 create mode 100644 drivers/net/phy/qcom/qcom-phy-lib.c
 create mode 100644 drivers/net/phy/qcom/qcom.h

Comments

Andrew Lunn Jan. 28, 2024, 11:46 p.m. UTC | #1
On Sun, Jan 28, 2024 at 01:04:24PM +0100, Christian Marangi wrote:
> Deatch qca83xx PHY driver from at803x.
> 
> The QCA83xx PHYs implement specific function and doesn't use generic
> at803x so it can be detached from the driver and moved to a dedicated
> one.
> 
> Probe function and priv struct is reimplemented to allocate and use
> only the qca83xx specific data. Unused data from at803x PHY driver
> are dropped from at803x priv struct.
> 
> This is to make slimmer PHY drivers instead of including lots of bloat
> that would never be used in specific SoC.
> 
> A new Kconfig flag QCA83XX_PHY is introduced to compile the new
> introduced PHY driver.
> 
> As the Kconfig name starts with Qualcomm the same order is kept.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Andrew Lunn Jan. 28, 2024, 11:52 p.m. UTC | #2
On Sun, Jan 28, 2024 at 01:04:26PM +0100, Christian Marangi wrote:
> Almost all the QCA8081 PHY driver OPs are specific and only some of them
> use the generic at803x.
> 
> To make the at803x code slimmer, move all the specific qca808x regs and
> functions to a dedicated PHY driver.
> 
> Probe function and priv struct is reworked to allocate and use only the
> qca808x specific data. Unused data from at803x PHY driver are dropped
> from at803x priv struct.
> 
> Also a new Kconfig is introduced QCA808X_PHY, to compile the newly
> introduced PHY driver for QCA8081 PHY.
> 
> As the Kconfig name starts with Qualcomm the same order is kept.
> 
> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew