mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/5] phy: core: Add phy bulk helpers support
@ 2026-09-23  2:32 Inochi Amaoto
  2026-09-23  2:32 ` [PATCH v3 1/5] phy: core: Add common helper to add phy phandle device link Inochi Amaoto
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Inochi Amaoto @ 2026-09-23  2:32 UTC (permalink / raw)
  To: Jonathan Corbet, Shuah Khan, Randy Dunlap, Vinod Koul,
	Neil Armstrong, Manivannan Sadhasivam, Rhys Tumelty,
	Inochi Amaoto
  Cc: linux-doc, linux-kernel, linux-phy, Yixun Lan, Longbin Li

As discussed in [1], some drivers may do not care the difference between
phys. Instead, they only need to treat them as a group and operate them
together. This means a bulk operation is needed.

Add some bulk helper functions for phy core by referencing the design of
clock/reset subsystem. This can relieve the driver owners' life who needs
to handle many phys, as well as each phy error reporting.

The example consumer driver is at [2], with the following function used:
- phy_bulk_init
- phy_bulk_exit
- phy_bulk_power_on
- phy_bulk_power_off
- devm_of_phy_bulk_get_all
The devm_phy_bulk_get_all() is also added as a simple wrapper of
devm_of_phy_bulk_get_all().

Note: The patch still uses -EOPNOTSUPP for dummy blob. Instead, I send
a new patch [3] for fixing the left function.

[1] https://lore.kernel.org/linux-pci/ak9KzNFF26B0Kttz@ashevche-desk.local/
[2] https://lore.kernel.org/linux-pci/20260923015016.64069-1-inochiama@gmail.com/
[3] https://lore.kernel.org/linux-phy/20260922024724.191412-1-inochiama@gmail.com/

Changed from v2:
patch 1:
1. Add Andy's tag
2. Update comment for phy_add_device_link
patch 2:
1. Add Andy's tag
2. Update comment for changed function
patch 3:
1. Remove all unused function and make the dependency as static things.
2. Update comments for struct phy_bulk_data and left functions
patch 4:
1. Remove all unused function and make the dependency as static things.
patch 5:
1. Add phy document for these newly added apis.

Changed from v1:
- https://lore.kernel.org/linux-phy/20260831025319.94886-1-inochiama@gmail.com/
patch 1:
1. Update document.
patch 2:
1. Fix document format.
2. Fix several document description.
patch 3:
1. Split into two patches: one for non devm helpers, one for devm helpers.
2. All the bulk helper now use unsigned int for counts.
3. Fix multiple the while loop statement.
4. Rename of_phy_get_parent_count() to of_phy_get_count().
5. Fix some 80 line function problems.
6. Use PTR_ERR_OR_ZERO() to simplify the error handle.
7. Fix zero value in the document
8. Use two separate release function for devm helpers.

Inochi Amaoto (5):
  phy: core: Add common helper to add phy phandle device link
  phy: core: Add common helper for get phy phandle by index
  phy: core: Add phy bulk data helper functions
  phy: core: Add managed phy bulk data helper functions
  doc: phy: Document some bulk helper functions

 Documentation/driver-api/phy/phy.rst |  29 ++
 drivers/phy/phy-core.c               | 416 ++++++++++++++++++++++++---
 include/linux/phy/phy.h              |  74 +++++
 3 files changed, 483 insertions(+), 36 deletions(-)

--
2.55.0


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

end of thread, other threads:[~2026-09-23  2:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-23  2:32 [PATCH v3 0/5] phy: core: Add phy bulk helpers support Inochi Amaoto
2026-09-23  2:32 ` [PATCH v3 1/5] phy: core: Add common helper to add phy phandle device link Inochi Amaoto
2026-09-23  2:33 ` [PATCH v3 2/5] phy: core: Add common helper for get phy phandle by index Inochi Amaoto
2026-09-23  2:33 ` [PATCH v3 3/5] phy: core: Add phy bulk data helper functions Inochi Amaoto
2026-09-23  2:33 ` [PATCH v3 4/5] phy: core: Add managed " Inochi Amaoto
2026-09-23  2:33 ` [PATCH v3 5/5] doc: phy: Document some bulk " Inochi Amaoto
2026-09-23  2:55   ` Randy Dunlap

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

all inboxes | Powered by JetHome®