cros_ec_keyb_register_bs(9)
π cros_ec_keyb_register_bs(9) β the Kernel API Manual page, but make it make sense
okay so bestie, this is cros_ec_keyb_register_bs(9) from the Kernel API Manual, and honestly? it's a little baddie of a function. it does one job and it does it cute. let's get into it β¨
πΈ NAME πΈ
cros_ec_keyb_register_bs β the function that registers your non-matrix buttons and switches π
like, the keys that aren't in the regular key grid. those ones. she handles those.
π¦ SYNOPSIS π¦
int cros_ec_keyb_register_bs (struct cros_ec_keyb *ckdev , bool
expect_buttons_switches );
that's the whole signature, no cap π
π ARGUMENTS π
ckdevβ the keyboard device, aka the main character here π this is yourstruct cros_ec_keyb *and everything revolves around her.expect_buttons_switchesβ aboolthat says "yes bestie, the EC must report button and/or switch events." it's literally the flag that tells everyone to be ready for those events π
β¨ DESCRIPTION β¨
so what does she actually do? she handles all the bits of the keyboard driver related to non-matrix buttons and switches β including asking the EC about which ones are present π and telling the kernel to expect them. it's giving project manager energy fr fr.
and here's the important bit, listen up π«Ά if this device has no support for buttons and switches, we don't throw a fit β we return no error π but heads up: ckdev->bs_idev will remain NULL when this function exits. so like, no error, but also no bs_idev. she's just not there. don't go dereferencing her, i'm begging π
returns 0 if no error, or -error upon error. classic. iconic. periodt. π
π₯ SEE ALSO π₯
- Kernel file
./drivers/input/keyboard/cros_ec_keyb.c struct cros_ec_keyb(9)struct cros_ec_bs_map(9)cros_ec_keyb_report_bs(9)cros_ec_keyb_info(9)cros_ec_keyb_query_switches(9)cros_ec_keyb_resume(9)cros_ec_keyb_register_matrix(9)
go read the whole friend group, they're all linked up π
ngl this one's short but she's important β buttons and switches don't register themselves, bestie π
and that's the tea π§ this page lives in ./drivers/input/keyboard, dated October 2026, brought to you by the Kernel API Manual. mwah π stay hydrated and don't forget your NULL checks πβ
π¦ 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