Lines Matching defs:mux
3 * List, select, and deselect mux controllers on the fly.
14 #include <mux.h>
15 #include <mux-internal.h>
17 #include <dt-bindings/mux/mux.h>
32 * Find a mux based on its device name in argv[1] and index in the chip in
57 return &chip->mux[id];
61 * Print the details of a mux. The columns printed correspond to: "Selected",
64 static void print_mux(struct mux_control *mux)
66 PRINT_COLUMN("%s", mux->in_use ? "yes" : "no");
68 if (mux->cached_state == MUX_IDLE_AS_IS)
71 PRINT_COLUMN("0x%x", mux->cached_state);
73 if (mux->idle_state == MUX_IDLE_AS_IS)
75 else if (mux->idle_state == MUX_IDLE_DISCONNECT)
78 PRINT_COLUMN("0x%x", mux->idle_state);
80 PRINT_COLUMN("0x%x", mux->states);
97 dev_err(dev, "can't find mux chip\n");
113 print_mux(&chip->mux[j]);
124 struct mux_control *mux;
131 mux = cmd_mux_find(argv);
132 if (IS_ERR_OR_NULL(mux)) {
133 printf("Failed to find the specified mux\n");
143 ret = mux_control_select(mux, state);
155 struct mux_control *mux;
161 mux = cmd_mux_find(argv);
162 if (IS_ERR_OR_NULL(mux)) {
163 printf("Failed to find the specified mux\n");
167 ret = mux_control_deselect(mux);
169 printf("Failed to deselect mux\n");
176 U_BOOT_LONGHELP(mux,
178 "select <chip> <id> <state> - Select the given mux state\n"
179 "deselect <chip> <id> - Deselect the given mux and reset it to its idle state");
181 U_BOOT_CMD_WITH_SUBCMDS(mux, "List, select, and deselect muxes", mux_help_text,