drivers/soc/qcom/pmic_glink_altmode.c
Source file repositories/reference/linux-study-clean/drivers/soc/qcom/pmic_glink_altmode.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/soc/qcom/pmic_glink_altmode.c- Extension
.c- Size
- 19656 bytes
- Lines
- 718
- Domain
- Driver Families
- Bucket
- drivers/soc
- 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/auxiliary_bus.hlinux/bitfield.hlinux/cleanup.hlinux/module.hlinux/of.hlinux/of_device.hlinux/mutex.hlinux/property.hlinux/soc/qcom/pdr.hdrm/bridge/aux-bridge.hlinux/usb/pd.hlinux/usb/typec_altmode.hlinux/usb/typec_dp.hlinux/usb/typec_mux.hlinux/usb/typec_retimer.hlinux/usb/typec_tbt.hlinux/soc/qcom/pmic_glink.h
Detected Declarations
struct usbc_write_reqstruct usbc_sc8280x_dp_datastruct usbc_sc8280x_tbt_datastruct usbc_notifystruct usbc_sc8180x_notifystruct pmic_glink_altmodestruct pmic_glink_altmode_portstruct pmic_glink_altmodeenum pmic_glink_altmode_pin_assignmentfunction pmic_glink_altmode_requestfunction pmic_glink_altmode_enable_dpfunction pmic_glink_altmode_enable_tbtfunction pmic_glink_altmode_enable_usb4function pmic_glink_altmode_enable_usbfunction pmic_glink_altmode_safefunction pmic_glink_altmode_workerfunction pmic_glink_altmode_orientationfunction pmic_glink_altmode_sc8180xp_notifyfunction pmic_glink_altmode_sc8280xp_notifyfunction pmic_glink_altmode_callbackfunction pmic_glink_altmode_put_retimerfunction pmic_glink_altmode_put_muxfunction pmic_glink_altmode_put_switchfunction pmic_glink_altmode_enable_workerfunction pmic_glink_altmode_pdr_notifyfunction pmic_glink_altmode_probefunction device_for_each_child_node
Annotated Snippet
struct usbc_write_req {
struct pmic_glink_hdr hdr;
__le32 cmd;
__le32 arg;
__le32 reserved;
};
struct usbc_sc8280x_dp_data {
u8 pin_assignment : 6;
u8 hpd_state : 1;
u8 hpd_irq : 1;
u8 res[7];
};
/* Used for both TBT and USB4 notifications */
struct usbc_sc8280x_tbt_data {
u8 usb_speed : 3;
u8 cable_type : 3;
/* This field is NOP on USB4, all cables support rounded rates by spec */
u8 rounded_cable : 1;
u8 power_limited : 1;
u8 res[11];
};
struct usbc_notify {
struct pmic_glink_hdr hdr;
u8 port_idx;
u8 orientation;
u8 mux_ctrl;
#define MUX_CTRL_STATE_NO_CONN 0
#define MUX_CTRL_STATE_USB3_ONLY 1
#define MUX_CTRL_STATE_DP4LN 2
#define MUX_CTRL_STATE_USB3_DP 3
#define MUX_CTRL_STATE_TUNNELING 4
u8 res;
__le16 vid;
__le16 svid;
union usbc_sc8280x_extended_data {
struct usbc_sc8280x_dp_data dp;
struct usbc_sc8280x_tbt_data tbt;
} extended_data;
};
struct usbc_sc8180x_notify {
struct pmic_glink_hdr hdr;
__le32 notification;
__le32 reserved[2];
};
enum pmic_glink_altmode_pin_assignment {
DPAM_HPD_OUT,
DPAM_HPD_A,
DPAM_HPD_B,
DPAM_HPD_C,
DPAM_HPD_D,
DPAM_HPD_E,
DPAM_HPD_F,
};
struct pmic_glink_altmode;
#define work_to_altmode_port(w) container_of((w), struct pmic_glink_altmode_port, work)
struct pmic_glink_altmode_port {
struct pmic_glink_altmode *altmode;
unsigned int index;
struct typec_switch *typec_switch;
struct typec_mux *typec_mux;
struct typec_mux_state state;
struct typec_retimer *typec_retimer;
struct typec_retimer_state retimer_state;
struct typec_altmode dp_alt;
struct typec_altmode tbt_alt;
struct work_struct work;
struct auxiliary_device *bridge;
enum typec_orientation orientation;
u16 svid;
struct usbc_sc8280x_tbt_data tbt_data;
u8 dp_data;
u8 mode;
u8 hpd_state;
u8 hpd_irq;
u8 mux_ctrl;
};
Annotation
- Immediate include surface: `linux/auxiliary_bus.h`, `linux/bitfield.h`, `linux/cleanup.h`, `linux/module.h`, `linux/of.h`, `linux/of_device.h`, `linux/mutex.h`, `linux/property.h`.
- Detected declarations: `struct usbc_write_req`, `struct usbc_sc8280x_dp_data`, `struct usbc_sc8280x_tbt_data`, `struct usbc_notify`, `struct usbc_sc8180x_notify`, `struct pmic_glink_altmode`, `struct pmic_glink_altmode_port`, `struct pmic_glink_altmode`, `enum pmic_glink_altmode_pin_assignment`, `function pmic_glink_altmode_request`.
- Atlas domain: Driver Families / drivers/soc.
- 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.