#define pr_fmt(fmt) "mux-core: " fmt
 
+#include <linux/delay.h>
 #include <linux/device.h>
 #include <linux/err.h>
 #include <linux/export.h>
                sema_init(&mux->lock, 1);
                mux->cached_state = MUX_CACHE_UNKNOWN;
                mux->idle_state = MUX_IDLE_AS_IS;
+               mux->last_change = ktime_get();
        }
 
        device_initialize(&mux_chip->dev);
        int ret = mux->chip->ops->set(mux, state);
 
        mux->cached_state = ret < 0 ? MUX_CACHE_UNKNOWN : state;
+       if (ret >= 0)
+               mux->last_change = ktime_get();
 
        return ret;
 }
        return ret;
 }
 
+static void mux_control_delay(struct mux_control *mux, unsigned int delay_us)
+{
+       ktime_t delayend;
+       s64 remaining;
+
+       if (!delay_us)
+               return;
+
+       delayend = ktime_add_us(mux->last_change, delay_us);
+       remaining = ktime_us_delta(delayend, ktime_get());
+       if (remaining > 0)
+               fsleep(remaining);
+}
+
 /**
- * mux_control_select() - Select the given multiplexer state.
+ * mux_control_select_delay() - Select the given multiplexer state.
  * @mux: The mux-control to request a change of state from.
  * @state: The new requested state.
+ * @delay_us: The time to delay (in microseconds) if the mux state is changed.
  *
  * On successfully selecting the mux-control state, it will be locked until
  * there is a call to mux_control_deselect(). If the mux-control is already
  * Return: 0 when the mux-control state has the requested state or a negative
  * errno on error.
  */
-int mux_control_select(struct mux_control *mux, unsigned int state)
+int mux_control_select_delay(struct mux_control *mux, unsigned int state,
+                            unsigned int delay_us)
 {
        int ret;
 
                return ret;
 
        ret = __mux_control_select(mux, state);
+       if (ret >= 0)
+               mux_control_delay(mux, delay_us);
 
        if (ret < 0)
                up(&mux->lock);
 
        return ret;
 }
-EXPORT_SYMBOL_GPL(mux_control_select);
+EXPORT_SYMBOL_GPL(mux_control_select_delay);
 
 /**
- * mux_control_try_select() - Try to select the given multiplexer state.
+ * mux_control_try_select_delay() - Try to select the given multiplexer state.
  * @mux: The mux-control to request a change of state from.
  * @state: The new requested state.
+ * @delay_us: The time to delay (in microseconds) if the mux state is changed.
  *
  * On successfully selecting the mux-control state, it will be locked until
  * mux_control_deselect() called.
  * Return: 0 when the mux-control state has the requested state or a negative
  * errno on error. Specifically -EBUSY if the mux-control is contended.
  */
-int mux_control_try_select(struct mux_control *mux, unsigned int state)
+int mux_control_try_select_delay(struct mux_control *mux, unsigned int state,
+                                unsigned int delay_us)
 {
        int ret;
 
                return -EBUSY;
 
        ret = __mux_control_select(mux, state);
+       if (ret >= 0)
+               mux_control_delay(mux, delay_us);
 
        if (ret < 0)
                up(&mux->lock);
 
        return ret;
 }
-EXPORT_SYMBOL_GPL(mux_control_try_select);
+EXPORT_SYMBOL_GPL(mux_control_try_select_delay);
 
 /**
  * mux_control_deselect() - Deselect the previously selected multiplexer state.
 
 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);
 
 
 #include <dt-bindings/mux/mux.h>
 #include <linux/device.h>
+#include <linux/ktime.h>
 #include <linux/semaphore.h>
 
 struct mux_chip;
  * @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
  *
  * Mux drivers may only change @states and @idle_state, and may only do so
  * between allocation and registration of the mux controller. Specifically,
 
        unsigned int states;
        int idle_state;
+
+       ktime_t last_change;
 };
 
 /**