drivers/phy/samsung/phy-exynos5-usbdrd.c
Source file repositories/reference/linux-study-clean/drivers/phy/samsung/phy-exynos5-usbdrd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/phy/samsung/phy-exynos5-usbdrd.c- Extension
.c- Size
- 94294 bytes
- Lines
- 3072
- 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.
- 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/bitfield.hlinux/clk.hlinux/delay.hlinux/io.hlinux/kernel.hlinux/module.hlinux/of.hlinux/iopoll.hlinux/phy/phy.hlinux/platform_device.hlinux/mutex.hlinux/mfd/syscon.hlinux/regmap.hlinux/regulator/consumer.hlinux/soc/samsung/exynos-regs-pmu.hlinux/usb/typec.hlinux/usb/typec_mux.h
Detected Declarations
struct exynos5_usbdrd_phy_tuningstruct phy_usb_instancestruct exynos5_usbdrd_phystruct exynos5_usbdrd_phy_configstruct exynos5_usbdrd_phy_drvdatastruct exynos5_usbdrd_phystruct phy_usb_instanceenum exynos5_usbdrd_phy_tuning_stateenum exynos5_usbdrd_phy_idfunction portsfunction exynos5_rate_to_clkfunction exynos5_usbdrd_phy_isolfunction exynos5_usbdrd_pipe3_set_refclkfunction exynos5_usbdrd_utmi_set_refclkfunction exynos5_usbdrd_apply_phy_tunesfunction for_each_phy_tunefunction exynos5_usbdrd_pipe3_initfunction exynos5_usbdrd_usbdp_g2_v4_ctrl_pma_readyfunction exynos5_usbdrd_usbdp_g2_v4_pma_lane_mux_selfunction exynos5_usbdrd_usbdp_g2_v4_pma_check_pll_lockfunction exynos5_usbdrd_usbdp_g2_v4_pma_check_cdr_lockfunction exynos5_usbdrd_utmi_initfunction exynos5_usbdrd_phy_initfunction exynos5_usbdrd_phy_exitfunction exynos5_usbdrd_phy_power_onfunction exynos5_usbdrd_phy_power_offfunction crport_handshakefunction crport_ctrl_writefunction exynos5420_usbdrd_phy_calibratefunction detectedfunction exynos5_usbdrd_phy_calibratefunction exynos7870_usbdrd_phy_isolfunction exynos7870_usbdrd_utmi_initfunction exynos7870_usbdrd_phy_initfunction exynos7870_usbdrd_phy_exitfunction exynos2200_usbdrd_utmi_initfunction exynos2200_usbdrd_link_initfunction exynos2200_usbdrd_link_attach_detach_pipe3_phyfunction exynos2200_usbdrd_phy_initfunction exynos2200_usbdrd_phy_exitfunction exynos5_usbdrd_usb_v3p1_pipe_overridefunction exynos850_usbdrd_utmi_initfunction exynos850_usbdrd_phy_initfunction exynos850_usbdrd_phy_exitfunction exynos5_usbdrd_gs101_pipe3_initfunction exynos5_usbdrd_gs101_phy_initfunction exynos5_usbdrd_gs101_phy_exitfunction exynos5_usbdrd_phy_clk_handle
Annotated Snippet
struct exynos5_usbdrd_phy_tuning {
u32 off;
u32 mask;
u32 val;
char region;
#define PTR_INVALID 0
#define PTR_PHY 1
#define PTR_PCS 2
#define PTR_PMA 3
};
enum exynos5_usbdrd_phy_tuning_state {
PTS_UTMI_POSTINIT,
PTS_PIPE3_PREINIT,
PTS_PIPE3_INIT,
PTS_PIPE3_POSTINIT,
PTS_PIPE3_POSTLOCK,
PTS_MAX,
};
enum exynos5_usbdrd_phy_id {
EXYNOS5_DRDPHY_UTMI,
EXYNOS5_DRDPHY_PIPE3,
EXYNOS5_DRDPHYS_NUM,
};
struct phy_usb_instance;
struct exynos5_usbdrd_phy;
struct exynos5_usbdrd_phy_config {
u32 id;
void (*phy_isol)(struct phy_usb_instance *inst, bool isolate);
void (*phy_init)(struct exynos5_usbdrd_phy *phy_drd);
unsigned int (*set_refclk)(struct phy_usb_instance *inst);
};
struct exynos5_usbdrd_phy_drvdata {
const struct exynos5_usbdrd_phy_config *phy_cfg;
const struct exynos5_usbdrd_phy_tuning **phy_tunes;
const struct phy_ops *phy_ops;
const char * const *clk_names;
int n_clks;
const char * const *core_clk_names;
int n_core_clks;
const char * const *regulator_names;
int n_regulators;
u32 pmu_offset_usbdrd0_phy;
u32 pmu_offset_usbdrd0_phy_ss;
u32 pmu_offset_usbdrd1_phy;
};
/**
* struct exynos5_usbdrd_phy - driver data for USB 3.0 PHY
* @dev: pointer to device instance of this platform device
* @reg_phy: usb phy controller register memory base
* @reg_pcs: usb phy physical coding sublayer register memory base
* @reg_pma: usb phy physical media attachment register memory base
* @clks: clocks for register access
* @core_clks: core clocks for phy (ref, pipe3, utmi+, ITP, etc. as required)
* @drv_data: pointer to SoC level driver data structure
* @hs_phy: pointer to non-Samsung IP high-speed phy controller
* @phy_mutex: mutex protecting phy_init/exit & TCPC callbacks
* @phys: array for 'EXYNOS5_DRDPHYS_NUM' number of PHY
* instances each with its 'phy' and 'phy_cfg'.
* @extrefclk: frequency select settings when using 'separate
* reference clocks' for SS and HS operations
* @regulators: regulators for phy
* @sw: TypeC orientation switch handle
* @orientation: TypeC connector orientation - normal or flipped
*/
struct exynos5_usbdrd_phy {
struct device *dev;
void __iomem *reg_phy;
void __iomem *reg_pcs;
void __iomem *reg_pma;
struct clk_bulk_data *clks;
struct clk_bulk_data *core_clks;
const struct exynos5_usbdrd_phy_drvdata *drv_data;
struct phy *hs_phy;
struct mutex phy_mutex;
struct phy_usb_instance {
struct phy *phy;
u32 index;
struct regmap *reg_pmu;
u32 pmu_offset;
const struct exynos5_usbdrd_phy_config *phy_cfg;
} phys[EXYNOS5_DRDPHYS_NUM];
u32 extrefclk;
struct regulator_bulk_data *regulators;
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/clk.h`, `linux/delay.h`, `linux/io.h`, `linux/kernel.h`, `linux/module.h`, `linux/of.h`, `linux/iopoll.h`.
- Detected declarations: `struct exynos5_usbdrd_phy_tuning`, `struct phy_usb_instance`, `struct exynos5_usbdrd_phy`, `struct exynos5_usbdrd_phy_config`, `struct exynos5_usbdrd_phy_drvdata`, `struct exynos5_usbdrd_phy`, `struct phy_usb_instance`, `enum exynos5_usbdrd_phy_tuning_state`, `enum exynos5_usbdrd_phy_id`, `function ports`.
- Atlas domain: Driver Families / drivers/phy.
- Implementation status: source implementation candidate.
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.