drivers/phy/rockchip/phy-rockchip-inno-usb2.c
Source file repositories/reference/linux-study-clean/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/phy/rockchip/phy-rockchip-inno-usb2.c- Extension
.c- Size
- 68725 bytes
- Lines
- 2318
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/clk-provider.hlinux/delay.hlinux/extcon-provider.hlinux/interrupt.hlinux/io.hlinux/gpio/consumer.hlinux/jiffies.hlinux/kernel.hlinux/module.hlinux/mutex.hlinux/of.hlinux/of_irq.hlinux/phy/phy.hlinux/platform_device.hlinux/power_supply.hlinux/regmap.hlinux/reset.hlinux/mfd/syscon.hlinux/usb/of.hlinux/usb/otg.h
Detected Declarations
struct rockchip_usb2phystruct usb2phy_regstruct rockchip_chg_det_regstruct rockchip_usb2phy_port_cfgstruct rockchip_usb2phy_cfgstruct rockchip_usb2phy_portstruct rockchip_usb2phyenum rockchip_usb2phy_port_idenum rockchip_usb2phy_host_stateenum usb_chg_statefunction property_enablefunction property_enabledfunction rockchip_usb2phy_resetfunction rockchip_usb2phy_clk_bulk_disablefunction rockchip_usb2phy_clk480m_preparefunction rockchip_usb2phy_clk480m_unpreparefunction rockchip_usb2phy_clk480m_preparedfunction rockchip_usb2phy_clk480m_recalc_ratefunction rockchip_usb2phy_clk480m_unregisterfunction rockchip_usb2phy_clk480m_registerfunction rockchip_usb2phy_extcon_registerfunction rockchip_usb2phy_enable_host_disc_irqfunction rockchip_usb2phy_initfunction rockchip_usb2phy_power_onfunction rockchip_usb2phy_power_offfunction rockchip_usb2phy_exitfunction rockchip_usb2phy_otg_sm_workfunction rockchip_chg_enable_dcdfunction rockchip_chg_enable_primary_detfunction rockchip_chg_enable_secondary_detfunction rockchip_chg_detect_workfunction rockchip_usb2phy_sm_workfunction rockchip_usb2phy_linestate_irqfunction rockchip_usb2phy_bvalid_irqfunction rockchip_usb2phy_id_irqfunction rockchip_usb2phy_otg_mux_irqfunction rockchip_usb2phy_host_disc_irqfunction rockchip_usb2phy_irqfunction rockchip_usb2phy_port_irq_initfunction rockchip_usb2phy_host_port_initfunction rockchip_otg_eventfunction rockchip_usb2phy_otg_port_initfunction rockchip_usb2phy_probefunction rk3128_usb2phy_tuningfunction rk3576_usb2phy_tuningfunction rk3588_usb2phy_tuning
Annotated Snippet
struct usb2phy_reg {
unsigned int offset;
unsigned int bitend;
unsigned int bitstart;
unsigned int disable;
unsigned int enable;
};
/**
* struct rockchip_chg_det_reg - usb charger detect registers
* @cp_det: charging port detected successfully.
* @dcp_det: dedicated charging port detected successfully.
* @dp_det: assert data pin connect successfully.
* @idm_sink_en: open dm sink curren.
* @idp_sink_en: open dp sink current.
* @idp_src_en: open dm source current.
* @rdm_pdwn_en: open dm pull down resistor.
* @vdm_src_en: open dm voltage source.
* @vdp_src_en: open dp voltage source.
* @opmode: utmi operational mode.
*/
struct rockchip_chg_det_reg {
struct usb2phy_reg cp_det;
struct usb2phy_reg dcp_det;
struct usb2phy_reg dp_det;
struct usb2phy_reg idm_sink_en;
struct usb2phy_reg idp_sink_en;
struct usb2phy_reg idp_src_en;
struct usb2phy_reg rdm_pdwn_en;
struct usb2phy_reg vdm_src_en;
struct usb2phy_reg vdp_src_en;
struct usb2phy_reg opmode;
};
/**
* struct rockchip_usb2phy_port_cfg - usb-phy port configuration.
* @phy_sus: phy suspend register.
* @bvalid_det_en: vbus valid rise detection enable register.
* @bvalid_det_st: vbus valid rise detection status register.
* @bvalid_det_clr: vbus valid rise detection clear register.
* @disfall_en: host disconnect fall edge detection enable.
* @disfall_st: host disconnect fall edge detection state.
* @disfall_clr: host disconnect fall edge detection clear.
* @disrise_en: host disconnect rise edge detection enable.
* @disrise_st: host disconnect rise edge detection state.
* @disrise_clr: host disconnect rise edge detection clear.
* @idfall_det_en: id detection enable register, falling edge
* @idfall_det_st: id detection state register, falling edge
* @idfall_det_clr: id detection clear register, falling edge
* @idrise_det_en: id detection enable register, rising edge
* @idrise_det_st: id detection state register, rising edge
* @idrise_det_clr: id detection clear register, rising edge
* @ls_det_en: linestate detection enable register.
* @ls_det_st: linestate detection state register.
* @ls_det_clr: linestate detection clear register.
* @utmi_avalid: utmi vbus avalid status register.
* @utmi_bvalid: utmi vbus bvalid status register.
* @utmi_id: utmi id state register.
* @utmi_ls: utmi linestate state register.
* @utmi_hstdet: utmi host disconnect register.
*/
struct rockchip_usb2phy_port_cfg {
struct usb2phy_reg phy_sus;
struct usb2phy_reg bvalid_det_en;
struct usb2phy_reg bvalid_det_st;
struct usb2phy_reg bvalid_det_clr;
struct usb2phy_reg disfall_en;
struct usb2phy_reg disfall_st;
struct usb2phy_reg disfall_clr;
struct usb2phy_reg disrise_en;
struct usb2phy_reg disrise_st;
struct usb2phy_reg disrise_clr;
struct usb2phy_reg idfall_det_en;
struct usb2phy_reg idfall_det_st;
struct usb2phy_reg idfall_det_clr;
struct usb2phy_reg idrise_det_en;
struct usb2phy_reg idrise_det_st;
struct usb2phy_reg idrise_det_clr;
struct usb2phy_reg ls_det_en;
struct usb2phy_reg ls_det_st;
struct usb2phy_reg ls_det_clr;
struct usb2phy_reg utmi_avalid;
struct usb2phy_reg utmi_bvalid;
struct usb2phy_reg utmi_id;
struct usb2phy_reg utmi_ls;
struct usb2phy_reg utmi_hstdet;
};
/**
* struct rockchip_usb2phy_cfg - usb-phy configuration.
Annotation
- Immediate include surface: `linux/clk.h`, `linux/clk-provider.h`, `linux/delay.h`, `linux/extcon-provider.h`, `linux/interrupt.h`, `linux/io.h`, `linux/gpio/consumer.h`, `linux/jiffies.h`.
- Detected declarations: `struct rockchip_usb2phy`, `struct usb2phy_reg`, `struct rockchip_chg_det_reg`, `struct rockchip_usb2phy_port_cfg`, `struct rockchip_usb2phy_cfg`, `struct rockchip_usb2phy_port`, `struct rockchip_usb2phy`, `enum rockchip_usb2phy_port_id`, `enum rockchip_usb2phy_host_state`, `enum usb_chg_state`.
- Atlas domain: Driver Families / drivers/phy.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.