lwmi_om_fan_get_set(9)
π lwmi_om_fan_get_set β a Kernel API Manual moment β¨
okay so bestie, welcome to the lwmi_om_fan_get_set(9) page, straight out of the Kernel API Manual β¨ this one's short and sweet and honestly it's giving "little function, big job" energy π
πΈ NAME πΈ
lwmi_om_fan_get_set β literally just: get the fan RPM, or set the fan RPM, for whichever fan you point at π
β¨ SYNOPSIS β¨
int lwmi_om_fan_get_set (struct lwmi_om_priv *priv , int channel , u32 *val , bool set );
like, that's the whole signature, no cap π
π ARGUMENTS π
privβ the driver's private data structure. the backstage pass, the VIP lanyard, the whole personality holder π«Άchannelβ which fan we're talking about. it's a fan channel index and yes it's 0-based, so the first one is0, not1, okay bestie πvalβ a pointer to the value. it's an input when you're setting, and an output when you're getting. one pointer, two jobs, main character energy πsetβtrueto set the value,falseto get the value. that's it, that's the switch π
π¦ DESCRIPTION π¦
so what actually happens? the function talks to the WMI interface and does one of two things: either it retrieves the current fan RPM, or it sets the target fan RPM. that's the entire vibe check π₯
which one you get depends on that set bool β true means you're pushing a value in, false means you're pulling the current one out. pick your fighter π
β RETURN β
0 on success, or an error code. so if it hands you back a 0, slay, you're done π anything else means something went sideways and you should go look at that error code, fr fr π
π SEE ALSO π
the kernel file lives right here, go read it when you're feeling brave:
./drivers/platform/x86/lenovo/wmi-other.c
and here's the whole friend group, all present and accounted for π
lwmi_om_hwmon_is_visible(9)lwmi_om_hwmon_read(9)lwmi_om_hwmon_write(9)lwmi_om_hwmon_add(9)lwmi_om_hwmon_remove(9)lwmi_om_fan_info_init(9)lwmi_om_fan_info_collect_cd00(9)lwmi_om_fan_info_collect_cd_fan(9)lwmi_psy_ext_get_prop(9)lwmi_psy_ext_set_prop(9)lwmi_psy_prop_is_supported(9)lwmi_psy_prop_is_writeable(9)lwmi_add_battery(9)lwmi_remove_battery(9)lwmi_acpi_match(9)lwmi_om_psy_ext_init(9)lwmi_om_psy_remove(9)tunable_attr_01_id(9)int_type_show(9)attr_capdata01_show(9)attr_current_value_store(9)attr_current_value_show(9)lwmi_attr_01_is_supported(9)lwmi_om_fw_attr_add(9)lwmi_om_fw_attr_remove(9)lwmi_om_master_bind(9)lwmi_om_master_unbind(9)
ngl this page is tiny but it ate π
get your RPM, set your RPM, respect the 0-based index, and go touch some grass (or, y'know, read wmi-other.c) π§
kisses, this gem comes to you from ./drivers/platform/x86/lenovo, dated October 2026 β screenshot it, tattoo it, whatever, it's iconic βπ¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms