STRUCT MUX_CONTROL(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

struct mux_control is from the Kernel API Manual (section 9, iykyk), and it literally represents a mux controller. That’s the whole main-character job. πŸ’…

πŸ’» SYNOPSIS πŸ’»

okay so here’s the struct in all its glory, character for character because we do not mess with code:

struct mux_control {
    struct semaphore lock;
    struct mux_chip *chip;
    int cached_state;
    unsigned int states;
    int idle_state;
    ktime_t last_change;
 };

🧸 Members 🧸

  • lock β€” protects the mux controller state. πŸ”’
  • chip β€” the mux chip that is handling this mux controller. πŸŽ›οΈ
  • cached_state β€” the current mux controller state, or -1 if none. 🫧
  • states β€” the number of mux controller states. πŸ”’
  • idle_state β€” the mux controller state to use when inactive, or one of MUX_IDLE_AS_IS and MUX_IDLE_DISCONNECT. 😴
  • last_change β€” timestamp of last change. ⏰

🌈 Description 🌈

Real talk, bestie: mux drivers may only change states and idle_state, and they may only do that between allocation and registration of the mux controller. That’s the whole window. πŸͺŸ

Specifically, cached_state is internal to the mux core and should never be written by mux drivers β€” periodt. 🚫

πŸ‘€ SEE ALSO πŸ‘€

Kernel file ./include/linux/mux/driver.h β€” plus these icons: struct mux_control_ops(9), struct mux_chip(9), mux_chip_priv(9), and mux_control_get_index(9). Go read them if you’re obsessed with mux lore. πŸ“š


k bye bestie πŸ’… β€” source/version ./include/linux/mux, October 2026. Mwah 🫢

πŸ“¦ where this page comes from