include/linux/usb/typec_mux.h
Source file repositories/reference/linux-study-clean/include/linux/usb/typec_mux.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/usb/typec_mux.h- Extension
.h- Size
- 3659 bytes
- Lines
- 145
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/err.hlinux/property.hlinux/usb/typec.h
Detected Declarations
struct devicestruct typec_muxstruct typec_mux_devstruct typec_switchstruct typec_switch_devstruct typec_altmodestruct fwnode_handlestruct typec_switch_descstruct typec_mux_statestruct typec_mux_descfunction fwnode_typec_switch_getfunction typec_switch_putfunction typec_switch_registerfunction typec_switch_unregisterfunction typec_mux_putfunction typec_mux_registerfunction typec_mux_unregister
Annotated Snippet
struct typec_switch_desc {
struct fwnode_handle *fwnode;
typec_switch_set_fn_t set;
const char *name;
void *drvdata;
};
#if IS_ENABLED(CONFIG_TYPEC)
struct typec_switch *fwnode_typec_switch_get(struct fwnode_handle *fwnode);
void typec_switch_put(struct typec_switch *sw);
int typec_switch_set(struct typec_switch *sw,
enum typec_orientation orientation);
struct typec_switch_dev *
typec_switch_register(struct device *parent,
const struct typec_switch_desc *desc);
void typec_switch_unregister(struct typec_switch_dev *sw);
void typec_switch_set_drvdata(struct typec_switch_dev *sw, void *data);
void *typec_switch_get_drvdata(struct typec_switch_dev *sw);
#else
static inline struct typec_switch *
fwnode_typec_switch_get(struct fwnode_handle *fwnode)
{
return NULL;
}
static inline void typec_switch_put(struct typec_switch *sw) {}
static inline int typec_switch_set(struct typec_switch *sw,
enum typec_orientation orientation)
{
return 0;
}
static inline struct typec_switch_dev *
typec_switch_register(struct device *parent,
const struct typec_switch_desc *desc)
{
return ERR_PTR(-EOPNOTSUPP);
}
static inline void typec_switch_unregister(struct typec_switch_dev *sw) {}
static inline void typec_switch_set_drvdata(struct typec_switch_dev *sw, void *data) {}
static inline void *typec_switch_get_drvdata(struct typec_switch_dev *sw)
{
return ERR_PTR(-EOPNOTSUPP);
}
#endif /* CONFIG_TYPEC */
static inline struct typec_switch *typec_switch_get(struct device *dev)
{
return fwnode_typec_switch_get(dev_fwnode(dev));
}
struct typec_mux_state {
struct typec_altmode *alt;
unsigned long mode;
void *data;
};
typedef int (*typec_mux_set_fn_t)(struct typec_mux_dev *mux,
struct typec_mux_state *state);
struct typec_mux_desc {
struct fwnode_handle *fwnode;
typec_mux_set_fn_t set;
const char *name;
void *drvdata;
};
#if IS_ENABLED(CONFIG_TYPEC)
struct typec_mux *fwnode_typec_mux_get(struct fwnode_handle *fwnode);
void typec_mux_put(struct typec_mux *mux);
int typec_mux_set(struct typec_mux *mux, struct typec_mux_state *state);
struct typec_mux_dev *
typec_mux_register(struct device *parent, const struct typec_mux_desc *desc);
void typec_mux_unregister(struct typec_mux_dev *mux);
void typec_mux_set_drvdata(struct typec_mux_dev *mux, void *data);
void *typec_mux_get_drvdata(struct typec_mux_dev *mux);
#else
Annotation
- Immediate include surface: `linux/err.h`, `linux/property.h`, `linux/usb/typec.h`.
- Detected declarations: `struct device`, `struct typec_mux`, `struct typec_mux_dev`, `struct typec_switch`, `struct typec_switch_dev`, `struct typec_altmode`, `struct fwnode_handle`, `struct typec_switch_desc`, `struct typec_mux_state`, `struct typec_mux_desc`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.