drivers/platform/x86/dell/dell-wmi-ddv.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/dell/dell-wmi-ddv.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/dell/dell-wmi-ddv.c- Extension
.c- Size
- 28066 bytes
- Lines
- 1124
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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
linux/acpi.hlinux/bitfield.hlinux/debugfs.hlinux/device.hlinux/device/driver.hlinux/dev_printk.hlinux/errno.hlinux/kconfig.hlinux/kernel.hlinux/hwmon.hlinux/kstrtox.hlinux/math64.hlinux/module.hlinux/mutex.hlinux/limits.hlinux/pm.hlinux/power_supply.hlinux/printk.hlinux/seq_file.hlinux/sysfs.hlinux/types.hlinux/wmi.hacpi/battery.hlinux/unaligned.h
Detected Declarations
struct fan_sensor_entrystruct thermal_sensor_entrystruct combined_channel_infostruct combined_chip_infostruct dell_wmi_ddv_sensorsstruct dell_wmi_ddv_dataenum dell_ddv_methodfunction dell_wmi_ddv_query_typefunction dell_wmi_ddv_query_integerfunction dell_wmi_ddv_query_bufferfunction dell_wmi_ddv_query_stringfunction dell_wmi_ddv_update_sensorsfunction dell_wmi_ddv_is_visiblefunction dell_wmi_ddv_fan_read_channelfunction dell_wmi_ddv_temp_read_channelfunction dell_wmi_ddv_readfunction dell_wmi_ddv_fan_read_stringfunction dell_wmi_ddv_temp_read_stringfunction dell_wmi_ddv_read_stringfunction dell_wmi_ddv_hwmon_cache_invalidatefunction dell_wmi_ddv_hwmon_cache_destroyfunction dell_wmi_ddv_hwmon_addfunction dell_wmi_ddv_battery_translatefunction dell_wmi_battery_invalidatefunction eppid_showfunction dell_wmi_ddv_get_healthfunction dell_wmi_ddv_get_manufacture_datefunction dell_wmi_ddv_get_propertyfunction dell_wmi_ddv_add_batteryfunction dell_wmi_ddv_remove_batteryfunction dell_wmi_ddv_battery_addfunction dell_wmi_ddv_buffer_readfunction dell_wmi_ddv_fan_readfunction dell_wmi_ddv_temp_readfunction dell_wmi_ddv_debugfs_removefunction dell_wmi_ddv_debugfs_initfunction dell_wmi_ddv_probefunction dell_wmi_ddv_resume
Annotated Snippet
struct fan_sensor_entry {
u8 type;
__le16 rpm;
} __packed;
struct thermal_sensor_entry {
u8 type;
s8 now;
s8 min;
s8 max;
u8 unknown;
} __packed;
struct combined_channel_info {
struct hwmon_channel_info info;
u32 config[];
};
struct combined_chip_info {
struct hwmon_chip_info chip;
const struct hwmon_channel_info *info[];
};
struct dell_wmi_ddv_sensors {
bool active;
struct mutex lock; /* protect caching */
unsigned long timestamp;
union acpi_object *obj;
u64 entries;
};
struct dell_wmi_ddv_data {
struct acpi_battery_hook hook;
struct device_attribute eppid_attr;
struct mutex translation_cache_lock; /* Protects the translation cache */
struct power_supply *translation_cache[DELL_DDV_NUM_BATTERIES];
struct dell_wmi_ddv_sensors fans;
struct dell_wmi_ddv_sensors temps;
struct wmi_device *wdev;
};
static const char * const fan_labels[] = {
"CPU Fan",
"Chassis Motherboard Fan",
"Video Fan",
"Power Supply Fan",
"Chipset Fan",
"Memory Fan",
"PCI Fan",
"HDD Fan",
};
static const char * const fan_dock_labels[] = {
"Docking Chassis/Motherboard Fan",
"Docking Video Fan",
"Docking Power Supply Fan",
"Docking Chipset Fan",
};
static int dell_wmi_ddv_query_type(struct wmi_device *wdev, enum dell_ddv_method method, u32 arg,
union acpi_object **result, acpi_object_type type)
{
struct acpi_buffer out = { ACPI_ALLOCATE_BUFFER, NULL };
const struct acpi_buffer in = {
.length = sizeof(arg),
.pointer = &arg,
};
union acpi_object *obj;
acpi_status ret;
ret = wmidev_evaluate_method(wdev, 0x0, method, &in, &out);
if (ACPI_FAILURE(ret))
return -EIO;
obj = out.pointer;
if (!obj)
return -ENODATA;
if (obj->type != type) {
kfree(obj);
return -ENOMSG;
}
*result = obj;
return 0;
}
static int dell_wmi_ddv_query_integer(struct wmi_device *wdev, enum dell_ddv_method method,
u32 arg, u32 *res)
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/bitfield.h`, `linux/debugfs.h`, `linux/device.h`, `linux/device/driver.h`, `linux/dev_printk.h`, `linux/errno.h`, `linux/kconfig.h`.
- Detected declarations: `struct fan_sensor_entry`, `struct thermal_sensor_entry`, `struct combined_channel_info`, `struct combined_chip_info`, `struct dell_wmi_ddv_sensors`, `struct dell_wmi_ddv_data`, `enum dell_ddv_method`, `function dell_wmi_ddv_query_type`, `function dell_wmi_ddv_query_integer`, `function dell_wmi_ddv_query_buffer`.
- Atlas domain: Driver Families / drivers/platform.
- Implementation status: source 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.