summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFrank Li <Frank.Li@nxp.com>2026-05-05 02:54:35 +0300
committerLinus Walleij <linusw@kernel.org>2026-05-05 15:48:12 +0300
commit05e58da46d8e8f8b29bc9b47053bb0637891c06f (patch)
tree3f5fd7e888ecef6d33bfa191226031908defcf5f /include
parent254f49634ee16a731174d2ae34bc50bd5f45e731 (diff)
downloadlinux-05e58da46d8e8f8b29bc9b47053bb0637891c06f.tar.xz
mux: add devm_mux_state_get_from_np() to get mux from child node
Add new API devm_mux_state_get_from_np() to retrieve a mux control from a specified child device node. Make devm_mux_state_get() call devm_mux_state_get_from_np() with a NULL node parameter, which defaults to using the device's own of_node. Support the following DT schema: pinctrl@0 { uart-func { mux-state = <&mux_chip 0>; }; spi-func { mux-state = <&mux_chip 1>; }; }; Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Linus Walleij <linusw@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mux/consumer.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/linux/mux/consumer.h b/include/linux/mux/consumer.h
index a961861a503b..449e38e6e2c5 100644
--- a/include/linux/mux/consumer.h
+++ b/include/linux/mux/consumer.h
@@ -60,7 +60,10 @@ struct mux_control *mux_control_get_optional(struct device *dev, const char *mux
void mux_control_put(struct mux_control *mux);
struct mux_control *devm_mux_control_get(struct device *dev, const char *mux_name);
-struct mux_state *devm_mux_state_get(struct device *dev, const char *mux_name);
+
+struct mux_state *
+devm_mux_state_get_from_np(struct device *dev, const char *mux_name, struct device_node *np);
+
struct mux_state *devm_mux_state_get_optional(struct device *dev, const char *mux_name);
struct mux_state *devm_mux_state_get_selected(struct device *dev, const char *mux_name);
struct mux_state *devm_mux_state_get_optional_selected(struct device *dev, const char *mux_name);
@@ -161,4 +164,7 @@ static inline struct mux_state *devm_mux_state_get_optional_selected(struct devi
#endif /* CONFIG_MULTIPLEXER */
+#define devm_mux_state_get(dev, mux_name) \
+ devm_mux_state_get_from_np(dev, mux_name, NULL)
+
#endif /* _LINUX_MUX_CONSUMER_H */