drivers/phy/intel/phy-intel-keembay-usb.c
Source file repositories/reference/linux-study-clean/drivers/phy/intel/phy-intel-keembay-usb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/phy/intel/phy-intel-keembay-usb.c- Extension
.c- Size
- 7633 bytes
- Lines
- 302
- 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/bits.hlinux/clk.hlinux/delay.hlinux/mod_devicetable.hlinux/module.hlinux/phy/phy.hlinux/platform_device.hlinux/regmap.h
Detected Declarations
struct keembay_usb_phyfunction keembay_usb_clocks_onfunction keembay_usb_core_offfunction keembay_usb_core_onfunction keembay_usb_phys_onfunction keembay_usb_phy_initfunction keembay_usb_phy_probe
Annotated Snippet
struct keembay_usb_phy {
struct device *dev;
struct regmap *regmap_cpr;
struct regmap *regmap_slv;
};
static const struct regmap_config keembay_regmap_config = {
.reg_bits = 32,
.val_bits = 32,
.reg_stride = 4,
.max_register = USS_USB_TIEOFFS_CONSTANTS_REG1,
};
static int keembay_usb_clocks_on(struct keembay_usb_phy *priv)
{
int ret;
ret = regmap_update_bits(priv->regmap_cpr, USS_CPR_CLK_SET,
USS_CPR_MASK, USS_CPR_MASK);
if (ret) {
dev_err(priv->dev, "error clock set: %d\n", ret);
return ret;
}
ret = regmap_update_bits(priv->regmap_cpr, USS_CPR_RST_SET,
USS_CPR_MASK, USS_CPR_MASK);
if (ret) {
dev_err(priv->dev, "error reset set: %d\n", ret);
return ret;
}
ret = regmap_update_bits(priv->regmap_slv,
USS_USB_TIEOFFS_CONSTANTS_REG1,
IDDQ_ENABLE_MASK,
FIELD_PREP(IDDQ_ENABLE_MASK, 0));
if (ret) {
dev_err(priv->dev, "error iddq disable: %d\n", ret);
return ret;
}
/* Wait 30us to ensure all analog blocks are powered up. */
usleep_range(30, 60);
ret = regmap_update_bits(priv->regmap_slv, USS_USB_PHY_CFG0,
PHY_REF_USE_PAD_MASK,
FIELD_PREP(PHY_REF_USE_PAD_MASK, 1));
if (ret)
dev_err(priv->dev, "error ref clock select: %d\n", ret);
return ret;
}
static int keembay_usb_core_off(struct keembay_usb_phy *priv)
{
int ret;
ret = regmap_update_bits(priv->regmap_slv, USS_USB_CTRL_CFG0,
VCC_RESET_N_MASK,
FIELD_PREP(VCC_RESET_N_MASK, 0));
if (ret)
dev_err(priv->dev, "error core reset: %d\n", ret);
return ret;
}
static int keembay_usb_core_on(struct keembay_usb_phy *priv)
{
int ret;
ret = regmap_update_bits(priv->regmap_slv, USS_USB_CTRL_CFG0,
VCC_RESET_N_MASK,
FIELD_PREP(VCC_RESET_N_MASK, 1));
if (ret)
dev_err(priv->dev, "error core on: %d\n", ret);
return ret;
}
static int keembay_usb_phys_on(struct keembay_usb_phy *priv)
{
int ret;
ret = regmap_update_bits(priv->regmap_slv, USS_USB_PHY_CFG0,
POR_MASK | PHY_RESET_MASK,
FIELD_PREP(POR_MASK | PHY_RESET_MASK, 0));
if (ret)
dev_err(priv->dev, "error phys on: %d\n", ret);
return ret;
}
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bits.h`, `linux/clk.h`, `linux/delay.h`, `linux/mod_devicetable.h`, `linux/module.h`, `linux/phy/phy.h`, `linux/platform_device.h`.
- Detected declarations: `struct keembay_usb_phy`, `function keembay_usb_clocks_on`, `function keembay_usb_core_off`, `function keembay_usb_core_on`, `function keembay_usb_phys_on`, `function keembay_usb_phy_init`, `function keembay_usb_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.