cros_ec_keyb_register_bs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 your struct cros_ec_keyb * and everything revolves around her.
  • expect_buttons_switches β€” a bool that 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 πŸ”₯

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