Documentation/translations/zh_CN/driver-api/phy/phy.rst
Source file repositories/reference/linux-study-clean/Documentation/translations/zh_CN/driver-api/phy/phy.rst
File Facts
- System
- Linux kernel
- Corpus path
Documentation/translations/zh_CN/driver-api/phy/phy.rst- Extension
.rst- Size
- 8204 bytes
- Lines
- 213
- Domain
- Support Tooling And Documentation
- Bucket
- Documentation
- Inferred role
- Support Tooling And Documentation: documentation
- Status
- atlas-only
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
- No top-level syscall, struct, function, initcall, or export declaration detected by the generator.
Annotated Snippet
.. SPDX-License-Identifier: GPL-2.0
.. include:: ../../disclaimer-zh_CN.rst
:Original: Documentation/driver-api/phy/phy.rst
:翻译:
司延腾 Yanteng Si <siyanteng@loongson.cn>
=========
PHY子系统
=========
:作者: Kishon Vijay Abraham I <kishon@ti.com>
本文档解释了 PHY 的通用框架和提供的API,以及使用方法。
简介
====
*PHY* 是物理层的缩写,它被用来把设备连接到一个物理媒介,例如USB控制器
有一个提供序列化、反序列化、编码、解码和负责获取所需的数据传输速率的 PHY。
注意,有些USB控制器内嵌了 PHY 的功能,其它的则使用了一个外置的PHY,此外
使用 PHY 的设备还有无线网、以太网、SATA等(控制器)。
创建这个框架的目的是将遍布 Linux 内核的 PHY 驱动程序融入到 drivers/phy,
以增加代码的可复用性,进而提高代码的可维护性。
该框架仅适用于使用外部 PHY(PHY 功能未嵌入控制器内)的设备。
注册/注销PHY provider
=====================
PHY provider是指实现一个或多个 PHY 实例的实体。对于 PHY provider 仅
实现单个 PHY 实例的简单情况,框架在 of_phy_simple_xlate 中提供其自己
的 of_xlate 实现。如果 PHY provider 实现多个实例,则应提供其自己的
of_xlate 实现。of_xlate 仅用于 dt 启动情况。
::
#define of_phy_provider_register(dev, xlate) \
__of_phy_provider_register((dev), NULL, THIS_MODULE, (xlate))
#define devm_of_phy_provider_register(dev, xlate) \
__devm_of_phy_provider_register((dev), NULL, THIS_MODULE,
(xlate))
of_phy_provider_register 和 devm_of_phy_provider_register 宏
可用于注册 phy_provider,它以 device 和 of_xlate 作为参数。对于 dt
启动情况,所有 PHY provider 都应使用上述两个宏之一来注册 PHY provider。
与 PHY provider 关联的设备树节点通常包含一组子节点,每个子节点代表一个
PHY。某些绑定可能会为了上下文和可扩展性将子节点嵌套在特别的层级中,在这种
情况下,可以使用低级别的 of_phy_provider_register_full() 和
devm_of_phy_provider_register_full() 宏来覆盖包含子节点的节点。
::
#define of_phy_provider_register_full(dev, children, xlate) \
__of_phy_provider_register(dev, children, THIS_MODULE, xlate)
#define devm_of_phy_provider_register_full(dev, children, xlate) \
__devm_of_phy_provider_register_full(dev, children,
THIS_MODULE, xlate)
void devm_of_phy_provider_unregister(struct device *dev,
struct phy_provider *phy_provider);
void of_phy_provider_unregister(struct phy_provider *phy_provider);
devm_of_phy_provider_unregister 和 of_phy_provider_unregister
Annotation
- Atlas domain: Support Tooling And Documentation / Documentation.
- Implementation status: atlas-only.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.