drivers/hwmon/occ/common.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/occ/common.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/occ/common.c- Extension
.c- Size
- 27633 bytes
- Lines
- 1208
- Domain
- Driver Families
- Bucket
- drivers/hwmon
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/export.hlinux/hwmon.hlinux/hwmon-sysfs.hlinux/jiffies.hlinux/kernel.hlinux/math64.hlinux/module.hlinux/mutex.hlinux/property.hlinux/sysfs.hlinux/unaligned.hcommon.h
Detected Declarations
struct temp_sensor_1struct temp_sensor_2struct temp_sensor_10struct freq_sensor_1struct freq_sensor_2struct power_sensor_1struct power_sensor_2struct power_sensor_datastruct power_sensor_data_and_timestruct power_sensor_a0struct caps_sensor_2struct caps_sensor_3struct extended_sensorfunction occ_pollfunction occ_set_user_power_capfunction occ_update_responsefunction occ_show_temp_1function occ_show_temp_2function occ_show_temp_10function occ_show_freq_1function occ_show_freq_2function occ_get_powr_avgfunction occ_show_power_1function occ_show_power_2function occ_show_power_a0function occ_show_caps_1_2function occ_show_caps_3function occ_store_caps_userfunction occ_show_extendedfunction occ_init_attributefunction occ_setup_sensor_attrsfunction occ_parse_poll_responsefunction occ_activefunction occ_setupfunction occ_shutdownexport occ_setupexport occ_shutdown
Annotated Snippet
struct temp_sensor_1 {
u16 sensor_id;
u16 value;
} __packed;
struct temp_sensor_2 {
u32 sensor_id;
u8 fru_type;
u8 value;
} __packed;
struct temp_sensor_10 {
u32 sensor_id;
u8 fru_type;
u8 value;
u8 throttle;
u8 reserved;
} __packed;
struct freq_sensor_1 {
u16 sensor_id;
u16 value;
} __packed;
struct freq_sensor_2 {
u32 sensor_id;
u16 value;
} __packed;
struct power_sensor_1 {
u16 sensor_id;
u32 update_tag;
u32 accumulator;
u16 value;
} __packed;
struct power_sensor_2 {
u32 sensor_id;
u8 function_id;
u8 apss_channel;
u16 reserved;
u32 update_tag;
u64 accumulator;
u16 value;
} __packed;
struct power_sensor_data {
u16 value;
u32 update_tag;
u64 accumulator;
} __packed;
struct power_sensor_data_and_time {
u16 update_time;
u16 value;
u32 update_tag;
u64 accumulator;
} __packed;
struct power_sensor_a0 {
u32 sensor_id;
struct power_sensor_data_and_time system;
u32 reserved;
struct power_sensor_data_and_time proc;
struct power_sensor_data vdd;
struct power_sensor_data vdn;
} __packed;
struct caps_sensor_2 {
u16 cap;
u16 system_power;
u16 n_cap;
u16 max;
u16 min;
u16 user;
u8 user_source;
} __packed;
struct caps_sensor_3 {
u16 cap;
u16 system_power;
u16 n_cap;
u16 max;
u16 hard_min;
u16 soft_min;
u16 user;
u8 user_source;
} __packed;
struct extended_sensor {
Annotation
- Immediate include surface: `linux/device.h`, `linux/export.h`, `linux/hwmon.h`, `linux/hwmon-sysfs.h`, `linux/jiffies.h`, `linux/kernel.h`, `linux/math64.h`, `linux/module.h`.
- Detected declarations: `struct temp_sensor_1`, `struct temp_sensor_2`, `struct temp_sensor_10`, `struct freq_sensor_1`, `struct freq_sensor_2`, `struct power_sensor_1`, `struct power_sensor_2`, `struct power_sensor_data`, `struct power_sensor_data_and_time`, `struct power_sensor_a0`.
- Atlas domain: Driver Families / drivers/hwmon.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.