attr_current_value_store(9)
π NAME π
okay bestie, meet attr_current_value_store(9) from the Kernel API Manual β its whole job is setting the current value of the attribute you point it at. iconic behavior, honestly π
β¨ SYNOPSIS β¨
ssize_t attr_current_value_store (struct kobject *kobj , struct
kobj_attribute *kattr , const char *buf , size_t count , struct
tunable_attr_01 *tunable_attr );
π ARGUMENTS π
kobjβ pointer to the driver object. main character pointer energy β¨kattrβ pointer to the attribute that's calling this function. it's giving self-awareness πͺbufβ the buffer we read from; it gets parsed tointtype. numbers go in, numbers come out π’countβ required by the sysfs attribute macros; you pass it in from the callee attr. mandatory lil paperwork πtunable_attrβ the attribute that's actually being stored. the one we're setting, periodt π
πΈ DESCRIPTION πΈ
Okay so here's the vibe: this function sets the value of the given attribute, but only when you're operating under the "custom" smartfan profile. custom only, bestie π
The current smartfan profile gets retrieved from the lenovo-wmi-gamezone driver, and if the result is not "custom", an error is returned. no custom profile, no storing π
It's designed to be generic on purpose, so it can be called from any integer attribute's "_store" function. reusable king π The integer that's headed to the WMI method gets range checked, and if it's out of range, an error code is returned. stay in your lane, number π§
And if the value is valid and WMI is a success? Then the sysfs attribute is notified. slay, notification delivered π
π RETURN π
Either count, or an error code. simple, clean, no cap β¨
π SEE ALSO π
Kernel file: ./drivers/platform/x86/lenovo/wmi-other.c go read it, iykyk π
lwmi_om_fan_get_set(9)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_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)
byeee π«Ά this page comes from ./drivers/platform/x86/lenovo, dated October 2026, and yes the title stays attr_current_value_store(9) β¨
π¦ 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