drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c
Source file repositories/reference/linux-study-clean/drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/phy/qualcomm/phy-qcom-eusb2-repeater.c- Extension
.c- Size
- 8590 bytes
- Lines
- 338
- 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/module.hlinux/platform_device.hlinux/regulator/consumer.hlinux/regmap.hlinux/of.hlinux/phy/phy.h
Detected Declarations
struct eusb2_repeater_init_tbl_regstruct eusb2_repeater_cfgstruct eusb2_repeaterfunction eusb2_repeater_init_vregsfunction eusb2_repeater_initfunction eusb2_repeater_set_modefunction eusb2_repeater_exitfunction eusb2_repeater_probefunction eusb2_repeater_remove
Annotated Snippet
struct eusb2_repeater_init_tbl_reg {
unsigned int reg;
unsigned int value;
};
struct eusb2_repeater_cfg {
const struct eusb2_repeater_init_tbl_reg *init_tbl;
int init_tbl_num;
const char * const *vreg_list;
int num_vregs;
};
struct eusb2_repeater {
struct device *dev;
struct regmap *regmap;
struct phy *phy;
struct regulator_bulk_data *vregs;
const struct eusb2_repeater_cfg *cfg;
u32 base;
enum phy_mode mode;
};
static const char * const pm8550b_vreg_l[] = {
"vdd18", "vdd3",
};
static const struct eusb2_repeater_init_tbl_reg pm8550b_init_tbl[] = {
{ EUSB2_TUNE_IUSB2, 0x8 },
{ EUSB2_TUNE_SQUELCH_U, 0x3 },
{ EUSB2_TUNE_USB2_PREEM, 0x5 },
};
static const struct eusb2_repeater_init_tbl_reg smb2360_init_tbl[] = {
{ EUSB2_TUNE_IUSB2, 0x5 },
{ EUSB2_TUNE_SQUELCH_U, 0x3 },
{ EUSB2_TUNE_USB2_PREEM, 0x2 },
};
static const struct eusb2_repeater_init_tbl_reg smb2370_init_tbl[] = {
{ EUSB2_TUNE_IUSB2, 0x4 },
{ EUSB2_TUNE_SQUELCH_U, 0x3 },
{ EUSB2_TUNE_USB2_SLEW, 0x7 },
{ EUSB2_TUNE_USB2_PREEM, 0x0 },
};
static const struct eusb2_repeater_cfg pm8550b_eusb2_cfg = {
.init_tbl = pm8550b_init_tbl,
.init_tbl_num = ARRAY_SIZE(pm8550b_init_tbl),
.vreg_list = pm8550b_vreg_l,
.num_vregs = ARRAY_SIZE(pm8550b_vreg_l),
};
static const struct eusb2_repeater_cfg pmiv0104_eusb2_cfg = {
/* No PMIC-specific init sequence, only board level tuning via DT */
.init_tbl = (struct eusb2_repeater_init_tbl_reg[]) {},
.init_tbl_num = 0,
.vreg_list = pm8550b_vreg_l,
.num_vregs = ARRAY_SIZE(pm8550b_vreg_l),
};
static const struct eusb2_repeater_cfg smb2360_eusb2_cfg = {
.init_tbl = smb2360_init_tbl,
.init_tbl_num = ARRAY_SIZE(smb2360_init_tbl),
.vreg_list = pm8550b_vreg_l,
.num_vregs = ARRAY_SIZE(pm8550b_vreg_l),
};
static const struct eusb2_repeater_cfg smb2370_eusb2_cfg = {
.init_tbl = smb2370_init_tbl,
.init_tbl_num = ARRAY_SIZE(smb2370_init_tbl),
.vreg_list = pm8550b_vreg_l,
.num_vregs = ARRAY_SIZE(pm8550b_vreg_l),
};
static int eusb2_repeater_init_vregs(struct eusb2_repeater *rptr)
{
int num = rptr->cfg->num_vregs;
struct device *dev = rptr->dev;
int i;
rptr->vregs = devm_kcalloc(dev, num, sizeof(*rptr->vregs), GFP_KERNEL);
if (!rptr->vregs)
return -ENOMEM;
for (i = 0; i < num; i++)
rptr->vregs[i].supply = rptr->cfg->vreg_list[i];
return devm_regulator_bulk_get(dev, num, rptr->vregs);
}
Annotation
- Immediate include surface: `linux/module.h`, `linux/platform_device.h`, `linux/regulator/consumer.h`, `linux/regmap.h`, `linux/of.h`, `linux/phy/phy.h`.
- Detected declarations: `struct eusb2_repeater_init_tbl_reg`, `struct eusb2_repeater_cfg`, `struct eusb2_repeater`, `function eusb2_repeater_init_vregs`, `function eusb2_repeater_init`, `function eusb2_repeater_set_mode`, `function eusb2_repeater_exit`, `function eusb2_repeater_probe`, `function eusb2_repeater_remove`.
- 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.