drivers/platform/x86/lenovo/wmi-capdata.h
Source file repositories/reference/linux-study-clean/drivers/platform/x86/lenovo/wmi-capdata.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/lenovo/wmi-capdata.h- Extension
.h- Size
- 2336 bytes
- Lines
- 86
- 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/bits.hlinux/bitfield.hlinux/types.h
Detected Declarations
struct component_matchstruct devicestruct cd_liststruct capdata00struct capdata01struct capdata_fanstruct lwmi_cd_binderfunction lwmi_attr_id
Annotated Snippet
struct capdata00 {
u32 id;
u32 supported;
u32 default_value;
};
struct capdata01 {
u32 id;
u32 supported;
u32 default_value;
u32 step;
u32 min_value;
u32 max_value;
};
struct capdata_fan {
u32 id;
u32 min_rpm;
u32 max_rpm;
};
typedef void (*cd_list_cb_t)(struct device *master_dev, struct cd_list *cd_list);
struct lwmi_cd_binder {
struct cd_list *cd00_list;
struct cd_list *cd01_list;
/*
* May be called during or after the bind callback.
* Will be called with NULL if capdata_fan does not exist.
* The pointer is only valid in the callback; never keep it for later use!
*/
cd_list_cb_t cd_fan_list_cb;
};
/**
* lwmi_attr_id() - Formats a capability data attribute ID
* @dev_id: The u8 corresponding to the device ID.
* @feat_id: The u8 corresponding to the feature ID on the device.
* @mode_id: The u8 corresponding to the wmi-gamezone mode for set/get.
* @type_id: The u8 corresponding to the sub-device.
*
* Return: encoded capability data attribute ID.
*/
static inline u32 lwmi_attr_id(u8 dev_id, u8 feat_id, u8 mode_id, u8 type_id)
{
return (FIELD_PREP(LWMI_ATTR_DEV_ID_MASK, dev_id) |
FIELD_PREP(LWMI_ATTR_FEAT_ID_MASK, feat_id) |
FIELD_PREP(LWMI_ATTR_MODE_ID_MASK, mode_id) |
FIELD_PREP(LWMI_ATTR_TYPE_ID_MASK, type_id));
}
void lwmi_cd_match_add_all(struct device *master, struct component_match **matchptr);
int lwmi_cd00_get_data(struct cd_list *list, u32 attribute_id, struct capdata00 *output);
int lwmi_cd01_get_data(struct cd_list *list, u32 attribute_id, struct capdata01 *output);
int lwmi_cd_fan_get_data(struct cd_list *list, u32 attribute_id, struct capdata_fan *output);
#endif /* !_LENOVO_WMI_CAPDATA_H_ */
Annotation
- Immediate include surface: `linux/bits.h`, `linux/bitfield.h`, `linux/types.h`.
- Detected declarations: `struct component_match`, `struct device`, `struct cd_list`, `struct capdata00`, `struct capdata01`, `struct capdata_fan`, `struct lwmi_cd_binder`, `function lwmi_attr_id`.
- 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.