drivers/firmware/arm_scmi/pinctrl.c
Source file repositories/reference/linux-study-clean/drivers/firmware/arm_scmi/pinctrl.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/firmware/arm_scmi/pinctrl.c- Extension
.c- Size
- 21369 bytes
- Lines
- 900
- Domain
- Driver Families
- Bucket
- drivers/firmware
- 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
asm/byteorder.hlinux/bits.hlinux/bitfield.hlinux/device.hlinux/module.hlinux/scmi_protocol.hlinux/slab.hlinux/string.hlinux/types.hcommon.hprotocols.h
Detected Declarations
struct scmi_msg_settings_confstruct scmi_msg_settings_getstruct scmi_resp_settings_getstruct scmi_msg_pinctrl_protocol_attributesstruct scmi_msg_pinctrl_attributesstruct scmi_resp_pinctrl_attributesstruct scmi_msg_pinctrl_list_assocstruct scmi_resp_pinctrl_list_assocstruct scmi_msg_requeststruct scmi_group_infostruct scmi_function_infostruct scmi_pin_infostruct scmi_pinctrl_infostruct scmi_pinctrl_iprivstruct scmi_settings_get_iprivenum scmi_pinctrl_protocol_cmdfunction scmi_pinctrl_attributes_getfunction scmi_pinctrl_count_getfunction scmi_pinctrl_validate_idfunction scmi_pinctrl_attributesfunction iter_pinctrl_assoc_prepare_messagefunction iter_pinctrl_assoc_update_statefunction iter_pinctrl_assoc_process_responsefunction scmi_pinctrl_list_associationsfunction iter_pinctrl_settings_get_prepare_messagefunction iter_pinctrl_settings_get_update_statefunction iter_pinctrl_settings_get_process_responsefunction scmi_pinctrl_settings_getfunction scmi_pinctrl_settings_get_onefunction scmi_pinctrl_settings_get_allfunction scmi_pinctrl_settings_conffunction scmi_pinctrl_function_selectfunction scmi_pinctrl_request_freefunction scmi_pinctrl_pin_requestfunction scmi_pinctrl_pin_freefunction scmi_pinctrl_get_group_infofunction scmi_pinctrl_get_group_namefunction scmi_pinctrl_group_pins_getfunction scmi_pinctrl_get_function_infofunction scmi_pinctrl_get_function_namefunction scmi_pinctrl_function_groups_getfunction scmi_pinctrl_mux_setfunction scmi_pinctrl_get_pin_infofunction scmi_pinctrl_get_pin_namefunction scmi_pinctrl_name_getfunction scmi_pinctrl_protocol_initfunction scmi_pinctrl_protocol_deinit
Annotated Snippet
struct scmi_msg_settings_conf {
__le32 identifier;
__le32 function_id;
__le32 attributes;
__le32 configs[];
};
struct scmi_msg_settings_get {
__le32 identifier;
__le32 attributes;
};
struct scmi_resp_settings_get {
__le32 function_selected;
__le32 num_configs;
__le32 configs[];
};
struct scmi_msg_pinctrl_protocol_attributes {
__le32 attributes_low;
__le32 attributes_high;
};
struct scmi_msg_pinctrl_attributes {
__le32 identifier;
__le32 flags;
};
struct scmi_resp_pinctrl_attributes {
__le32 attributes;
u8 name[SCMI_SHORT_NAME_MAX_SIZE];
};
struct scmi_msg_pinctrl_list_assoc {
__le32 identifier;
__le32 flags;
__le32 index;
};
struct scmi_resp_pinctrl_list_assoc {
__le32 flags;
__le16 array[];
};
struct scmi_msg_request {
__le32 identifier;
__le32 flags;
};
struct scmi_group_info {
char name[SCMI_MAX_STR_SIZE];
bool present;
u32 *group_pins;
u32 nr_pins;
};
struct scmi_function_info {
char name[SCMI_MAX_STR_SIZE];
bool present;
u32 *groups;
u32 nr_groups;
};
struct scmi_pin_info {
char name[SCMI_MAX_STR_SIZE];
bool present;
};
struct scmi_pinctrl_info {
int nr_groups;
int nr_functions;
int nr_pins;
struct scmi_group_info *groups;
struct scmi_function_info *functions;
struct scmi_pin_info *pins;
};
static int scmi_pinctrl_attributes_get(const struct scmi_protocol_handle *ph,
struct scmi_pinctrl_info *pi)
{
int ret;
struct scmi_xfer *t;
struct scmi_msg_pinctrl_protocol_attributes *attr;
ret = ph->xops->xfer_get_init(ph, PROTOCOL_ATTRIBUTES, 0, sizeof(*attr), &t);
if (ret)
return ret;
attr = t->rx.buf;
Annotation
- Immediate include surface: `asm/byteorder.h`, `linux/bits.h`, `linux/bitfield.h`, `linux/device.h`, `linux/module.h`, `linux/scmi_protocol.h`, `linux/slab.h`, `linux/string.h`.
- Detected declarations: `struct scmi_msg_settings_conf`, `struct scmi_msg_settings_get`, `struct scmi_resp_settings_get`, `struct scmi_msg_pinctrl_protocol_attributes`, `struct scmi_msg_pinctrl_attributes`, `struct scmi_resp_pinctrl_attributes`, `struct scmi_msg_pinctrl_list_assoc`, `struct scmi_resp_pinctrl_list_assoc`, `struct scmi_msg_request`, `struct scmi_group_info`.
- Atlas domain: Driver Families / drivers/firmware.
- 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.