STRUCT APPLE_ATCPHY(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct apple_atcphy(9)

okay so this is a page from the Kernel API Manual and it's literally all about struct apple_atcphy β€” the Apple Type-C PHY device struct. yes bestie, the whole page is one struct. and she's a big one. let's get into it 🫢


✨ NAME ✨

struct apple_atcphy β€” the Apple Type-C PHY device struct. that's it, that's the vibe. iconic behavior tbh πŸ‘‘


🌸 SYNOPSIS 🌸

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;
    struct phy_provider *phy_provider;
    struct reset_controller_dev rcdev;
    struct mutex lock;
 };

like. look at her. nested structs for days. we love a structured queen πŸ’–


πŸŽ€ Members πŸŽ€

time for the member-by-member vibe check, no skips, no cuts, fr fr:

  • 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
  • lock β€” Mutex for synchronizing register access across PHY, Type-C switch/mux and reset controller
bestie note: that lock mutex is doing the Lord's work β€” it keeps register access in sync across the PHY, the Type-C switch/mux and the reset controller. three whole worlds, one mutex. main character energy for real 😭

πŸ”₯ SEE ALSO πŸ”₯

go touch grass in the kernel source, iykyk:

  • Kernel file ./drivers/phy/apple/atc.c
  • enum atcphy_pipehandler_state(9)
  • enum atcphy_mode(9)

and that's the page!! πŸ’œ this lovely little manual lives at ./drivers/phy/apple, dated October 2026, and it's from the Kernel API Manual. bye bestie, go read atc.c πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from