drivers/phy/tegra/xusb-tegra124.c
Source file repositories/reference/linux-study-clean/drivers/phy/tegra/xusb-tegra124.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/phy/tegra/xusb-tegra124.c- Extension
.c- Size
- 53524 bytes
- Lines
- 1758
- Domain
- Driver Families
- Bucket
- drivers/phy
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/delay.hlinux/io.hlinux/mailbox_client.hlinux/module.hlinux/of.hlinux/phy/phy.hlinux/platform_device.hlinux/regulator/consumer.hlinux/reset.hlinux/slab.hsoc/tegra/fuse.hxusb.h
Detected Declarations
struct tegra124_xusb_fuse_calibrationstruct tegra124_xusb_padctlfunction to_tegra124_xusb_padctlfunction tegra124_xusb_padctl_enablefunction tegra124_xusb_padctl_disablefunction tegra124_usb3_save_contextfunction tegra124_hsic_set_idlefunction tegra124_usb2_lane_probefunction tegra124_usb2_lane_removefunction tegra124_usb2_phy_initfunction tegra124_usb2_phy_exitfunction tegra124_usb2_phy_power_onfunction tegra124_usb2_phy_power_offfunction tegra124_usb2_pad_probefunction tegra124_usb2_pad_removefunction tegra124_ulpi_lane_probefunction tegra124_ulpi_lane_removefunction tegra124_ulpi_phy_initfunction tegra124_ulpi_phy_exitfunction tegra124_ulpi_phy_power_onfunction tegra124_ulpi_phy_power_offfunction tegra124_ulpi_pad_probefunction tegra124_ulpi_pad_removefunction tegra124_hsic_lane_probefunction tegra124_hsic_lane_removefunction tegra124_hsic_phy_initfunction tegra124_hsic_phy_exitfunction tegra124_hsic_phy_power_onfunction tegra124_hsic_phy_power_offfunction tegra124_hsic_pad_probefunction tegra124_hsic_pad_removefunction tegra124_pcie_lane_probefunction tegra124_pcie_lane_removefunction tegra124_pcie_phy_initfunction tegra124_pcie_phy_exitfunction tegra124_pcie_phy_power_onfunction tegra124_pcie_phy_power_offfunction tegra124_pcie_pad_probefunction tegra124_pcie_pad_removefunction tegra124_sata_lane_probefunction tegra124_sata_lane_removefunction tegra124_sata_phy_initfunction tegra124_sata_phy_exitfunction tegra124_sata_phy_power_onfunction tegra124_sata_phy_power_offfunction tegra124_sata_pad_probefunction tegra124_sata_pad_removefunction tegra124_usb2_port_enable
Annotated Snippet
struct tegra124_xusb_fuse_calibration {
u32 hs_curr_level[3];
u32 hs_iref_cap;
u32 hs_term_range_adj;
u32 hs_squelch_level;
};
struct tegra124_xusb_padctl {
struct tegra_xusb_padctl base;
struct tegra124_xusb_fuse_calibration fuse;
};
static inline struct tegra124_xusb_padctl *
to_tegra124_xusb_padctl(struct tegra_xusb_padctl *padctl)
{
return container_of(padctl, struct tegra124_xusb_padctl, base);
}
static int tegra124_xusb_padctl_enable(struct tegra_xusb_padctl *padctl)
{
u32 value;
mutex_lock(&padctl->lock);
if (padctl->enable++ > 0)
goto out;
value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM);
value &= ~XUSB_PADCTL_ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN;
padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM);
usleep_range(100, 200);
value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM);
value &= ~XUSB_PADCTL_ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN_EARLY;
padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM);
usleep_range(100, 200);
value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM);
value &= ~XUSB_PADCTL_ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN;
padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM);
out:
mutex_unlock(&padctl->lock);
return 0;
}
static int tegra124_xusb_padctl_disable(struct tegra_xusb_padctl *padctl)
{
u32 value;
mutex_lock(&padctl->lock);
if (WARN_ON(padctl->enable == 0))
goto out;
if (--padctl->enable > 0)
goto out;
value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM);
value |= XUSB_PADCTL_ELPG_PROGRAM_AUX_MUX_LP0_VCORE_DOWN;
padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM);
usleep_range(100, 200);
value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM);
value |= XUSB_PADCTL_ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN_EARLY;
padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM);
usleep_range(100, 200);
value = padctl_readl(padctl, XUSB_PADCTL_ELPG_PROGRAM);
value |= XUSB_PADCTL_ELPG_PROGRAM_AUX_MUX_LP0_CLAMP_EN;
padctl_writel(padctl, value, XUSB_PADCTL_ELPG_PROGRAM);
out:
mutex_unlock(&padctl->lock);
return 0;
}
static int tegra124_usb3_save_context(struct tegra_xusb_padctl *padctl,
unsigned int index)
{
struct tegra_xusb_usb3_port *port;
struct tegra_xusb_lane *lane;
u32 value, offset;
port = tegra_xusb_find_usb3_port(padctl, index);
Annotation
- Immediate include surface: `linux/delay.h`, `linux/io.h`, `linux/mailbox_client.h`, `linux/module.h`, `linux/of.h`, `linux/phy/phy.h`, `linux/platform_device.h`, `linux/regulator/consumer.h`.
- Detected declarations: `struct tegra124_xusb_fuse_calibration`, `struct tegra124_xusb_padctl`, `function to_tegra124_xusb_padctl`, `function tegra124_xusb_padctl_enable`, `function tegra124_xusb_padctl_disable`, `function tegra124_usb3_save_context`, `function tegra124_hsic_set_idle`, `function tegra124_usb2_lane_probe`, `function tegra124_usb2_lane_remove`, `function tegra124_usb2_phy_init`.
- Atlas domain: Driver Families / drivers/phy.
- Implementation status: integration 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.