drivers/phy/st/phy-miphy28lp.c
Source file repositories/reference/linux-study-clean/drivers/phy/st/phy-miphy28lp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/phy/st/phy-miphy28lp.c- Extension
.c- Size
- 33688 bytes
- Lines
- 1256
- Domain
- Driver Families
- Bucket
- drivers/phy
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/platform_device.hlinux/io.hlinux/iopoll.hlinux/kernel.hlinux/module.hlinux/of.hlinux/of_platform.hlinux/of_address.hlinux/clk.hlinux/phy/phy.hlinux/delay.hlinux/mfd/syscon.hlinux/regmap.hlinux/reset.hdt-bindings/phy/phy.h
Detected Declarations
struct miphy28lp_phystruct miphy28lp_devstruct pll_ratiostruct miphy28lp_pll_genenum miphy_sata_genfunction miphy28lp_set_resetfunction miphy28lp_pll_calibrationfunction miphy28lp_sata_config_genfunction miphy28lp_pcie_config_genfunction miphy28lp_wait_compensationfunction miphy28lp_compensationfunction miphy28_usb3_miphy_resetfunction miphy_sata_tune_sscfunction miphy_pcie_tune_sscfunction miphy_tune_tx_impedancefunction miphy28lp_configure_satafunction miphy28lp_configure_pciefunction miphy28lp_configure_usb3function miphy_is_readyfunction miphy_osc_is_readyfunction miphy28lp_get_resource_bynamefunction miphy28lp_get_one_addrfunction miphy28lp_setupfunction miphy28lp_init_satafunction miphy28lp_init_pciefunction miphy28lp_init_usb3function miphy28lp_initfunction miphy28lp_get_addrfunction miphy28lp_probe_resetsfunction miphy28lp_of_probefunction miphy28lp_probefunction for_each_child_of_node
Annotated Snippet
struct miphy28lp_phy {
struct phy *phy;
struct miphy28lp_dev *phydev;
void __iomem *base;
void __iomem *pipebase;
bool osc_force_ext;
bool osc_rdy;
bool px_rx_pol_inv;
bool ssc;
bool tx_impedance;
struct reset_control *miphy_rst;
u32 sata_gen;
/* Sysconfig registers offsets needed to configure the device */
u32 syscfg_reg[SYSCFG_REG_MAX];
u8 type;
};
struct miphy28lp_dev {
struct device *dev;
struct regmap *regmap;
struct mutex miphy_mutex;
struct miphy28lp_phy **phys;
int nphys;
};
enum miphy_sata_gen { SATA_GEN1, SATA_GEN2, SATA_GEN3 };
static char *PHY_TYPE_name[] = { "sata-up", "pcie-up", "", "usb3-up" };
struct pll_ratio {
int clk_ref;
int calset_1;
int calset_2;
int calset_3;
int calset_4;
int cal_ctrl;
};
static struct pll_ratio sata_pll_ratio = {
.clk_ref = 0x1e,
.calset_1 = 0xc8,
.calset_2 = 0x00,
.calset_3 = 0x00,
.calset_4 = 0x00,
.cal_ctrl = 0x00,
};
static struct pll_ratio pcie_pll_ratio = {
.clk_ref = 0x1e,
.calset_1 = 0xa6,
.calset_2 = 0xaa,
.calset_3 = 0xaa,
.calset_4 = 0x00,
.cal_ctrl = 0x00,
};
static struct pll_ratio usb3_pll_ratio = {
.clk_ref = 0x1e,
.calset_1 = 0xa6,
.calset_2 = 0xaa,
.calset_3 = 0xaa,
.calset_4 = 0x04,
.cal_ctrl = 0x00,
};
struct miphy28lp_pll_gen {
int bank;
int speed;
int bias_boost_1;
int bias_boost_2;
int tx_ctrl_1;
int tx_ctrl_2;
int tx_ctrl_3;
int rx_k_gain;
int rx_vga_gain;
int rx_equ_gain_1;
int rx_equ_gain_2;
int rx_equ_gain_3;
int rx_buff_ctrl;
};
static struct miphy28lp_pll_gen sata_pll_gen[] = {
{
.bank = 0x00,
.speed = TX_SPDSEL_80DEC | RX_SPDSEL_80DEC,
.bias_boost_1 = 0x00,
Annotation
- Immediate include surface: `linux/platform_device.h`, `linux/io.h`, `linux/iopoll.h`, `linux/kernel.h`, `linux/module.h`, `linux/of.h`, `linux/of_platform.h`, `linux/of_address.h`.
- Detected declarations: `struct miphy28lp_phy`, `struct miphy28lp_dev`, `struct pll_ratio`, `struct miphy28lp_pll_gen`, `enum miphy_sata_gen`, `function miphy28lp_set_reset`, `function miphy28lp_pll_calibration`, `function miphy28lp_sata_config_gen`, `function miphy28lp_pcie_config_gen`, `function miphy28lp_wait_compensation`.
- Atlas domain: Driver Families / drivers/phy.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.