U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] phy: add common PHY polarity properties support
@ 2026-04-05 14:49 Lucien.Jheng
  2026-04-05 14:49 ` [PATCH v3 1/4] phy: add common PHY " Lucien.Jheng
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Lucien.Jheng @ 2026-04-05 14:49 UTC (permalink / raw)
  To: trini, jerome.forissier, sumit.garg, marek.vasut+renesas,
	vladimir.oltean
  Cc: ericwouds, kabel, frank-w, daniel, ansuelsmth, mkorpershoek,
	skylake.huang, lucien.jheng, u-boot, Lucien.Jheng

This series ports PHY polarity inversion support via generic device tree
properties from Linux kernel, synchronizing with Merge tag 'phy-for-7.0'
of git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.

Patch 1 introduces a new PHY_COMMON_PROPS library providing helper
functions (phy_get_rx_polarity, phy_get_tx_polarity, and their
"manual" variants) for PHY drivers to read standard polarity properties
from the device tree. The PHY_POL_NORMAL, PHY_POL_INVERT, and
PHY_POL_AUTO constants are consumed from dts/upstream/include, which is
already on the compiler include path.

Patch 2 updates the Airoha EN8811H PHY driver to use the new standard
rx-polarity and tx-polarity properties, with backward compatibility
fallback to the now-deprecated airoha,pnswap-rx and airoha,pnswap-tx
boolean properties.

Patches 3-4 add sandbox DM unit tests for the new library, ported from
the Linux KUnit test (linux/drivers/phy/phy-common-props-test.c). Patch 3
adds the build rule in test/dm/Makefile and 16 unit test cases (8 for rx,
8 for tx) covering: missing property, single value with no names array,
count mismatches, name-based lookup, missing default fallback, default
fallback, and unsupported polarity value. Patch 4 adds the corresponding
8 test DT nodes to arch/sandbox/dts/test.dts.

Changes in v3:
- patch 1: fix ofnode_get_u32_prop_for_name() to apply default_val and
  return 0 when the polarity property is absent, instead of returning
  -ENOENT; update @node and @default_val kdoc accordingly — this aligns
  the "missing property" path with the behaviour expected by
  phy_get_manual_rx/tx_polarity() and is validated by the new unit tests
- Add unit tests for the PHY_COMMON_PROPS library (patches 3-4), ported
  from Linux KUnit test linux/drivers/phy/phy-common-props-test.c
- Add test/dm/Makefile build entry gated on CONFIG_PHY_COMMON_PROPS
- Add 8 sandbox DT nodes to arch/sandbox/dts/test.dts covering all test
  scenarios; include <dt-bindings/phy/phy.h> in test.dts

Changes in v2:
- Drop DT binding patches (v1 patches 1 and 3): already merged via
  the DTS upstream subtree merge (tag 'v7.0-rc2-dts')
- Drop creation of include/dt-bindings/phy/phy.h: the header is now
  provided by dts/upstream/include/dt-bindings/phy/phy.h, which is
  already in the build's include search path

Lucien.Jheng (4):
  phy: add common PHY properties support
  net: phy: air_en8811h: use standard rx-polarity/tx-polarity properties
  test: dm: add PHY common props unit tests
  sandbox: dts: add PHY common props test nodes

 arch/sandbox/dts/test.dts            |  60 +++++
 drivers/net/phy/airoha/Kconfig       |   1 +
 drivers/net/phy/airoha/air_en8811.c  |  58 +++--
 drivers/phy/Kconfig                  |   8 +
 drivers/phy/Makefile                 |   1 +
 drivers/phy/phy-common-props.c       | 286 ++++++++++++++++++++++++
 include/linux/phy/phy-common-props.h |  69 ++++++
 test/dm/Makefile                     |   1 +
 test/dm/phy_common_props.c           | 319 +++++++++++++++++++++++++++
 9 files changed, 789 insertions(+), 14 deletions(-)
 create mode 100644 drivers/phy/phy-common-props.c
 create mode 100644 include/linux/phy/phy-common-props.h
 create mode 100644 test/dm/phy_common_props.c

-- 
2.34.1


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-04-25 18:07 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-05 14:49 [PATCH v3 0/4] phy: add common PHY polarity properties support Lucien.Jheng
2026-04-05 14:49 ` [PATCH v3 1/4] phy: add common PHY " Lucien.Jheng
2026-04-11 14:37   ` Simon Glass
2026-04-24 16:46     ` Lucien.Jheng
2026-04-05 14:49 ` [PATCH v3 2/4] net: phy: air_en8811h: use standard rx-polarity/tx-polarity properties Lucien.Jheng
2026-04-11 14:37   ` Simon Glass
2026-04-24 16:48     ` Lucien.Jheng
2026-04-05 14:49 ` [PATCH v3 3/4] test: dm: add PHY common props unit tests Lucien.Jheng
2026-04-11 14:38   ` Simon Glass
2026-04-05 14:49 ` [PATCH v3 4/4] sandbox: dts: add PHY common props test nodes Lucien.Jheng
2026-04-11 14:38   ` Simon Glass
2026-04-24 17:01     ` Lucien.Jheng
2026-04-11 14:37 ` [v3,0/4] phy: add common PHY polarity properties support Simon Glass
2026-04-25  2:18   ` Lucien.Jheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox