pch_vbus_gpio_get_value(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… pch_vbus_gpio_get_value(9) β€” kernel API manual, bestie edition πŸŽ€

okay so listen, this is a page from the Kernel API Manual, and it's about one very specific little function: pch_vbus_gpio_get_value. It lives in the kernel's USB gadget driver land and it's lowkey just a vibe check on your VBUS line. let's get into it ✨


🌸 NAME 🌸

pch_vbus_gpio_get_value β€” This API gets value of GPIO port as VBUS status.

like, that's literally her whole job. she reads the GPIO port and tells you what's up with VBUS. no cap 🫢


⭐ SYNOPSIS ⭐

int pch_vbus_gpio_get_value (struct pch_udc_dev *dev );

that's it, that's the whole signature. she takes one arg and hands you back an int. iconic behavior honestly πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” Reference to the driver structure. yeah she needs the struct pch_udc_dev * so she knows which driver she's talking about. can't be out here reading GPIOs with no context, that's not the move bestie πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea β€” this is the return value situation, and you gotta memorize it fr fr:

  • 1 β€” VBUS is high πŸ”₯
  • 0 β€” VBUS is low πŸ’€
  • -1 β€” It is not enable to detect VBUS using GPIO 😭

so like, 1 and 0 are your actual readings, and -1 is the "girl this isn't even enabled, GPIO detection isn't a thing here" answer. know the difference, it matters 🧚

side note: -1 isn't a low reading, it's a can't detect at all situation. don't be out here treating negative one like a boolean, that's how you get bugs πŸ’€

🌈 SEE ALSO 🌈

bestie, this list is LONG. like, suspiciously long. but we don't skip, we don't summarize, we list every single one because that's the assignment and we ate πŸ‘‘

Kernel file ./drivers/usb/gadget/udc/pch_udc.c and honestly all of these:

like... iykyk. that's the whole family tree, we respect the whole family tree πŸŒ³πŸ’œ


πŸŽ€ sign-off πŸŽ€

and that's the page!! it came outta ./drivers/usb/gadget/udc, dated October 2026 β€” so like, mark your calendars bestie, this lore is from the future fr fr β­πŸ¦‹πŸ’–

go read your VBUS correctly, mwah πŸ’‹

πŸ“¦ where this page comes from