drivers/hid/amd-sfh-hid/amd_sfh_common.h
Source file repositories/reference/linux-study-clean/drivers/hid/amd-sfh-hid/amd_sfh_common.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/hid/amd-sfh-hid/amd_sfh_common.h- Extension
.h- Size
- 2880 bytes
- Lines
- 104
- Domain
- Driver Families
- Bucket
- drivers/hid
- 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/mutex.hlinux/pci.hamd_sfh_hid.h
Detected Declarations
struct amd_mp2_sensor_infostruct sfh_dev_statusstruct amd_mp2_devstruct amd_mp2_opsenum cmd_idfunction amd_get_c2p_valfunction amd_get_p2c_val
Annotated Snippet
struct amd_mp2_sensor_info {
u8 sensor_idx;
u32 period;
dma_addr_t dma_address;
};
struct sfh_dev_status {
bool is_hpd_present;
bool is_hpd_enabled;
bool is_als_present;
bool is_sra_present;
};
struct amd_mp2_dev {
struct pci_dev *pdev;
struct amdtp_cl_data *cl_data;
void __iomem *mmio;
void __iomem *vsbase;
const struct amd_sfh1_1_ops *sfh1_1_ops;
struct amd_mp2_ops *mp2_ops;
struct amd_input_data in_data;
/* mp2 active control status */
u32 mp2_acs;
struct sfh_dev_status dev_en;
struct work_struct work;
/* mp2 to protect data */
struct mutex lock;
u8 init_done;
u8 rver;
};
struct amd_mp2_ops {
void (*start)(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info);
void (*stop)(struct amd_mp2_dev *privdata, u16 sensor_idx);
void (*stop_all)(struct amd_mp2_dev *privdata);
int (*response)(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_sts);
void (*clear_intr)(struct amd_mp2_dev *privdata);
int (*init_intr)(struct amd_mp2_dev *privdata);
int (*discovery_status)(struct amd_mp2_dev *privdata);
void (*suspend)(struct amd_mp2_dev *mp2);
void (*resume)(struct amd_mp2_dev *mp2);
void (*remove)(void *privdata);
int (*get_rep_desc)(int sensor_idx, u8 rep_desc[]);
u32 (*get_desc_sz)(int sensor_idx, int descriptor_name);
u8 (*get_feat_rep)(int sensor_idx, int report_id, u8 *feature_report);
u8 (*get_in_rep)(u8 current_index, int sensor_idx, int report_id,
struct amd_input_data *in_data);
};
void amd_sfh_work(struct work_struct *work);
void amd_sfh_work_buffer(struct work_struct *work);
void amd_sfh_clear_intr_v2(struct amd_mp2_dev *privdata);
int amd_sfh_irq_init_v2(struct amd_mp2_dev *privdata);
void amd_sfh_clear_intr(struct amd_mp2_dev *privdata);
int amd_sfh_irq_init(struct amd_mp2_dev *privdata);
static inline u64 amd_get_c2p_val(struct amd_mp2_dev *mp2, u32 idx)
{
return mp2->rver == 1 ? AMD_C2P_MSG_V1(idx) : AMD_C2P_MSG(idx);
}
static inline u64 amd_get_p2c_val(struct amd_mp2_dev *mp2, u32 idx)
{
return mp2->rver == 1 ? AMD_P2C_MSG_V1(idx) : AMD_P2C_MSG(idx);
}
#endif
Annotation
- Immediate include surface: `linux/mutex.h`, `linux/pci.h`, `amd_sfh_hid.h`.
- Detected declarations: `struct amd_mp2_sensor_info`, `struct sfh_dev_status`, `struct amd_mp2_dev`, `struct amd_mp2_ops`, `enum cmd_id`, `function amd_get_c2p_val`, `function amd_get_p2c_val`.
- Atlas domain: Driver Families / drivers/hid.
- 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.