cros_ec_usb_get_role(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cros_ec_usb_get_role(9) β€” from the Kernel API Manual, bestie

okay so picture this: you're poking at the ChromeOS EC (that's the embedded controller, the little guy running the show on Chromebooks) and you want the tea on whatever USB-C PD device might be plugged into a port. This function? It gets you that tea. It's cros_ec_usb_get_role, and it's giving "tell me everything about the port" energy. ✨


✨ SYNOPSIS ✨

int cros_ec_usb_get_role (struct cros_ec_extcon_info *info , bool
*polarity );

πŸŽ€ ARGUMENTS πŸŽ€

  • info β€” a pointer to struct cros_ec_extcon_info. That's your extcon info struct, your whole context, your main character. 🫢
  • polarity β€” a pointer to cable polarity, and heads up bestie, this one is a return value β€” the function writes the polarity back out through it. πŸ‘‘

πŸ”₯ RETURN πŸ”₯

  • On success you get the role info back. slay. πŸ’–
  • If there's no cable connected, it's -ENOTCONN β€” literally nothing plugged in, sad little port, no vibe. 😭
  • Anything else <0? That's a failure, ngl. Something went wrong.

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the whole page, periodt. 🧚 this lil gem lives in ./drivers/extcon and it's dated October 2026 β€” no cap, that's the version and the date, so jot it down bestie. πŸŒΈπŸ’œ

πŸ“¦ where this page comes from