cmdq_pkt_write(9)
π cmdq_pkt_write β like, the whole vibe β¨
okay so real talk, this page lives in the Kernel API Manual (section 9, iykyk) and it's all about cmdq_pkt_write β the function that literally just appends a write command to the CMDQ packet. that's it. that's the whole thing. she's simple, she's iconic, she does exactly one job and does it slayfully π
β¨ SYNOPSIS β¨
int cmdq_pkt_write (struct cmdq_pkt *pkt , u8 subsys , u16 offset , u32
value );
like yes bestie, that's the whole signature π five things: a return type, a packet, a subsystem code, an offset, and the value. no notes. periodt.
πΈ ARGUMENTS πΈ
pktβ the CMDQ packet π«Ά this is the thing you're stuffing the write command into, bestie. giving main character energy, holding everyone else's commands.subsysβ the CMDQ sub system code π it's au8, it tells the packet which subsystem you're talking to. think of it as the group chat you're posting in.offsetβ register offset from the CMDQ sub system π― au16, relative to that subsystem. not the absolute address, just the offset from where the subsystem starts. lowkey important distinction ngl.valueβ the specified target register value π au32β the actual data you want written. the moment. the payload. the reason we're all here.
π₯ RETURN π₯
0 for success π β and if it's not 0? then the error code is returned π so like, check it. don't just assume it ate. fr fr.
π¦ SEE ALSO π¦
okay this is the part where the manpage just goes off and lists literally the entire extended universe of CMDQ functions π and honestly? we love a comprehensive friend group.
the Kernel file lives at ./include/linux/soc/mediatek/mtk-cmdq.h β that's the source of truth, go read it π§
and the whole squad, in order:
cmdq_dev_get_client_reg(9)cmdq_mbox_create(9)cmdq_mbox_destroy(9)cmdq_pkt_create(9)cmdq_pkt_destroy(9)cmdq_pkt_write_pa(9)cmdq_pkt_write_subsys(9)cmdq_pkt_write_mask(9)cmdq_pkt_write_mask_pa(9)cmdq_pkt_write_mask_subsys(9)cmdq_pkt_write_s(9)cmdq_pkt_write_s_mask(9)cmdq_pkt_write_s_value(9)cmdq_pkt_write_s_mask_value(9)cmdq_pkt_mem_move(9)cmdq_pkt_wfe(9)cmdq_pkt_acquire_event(9)cmdq_pkt_clear_event(9)cmdq_pkt_set_event(9)cmdq_pkt_poll(9)cmdq_pkt_poll_mask(9)cmdq_pkt_logic_command(9)cmdq_pkt_assign(9)cmdq_pkt_poll_addr(9)cmdq_pkt_jump_abs(9)cmdq_pkt_jump_rel(9)cmdq_pkt_jump_rel_temp(9)cmdq_pkt_eoc(9)
like, every single one of them. no skips. we respect the roster π
aaaand that's the page!! sourced straight from ./include/linux/soc/mediatek, dated October 2026 β signing off bestie, go forth and append your writes responsibly π
β¨πΈ
π¦ 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