All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] iio: multiplexer: Copy scan_type details from parent to child
@ 2022-07-18 18:43 Chris Morgan
  2022-07-19  8:51 ` Jonathan Cameron
  0 siblings, 1 reply; 8+ messages in thread
From: Chris Morgan @ 2022-07-18 18:43 UTC (permalink / raw)
  To: linux-iio; +Cc: lars, jic23, peda, Chris Morgan

From: Chris Morgan <macromorgan@hotmail.com>

Copy the scan_type details from the parent iio channel to the child.
The scan_type is otherwise empty and things like the storagebits are
zero (which causes a problem for the adc-joystick driver which
validates the storagebits when used through a mux). I'm submitting this
as an RFC because I'm not sure if this is the correct way to handle
this scenario (a driver that checks the storagebits used with the iio
multiplexer).

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
 drivers/iio/multiplexer/iio-mux.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/iio/multiplexer/iio-mux.c b/drivers/iio/multiplexer/iio-mux.c
index 93558fddfa9b..1de01ec878c4 100644
--- a/drivers/iio/multiplexer/iio-mux.c
+++ b/drivers/iio/multiplexer/iio-mux.c
@@ -322,6 +322,9 @@ static int mux_configure_channel(struct device *dev, struct mux *mux,
 	if (page)
 		devm_kfree(dev, page);
 
+	/* Copy scan type from parent to mux child. */
+	chan->scan_type = pchan->scan_type;
+
 	return 0;
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-07-20  8:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-18 18:43 [RFC] iio: multiplexer: Copy scan_type details from parent to child Chris Morgan
2022-07-19  8:51 ` Jonathan Cameron
2022-07-19 13:27   ` Peter Rosin
2022-07-19 14:19     ` Jonathan Cameron
2022-07-19 14:44       ` Chris Morgan
2022-07-19 17:54         ` Peter Rosin
2022-07-19 19:22           ` Chris Morgan
2022-07-20  8:25             ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.