net: phy: add paged PHY register accessors
authorLucien.Jheng <lucienzx159@gmail.com>
Mon, 6 Oct 2025 12:49:15 +0000 (20:49 +0800)
committerJerome Forissier <jerome.forissier@linaro.org>
Wed, 22 Oct 2025 12:28:33 +0000 (14:28 +0200)
commit34369d34e413ac32a131dd144b55ad04873e4854
treefefc424ea089d60599fbdb303f0a8a8e3e69ec3c
parent648d2ade0b764847b248f5cc362a19510046289b
net: phy: add paged PHY register accessors

Synchronize paged PHY helpers with Linux v6.17.

Add support for PHY devices that use paged register access by
implementing the following functions:
- phy_save_page(): Save current page number
- phy_select_page(): Switch to a specific page and return previous page
- phy_restore_page(): Restore previously saved page

Also adds read_page and write_page callbacks to the phy_driver
structure to enable driver-specific page handling.

These helpers allow safe access to paged PHY registers by ensuring
proper page selection and restoration,
even in error conditions, which will be used by the Airoha PHY driver.

Signed-off-by: Lucien.Jheng <lucienzx159@gmail.com>
drivers/net/phy/phy.c
include/phy.h