Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: multiplexer: iio-mux: Support settle-time-us property

If the devicetree specifies that the hardware requires a settle time,
pass this time on to the mux APIs.

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-4-vincent.whitchurch@axis.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Vincent Whitchurch and committed by
Jonathan Cameron
39aa5040 b9221f71

+6 -1
+6 -1
drivers/iio/multiplexer/iio-mux.c
··· 33 33 struct iio_chan_spec *chan; 34 34 struct iio_chan_spec_ext_info *ext_info; 35 35 struct mux_child *child; 36 + u32 delay_us; 36 37 }; 37 38 38 39 static int iio_mux_select(struct mux *mux, int idx) ··· 43 42 int ret; 44 43 int i; 45 44 46 - ret = mux_control_select(mux->control, chan->channel); 45 + ret = mux_control_select_delay(mux->control, chan->channel, 46 + mux->delay_us); 47 47 if (ret < 0) { 48 48 mux->cached_state = -1; 49 49 return ret; ··· 393 391 394 392 mux->parent = parent; 395 393 mux->cached_state = -1; 394 + 395 + mux->delay_us = 0; 396 + of_property_read_u32(np, "settle-time-us", &mux->delay_us); 396 397 397 398 indio_dev->name = dev_name(dev); 398 399 indio_dev->info = &mux_info;