gaokun_ec_ps...smart_charge(9)
π gaokun_ec_psy_set_smart_charge β¨
okay bestie, so this one's from the Kernel API Manual β the page is literally called gaokun_ec_ps...smart_charge(9) (yes the name is truncated, we don't ask questions, we just vibe π«Ά). It's the kernel-side hook that hands your smart-charge settings over to the EC. Let's get into it π
πΈ NAME πΈ
gaokun_ec_psy_set_smart_charge β the function that sets the smart charge data. That's it, that's the whole job, and it ate π
β¨ SYNOPSIS β¨
int gaokun_ec_psy_set_smart_charge (struct gaokun_ec *ec , const u8
req[GAOKUN_SMART_CHARGE_DATA_SIZE] );
so you call it with your gaokun_ec struct, and you pass in a const u8 array sized GAOKUN_SMART_CHARGE_DATA_SIZE. It hands you back an int. iconic signature, no notes π
π ARGUMENTS π
ecβ thegaokun_ecstructure, your main character struct β¨reqβ the sequence you're requesting, and it's giving a whole little bundle: (mode, delay, start, end) π
π₯ RETURN π₯
0 on success, or a negative error code if it didn't slay π so like, always check the return value, fr fr.
π¦ SEE ALSO π¦
Kernel file: ./drivers/platform/arm64/huawei-gaokun-ec.c β that's the source of truth, go read it iykyk π
and the whole friend group of sibling functions, all linked up:
gaokun_ec_read(9)gaokun_ec_write(9)gaokun_ec_register_notify(9)gaokun_ec_unregister_notify(9)gaokun_ec_psy_multi_read(9)gaokun_ec_psy_get_smart_charge(9)gaokun_ec_psy_get_smart_charge_enable(9)gaokun_ec_psy_set_smart_charge_enable(9)gaokun_ec_ucsi_read(9)gaokun_ec_ucsi_write(9)gaokun_ec_ucsi_get_reg(9)gaokun_ec_ucsi_pan_ack(9)
like literally the entire gaokun_ec squad, go say hi to all of them ππ
β οΈ quick vibe check: this is kernel API territory β you're writing into the EC, so treat that req buffer with the respect it deserves, bestie π
πΈ mwah, that's the whole page! brought to you by the ./drivers/platform/arm64 girlies, dated October 2026 β see you in the next manpage, periodt π
ππ¦
π¦ 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