drivers/phy/lantiq/phy-lantiq-rcu-usb2.c
Source file repositories/reference/linux-study-clean/drivers/phy/lantiq/phy-lantiq-rcu-usb2.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/phy/lantiq/phy-lantiq-rcu-usb2.c- Extension
.c- Size
- 6470 bytes
- Lines
- 256
- 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/clk.hlinux/delay.hlinux/mfd/syscon.hlinux/module.hlinux/of.hlinux/of_address.hlinux/phy/phy.hlinux/platform_device.hlinux/property.hlinux/regmap.hlinux/reset.h
Detected Declarations
struct ltq_rcu_usb2_bitsstruct ltq_rcu_usb2_privfunction ltq_rcu_usb2_phy_initfunction ltq_rcu_usb2_phy_power_onfunction ltq_rcu_usb2_phy_power_offfunction ltq_rcu_usb2_of_parsefunction ltq_rcu_usb2_phy_probe
Annotated Snippet
struct ltq_rcu_usb2_bits {
u8 hostmode;
u8 slave_endianness;
u8 host_endianness;
bool have_ana_cfg;
};
struct ltq_rcu_usb2_priv {
struct regmap *regmap;
unsigned int phy_reg_offset;
unsigned int ana_cfg1_reg_offset;
const struct ltq_rcu_usb2_bits *reg_bits;
struct device *dev;
struct phy *phy;
struct clk *phy_gate_clk;
struct reset_control *ctrl_reset;
struct reset_control *phy_reset;
};
static const struct ltq_rcu_usb2_bits xway_rcu_usb2_reg_bits = {
.hostmode = 11,
.slave_endianness = 9,
.host_endianness = 10,
.have_ana_cfg = false,
};
static const struct ltq_rcu_usb2_bits xrx100_rcu_usb2_reg_bits = {
.hostmode = 11,
.slave_endianness = 17,
.host_endianness = 10,
.have_ana_cfg = false,
};
static const struct ltq_rcu_usb2_bits xrx200_rcu_usb2_reg_bits = {
.hostmode = 11,
.slave_endianness = 9,
.host_endianness = 10,
.have_ana_cfg = true,
};
static const struct of_device_id ltq_rcu_usb2_phy_of_match[] = {
{
.compatible = "lantiq,ase-usb2-phy",
.data = &xway_rcu_usb2_reg_bits,
},
{
.compatible = "lantiq,danube-usb2-phy",
.data = &xway_rcu_usb2_reg_bits,
},
{
.compatible = "lantiq,xrx100-usb2-phy",
.data = &xrx100_rcu_usb2_reg_bits,
},
{
.compatible = "lantiq,xrx200-usb2-phy",
.data = &xrx200_rcu_usb2_reg_bits,
},
{
.compatible = "lantiq,xrx300-usb2-phy",
.data = &xrx200_rcu_usb2_reg_bits,
},
{ },
};
MODULE_DEVICE_TABLE(of, ltq_rcu_usb2_phy_of_match);
static int ltq_rcu_usb2_phy_init(struct phy *phy)
{
struct ltq_rcu_usb2_priv *priv = phy_get_drvdata(phy);
if (priv->reg_bits->have_ana_cfg) {
regmap_update_bits(priv->regmap, priv->ana_cfg1_reg_offset,
RCU_CFG1_TX_PEE, RCU_CFG1_TX_PEE);
regmap_update_bits(priv->regmap, priv->ana_cfg1_reg_offset,
RCU_CFG1_DIS_THR_MASK, 7 << RCU_CFG1_DIS_THR_SHIFT);
}
/* Configure core to host mode */
regmap_update_bits(priv->regmap, priv->phy_reg_offset,
BIT(priv->reg_bits->hostmode), 0);
/* Select DMA endianness (Host-endian: big-endian) */
regmap_update_bits(priv->regmap, priv->phy_reg_offset,
BIT(priv->reg_bits->slave_endianness), 0);
regmap_update_bits(priv->regmap, priv->phy_reg_offset,
BIT(priv->reg_bits->host_endianness),
BIT(priv->reg_bits->host_endianness));
return 0;
}
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/mfd/syscon.h`, `linux/module.h`, `linux/of.h`, `linux/of_address.h`, `linux/phy/phy.h`, `linux/platform_device.h`.
- Detected declarations: `struct ltq_rcu_usb2_bits`, `struct ltq_rcu_usb2_priv`, `function ltq_rcu_usb2_phy_init`, `function ltq_rcu_usb2_phy_power_on`, `function ltq_rcu_usb2_phy_power_off`, `function ltq_rcu_usb2_of_parse`, `function ltq_rcu_usb2_phy_probe`.
- 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.