drivers/platform/chrome/cros_ec_typec.h
Source file repositories/reference/linux-study-clean/drivers/platform/chrome/cros_ec_typec.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/chrome/cros_ec_typec.h- Extension
.h- Size
- 2311 bytes
- Lines
- 88
- Domain
- Driver Families
- Bucket
- drivers/platform
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/list.hlinux/notifier.hlinux/platform_data/cros_ec_proto.hlinux/usb/pd.hlinux/usb/role.hlinux/usb/typec.hlinux/usb/typec_altmode.hlinux/usb/typec_mux.hlinux/usb/typec_retimer.hlinux/workqueue.h
Detected Declarations
struct cros_typec_altmode_nodestruct cros_typec_datastruct cros_typec_port
Annotated Snippet
struct cros_typec_altmode_node {
struct typec_altmode *amode;
struct list_head list;
};
/* Platform-specific data for the Chrome OS EC Type C controller. */
struct cros_typec_data {
struct device *dev;
struct cros_ec_device *ec;
int num_ports;
unsigned int pd_ctrl_ver;
/* Array of ports, indexed by port number. */
struct cros_typec_port *ports[EC_USB_PD_MAX_PORTS];
struct notifier_block nb;
struct work_struct port_work;
bool typec_cmd_supported;
bool needs_mux_ack;
bool ap_driven_altmode;
};
/* Per port data. */
struct cros_typec_port {
struct typec_port *port;
int port_num;
/* Initial capabilities for the port. */
struct typec_capability caps;
struct typec_partner *partner;
struct typec_cable *cable;
/* SOP' plug. */
struct typec_plug *plug;
/* Port partner PD identity info. */
struct usb_pd_identity p_identity;
/* Port cable PD identity info. */
struct usb_pd_identity c_identity;
struct typec_switch *ori_sw;
struct typec_mux *mux;
struct typec_retimer *retimer;
struct usb_role_switch *role_sw;
/* Variables keeping track of switch state. */
struct typec_mux_state state;
uint8_t mux_flags;
uint8_t role;
struct typec_altmode *port_altmode[CROS_EC_ALTMODE_MAX];
/* Flag indicating that PD partner discovery data parsing is completed. */
bool sop_disc_done;
bool sop_prime_disc_done;
struct ec_response_typec_discovery *disc_data;
struct list_head partner_mode_list;
struct list_head plug_mode_list;
/* PDO-related structs */
struct usb_power_delivery *partner_pd;
struct usb_power_delivery_capabilities *partner_src_caps;
struct usb_power_delivery_capabilities *partner_sink_caps;
struct cros_typec_data *typec_data;
};
#endif /* __CROS_EC_TYPEC__ */
Annotation
- Immediate include surface: `linux/list.h`, `linux/notifier.h`, `linux/platform_data/cros_ec_proto.h`, `linux/usb/pd.h`, `linux/usb/role.h`, `linux/usb/typec.h`, `linux/usb/typec_altmode.h`, `linux/usb/typec_mux.h`.
- Detected declarations: `struct cros_typec_altmode_node`, `struct cros_typec_data`, `struct cros_typec_port`.
- Atlas domain: Driver Families / drivers/platform.
- 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.