pch_vbus_gpio_get_value(9)
π 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 thestruct 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:
struct pch_udc_data_dma_desc(9)struct pch_udc_stp_dma_desc(9)struct pch_udc_cfg_data(9)struct pch_udc_ep(9)struct pch_vbus_gpio_data(9)struct pch_udc_dev(9)struct pch_udc_request(9)pch_udc_csr_busy(9)pch_udc_write_csr(9)pch_udc_read_csr(9)pch_udc_rmt_wakeup(9)pch_udc_get_frame(9)pch_udc_clear_selfpowered(9)pch_udc_set_selfpowered(9)pch_udc_set_disconnect(9)pch_udc_clear_disconnect(9)pch_udc_reconnect(9)pch_udc_vbus_session(9)pch_udc_ep_set_stall(9)pch_udc_ep_clear_stall(9)pch_udc_ep_set_trfr_type(9)pch_udc_ep_set_bufsz(9)pch_udc_ep_set_maxpkt(9)pch_udc_ep_set_subptr(9)pch_udc_ep_set_ddptr(9)pch_udc_ep_set_pd(9)pch_udc_ep_set_rrdy(9)pch_udc_ep_clear_rrdy(9)pch_udc_set_dma(9)pch_udc_clear_dma(9)pch_udc_set_csr_done(9)pch_udc_disable_interrupts(9)pch_udc_enable_interrupts(9)pch_udc_disable_ep_interrupts(9)pch_udc_enable_ep_interrupts(9)pch_udc_read_device_interrupts(9)pch_udc_write_device_interrupts(9)pch_udc_read_ep_interrupts(9)pch_udc_write_ep_interrupts(9)pch_udc_read_device_status(9)pch_udc_read_ep_control(9)pch_udc_clear_ep_control(9)pch_udc_read_ep_status(9)pch_udc_clear_ep_status(9)pch_udc_ep_set_nak(9)pch_udc_ep_clear_nak(9)pch_udc_ep_fifo_flush(9)pch_udc_ep_enable(9)pch_udc_ep_disable(9)pch_udc_wait_ep_stall(9)pch_udc_init(9)pch_udc_exit(9)pch_udc_pcd_get_frame(9)pch_udc_pcd_wakeup(9)pch_udc_pcd_selfpowered(9)pch_udc_pcd_pullup(9)pch_udc_pcd_vbus_session(9)pch_udc_pcd_vbus_draw(9)pch_vbus_gpio_work_fall(9)pch_vbus_gpio_work_rise(9)pch_vbus_gpio_irq(9)pch_vbus_gpio_init(9)pch_vbus_gpio_free(9)complete_req(9)empty_req_queue(9)pch_udc_free_dma_chain(9)pch_udc_create_dma_chain(9)prepare_dma(9)process_zlp(9)pch_udc_start_rxrequest(9)pch_udc_pcd_ep_enable(9)pch_udc_pcd_ep_disable(9)pch_udc_alloc_request(9)pch_udc_free_request(9)pch_udc_pcd_queue(9)pch_udc_pcd_dequeue(9)pch_udc_pcd_set_halt(9)pch_udc_pcd_set_wedge(9)pch_udc_pcd_fifo_flush(9)pch_udc_init_setup_buff(9)pch_udc_start_next_txrequest(9)pch_udc_complete_transfer(9)pch_udc_complete_receiver(9)pch_udc_svc_data_in(9)pch_udc_svc_data_out(9)pch_udc_svc_control_in(9)pch_udc_svc_control_out(9)pch_udc_postsvc_epinters(9)pch_udc_read_all_epstatus(9)pch_udc_activate_control_ep(9)pch_udc_svc_ur_interrupt(9)pch_udc_svc_enum_interrupt(9)pch_udc_svc_intf_interrupt(9)pch_udc_svc_cfg_interrupt(9)pch_udc_dev_isr(9)pch_udc_isr(9)pch_udc_setup_ep0(9)pch_udc_pcd_reinit(9)pch_udc_pcd_init(9)init_dma_pools(9)
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
- 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