drivers/usb/typec/retimer.c
Source file repositories/reference/linux-study-clean/drivers/usb/typec/retimer.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/typec/retimer.c- Extension
.c- Size
- 4334 bytes
- Lines
- 161
- Domain
- Driver Families
- Bucket
- drivers/usb
- 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.
- 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/device.hlinux/list.hlinux/module.hlinux/mutex.hlinux/property.hlinux/slab.hclass.hretimer.h
Detected Declarations
function retimer_fwnode_matchfunction typec_retimer_putfunction typec_retimer_setfunction typec_retimer_releasefunction typec_retimer_registerfunction typec_retimer_registerexport fwnode_typec_retimer_getexport typec_retimer_putexport typec_retimer_setexport typec_retimer_registerexport typec_retimer_unregisterexport typec_retimer_get_drvdata
Annotated Snippet
ret = device_add(&retimer->dev);
if (ret) {
dev_err(parent, "failed to register retimer (%d)\n", ret);
put_device(&retimer->dev);
return ERR_PTR(ret);
}
return retimer;
}
EXPORT_SYMBOL_GPL(typec_retimer_register);
/**
* typec_retimer_unregister - Unregister retimer device.
* @retimer: USB Type-C Connector retimer.
*
* Unregister retimer that was registered with typec_retimer_register().
*/
void typec_retimer_unregister(struct typec_retimer *retimer)
{
if (!IS_ERR_OR_NULL(retimer))
device_unregister(&retimer->dev);
}
EXPORT_SYMBOL_GPL(typec_retimer_unregister);
void *typec_retimer_get_drvdata(struct typec_retimer *retimer)
{
return dev_get_drvdata(&retimer->dev);
}
EXPORT_SYMBOL_GPL(typec_retimer_get_drvdata);
const struct class retimer_class = {
.name = "retimer",
};
Annotation
- Immediate include surface: `linux/device.h`, `linux/list.h`, `linux/module.h`, `linux/mutex.h`, `linux/property.h`, `linux/slab.h`, `class.h`, `retimer.h`.
- Detected declarations: `function retimer_fwnode_match`, `function typec_retimer_put`, `function typec_retimer_set`, `function typec_retimer_release`, `function typec_retimer_register`, `function typec_retimer_register`, `export fwnode_typec_retimer_get`, `export typec_retimer_put`, `export typec_retimer_set`, `export typec_retimer_register`.
- Atlas domain: Driver Families / drivers/usb.
- Implementation status: integration 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.