mux_chip_alloc(9)
β¨ mux_chip_alloc(9) β¨
okay so bestie, buckle up β this is a (9) Kernel API Manual moment and we're allocating a whole mux-chip π
.
πΈ SYNOPSIS πΈ
struct mux_chip * mux_chip_alloc (struct device *dev , unsigned int
controllers , size_t sizeof_priv );
like⦠it literally returns a struct mux_chip * pointer, no cap.
π ARGUMENTS π
devβ the parent device that's implementing the mux interface. that's the main character right there π.controllersβ how many mux controllers you wanna allocate for this chip. a whole little squad π«Ά.sizeof_privβ size of the extra memory area for private use by the caller. basically the secret little stash for your own stuff π.
π¦ DESCRIPTION π¦
okay so here's the vibe: after you allocate the mux-chip with the number of mux controllers you want, but before you register the chip, the mux driver is required to configure the number of valid mux states in the mux_chip->mux[N].states members, and also the desired idle state in the returned mux_chip->mux[N].idle_state members. periodt.
the default idle state is MUX_IDLE_AS_IS, like that's the factory setting bestie β¨.
the mux driver also needs to provide a pointer to the operations struct in the mux_chip->ops member before registering the mux-chip with mux_chip_register. it's giving "set yourself up before you show up" energy π₯.
π RETURN π
a pointer to the new mux-chip β¨, or an ERR_PTR with a negative errno π. so like, check it before you vibe with it.
π SEE ALSO π
the whole group chat of related pages, iykyk:
- Kernel file
./drivers/mux/core.c struct mux_state(9)struct devm_mux_state_state(9)mux_chip_register(9)mux_chip_unregister(9)mux_chip_free(9)devm_mux_chip_alloc(9)devm_mux_chip_register(9)mux_control_states(9)mux_control_select_delay(9)mux_state_select_delay(9)mux_control_try_select_delay(9)mux_state_try_select_delay(9)mux_control_deselect(9)mux_state_deselect(9)mux_get(9)mux_control_get(9)mux_control_get_optional(9)mux_control_put(9)devm_mux_control_get(9)mux_state_get(9)__devm_mux_state_get(9)devm_mux_state_get_from_np(9)devm_mux_state_get_optional(9)devm_mux_state_get_selected(9)devm_mux_state_get_optional_selected(9)
lowkey this page lives in ./drivers/mux and it's dated October 2026 β yeah bestie, the future is now πβ¨. slay, and happy allocating! π§π
π¦ 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