drivers/phy/apple/atc.c
Source file repositories/reference/linux-study-clean/drivers/phy/apple/atc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/phy/apple/atc.c- Extension
.c- Size
- 78067 bytes
- Lines
- 2315
- 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
dt-bindings/phy/phy.hlinux/bitfield.hlinux/cleanup.hlinux/delay.hlinux/iopoll.hlinux/lockdep.hlinux/module.hlinux/mutex.hlinux/of.hlinux/of_device.hlinux/phy/phy.hlinux/platform_device.hlinux/reset-controller.hlinux/soc/apple/tunable.hlinux/types.hlinux/usb/pd.hlinux/usb/typec.hlinux/usb/typec_altmode.hlinux/usb/typec_dp.hlinux/usb/typec_mux.hlinux/usb/typec_tbt.h
Detected Declarations
struct atcphy_dp_link_rate_configurationstruct atcphy_mode_configurationstruct apple_atcphyenum atcphy_lane_modeenum atcphy_dp_link_rateenum atcphy_pipehandler_stateenum atcphy_modeenum atcphy_lanefunction mask32function core_mask32function set32function core_set32function clear32function core_clear32function atcphy_apply_tunablesfunction atcphy_pipehandler_lockfunction atcphy_pipehandler_unlockfunction atcphy_pipehandler_checkfunction atcphy_configure_pipehandler_usb3function atcphy_configure_pipehandler_dummyfunction atcphy_configure_pipehandlerfunction atcphy_setup_pipehandlerfunction atcphy_configure_lanesfunction atcphy_enable_dp_auxfunction atcphy_disable_dp_auxfunction atcphy_dp_configure_lanefunction atcphy_auspll_apb_commandfunction atcphy_dp_configurefunction atcphy_usb2_power_offfunction atcphy_power_offfunction atcphy_usb2_power_onfunction atcphy_power_onfunction atcphy_configurefunction atcphy_usb2_set_modefunction atcphy_usb3_power_offfunction atcphy_usb3_set_modefunction atcphy_dpphy_set_modefunction atcphy_dpphy_validatefunction atcphy_dpphy_configurefunction atcphy_probe_phyfunction _atcphy_dwc3_reset_assertfunction atcphy_dwc3_reset_assertfunction atcphy_dwc3_reset_deassertfunction atcphy_reset_xlatefunction atcphy_probe_rcdevfunction atcphy_sw_setfunction atcphy_typec_switch_unregisterfunction atcphy_probe_switch
Annotated Snippet
struct atcphy_dp_link_rate_configuration {
u16 freqinit_count_target;
u16 fbdivn_frac_den;
u16 fbdivn_frac_num;
u16 pclk_div_sel;
u8 lfclk_ctrl;
u8 vclk_op_divn;
bool plla_clkout_vreg_bypass;
bool txa_ldoclk_bypass;
bool txa_div2_en;
};
/* Crossbar and lane configuration */
struct atcphy_mode_configuration {
u32 crossbar;
u32 crossbar_dp_single_pma;
bool crossbar_dp_both_pma;
enum atcphy_lane_mode lane_mode[2];
bool dp_lane[2];
bool set_swap;
};
/**
* struct apple_atcphy - Apple Type-C PHY device struct
* @np: Device node pointer
* @dev: Device pointer
* @tunables: Firmware-provided tunable parameters
* @tunables.axi2af: AXI to AF interface tunables
* @tunables.common: Common tunables for all lanes
* @tunables.lane_usb3: USB3 lane-specific tunables
* @tunables.lane_dp: DisplayPort lane-specific tunables
* @tunables.lane_usb4: USB4 lane-specific tunables
* @mode: Current PHY operating mode
* @swap_lanes: True if lanes must be swapped due to cable orientation
* @dp_link_rate: DisplayPort link rate
* @pipehandler_up: True if the PIPE mux ("pipehandler") is set to USB3 or USB4 mode
* @regs: Memory-mapped registers
* @regs.core: Core registers
* @regs.axi2af: AXI to Apple Fabric interface registers
* @regs.usb2phy: USB2 PHY registers
* @regs.pipehandler: USB3 PIPE interface ("pipehandler") registers
* @regs.lpdptx: DisplayPort registers
* @res: Resources for memory-mapped registers, used to verify that tunables aren't out of bounds
* @res.core: Core register resource
* @res.axi2af: AXI to Apple Fabric interface resource
* @phys: PHY instances
* @phys.usb2: USB2 PHY instance
* @phys.usb3: USB3 PHY instance
* @phys.dp: DisplayPort PHY instance
* @phy_provider: PHY provider instance
* @rcdev: Reset controller device
* @sw: Type-C switch instance
* @mux: Type-C mux instance
* @lock: Mutex for synchronizing register access across PHY, Type-C switch/mux and reset controller
*/
struct apple_atcphy {
struct device_node *np;
struct device *dev;
struct {
struct apple_tunable *axi2af;
struct apple_tunable *common[2];
struct apple_tunable *lane_usb3[2];
struct apple_tunable *lane_dp[2];
struct apple_tunable *lane_usb4[2];
} tunables;
enum atcphy_mode mode;
bool swap_lanes;
int dp_link_rate;
bool pipehandler_up;
struct {
void __iomem *core;
void __iomem *axi2af;
void __iomem *usb2phy;
void __iomem *pipehandler;
void __iomem *lpdptx;
} regs;
struct {
struct resource *core;
struct resource *axi2af;
} res;
struct {
struct phy *usb2;
struct phy *usb3;
struct phy *dp;
} phys;
Annotation
- Immediate include surface: `dt-bindings/phy/phy.h`, `linux/bitfield.h`, `linux/cleanup.h`, `linux/delay.h`, `linux/iopoll.h`, `linux/lockdep.h`, `linux/module.h`, `linux/mutex.h`.
- Detected declarations: `struct atcphy_dp_link_rate_configuration`, `struct atcphy_mode_configuration`, `struct apple_atcphy`, `enum atcphy_lane_mode`, `enum atcphy_dp_link_rate`, `enum atcphy_pipehandler_state`, `enum atcphy_mode`, `enum atcphy_lane`, `function mask32`, `function core_mask32`.
- 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.