summaryrefslogtreecommitdiff
path: root/include/linux/mux/consumer.h
diff options
context:
space:
mode:
authorVincent Whitchurch <vincent.whitchurch@axis.com>2021-10-07 16:46:39 +0300
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2021-10-21 22:02:42 +0300
commit17b5b576ff5faff99a4c8140d521cd4d7fff5c16 (patch)
treec0b7b88fc7c5bea50391a4322156218ed37fdfe8 /include/linux/mux/consumer.h
parent796e5d0b1e9baa2c80c234efd54d561e6d1cf1e7 (diff)
downloadlinux-17b5b576ff5faff99a4c8140d521cd4d7fff5c16.tar.xz
mux: add support for delay after muxing
Hardware may require some time for the muxed analog signals to settle after the muxing is changed. Allow users of the mux subsystem to specify this delay with the new mux_control_select_delay() function (and the _try equivalent). Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Peter Rosin <peda@axentia.se> Link: https://lore.kernel.org/r/20211007134641.13417-2-vincent.whitchurch@axis.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'include/linux/mux/consumer.h')
-rw-r--r--include/linux/mux/consumer.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/include/linux/mux/consumer.h b/include/linux/mux/consumer.h
index 5fc6bb2fefad..7a09b040ac39 100644
--- a/include/linux/mux/consumer.h
+++ b/include/linux/mux/consumer.h
@@ -16,10 +16,25 @@ struct device;
struct mux_control;
unsigned int mux_control_states(struct mux_control *mux);
-int __must_check mux_control_select(struct mux_control *mux,
- unsigned int state);
-int __must_check mux_control_try_select(struct mux_control *mux,
- unsigned int state);
+int __must_check mux_control_select_delay(struct mux_control *mux,
+ unsigned int state,
+ unsigned int delay_us);
+int __must_check mux_control_try_select_delay(struct mux_control *mux,
+ unsigned int state,
+ unsigned int delay_us);
+
+static inline int __must_check mux_control_select(struct mux_control *mux,
+ unsigned int state)
+{
+ return mux_control_select_delay(mux, state, 0);
+}
+
+static inline int __must_check mux_control_try_select(struct mux_control *mux,
+ unsigned int state)
+{
+ return mux_control_try_select_delay(mux, state, 0);
+}
+
int mux_control_deselect(struct mux_control *mux);
struct mux_control *mux_control_get(struct device *dev, const char *mux_name);