Skip to content

Commit

Permalink
iio: multiplexer: new iio category and iio-mux driver
Browse files Browse the repository at this point in the history
When a multiplexer changes how an iio device behaves (for example
by feeding different signals to an ADC), this driver can be used
to create one virtual iio channel for each multiplexer state.

Depends on the generic multiplexer subsystem.

Cache any ext_info values from the parent iio channel, creating a private
copy of the ext_info attributes for each multiplexer state/channel.

Reviewed-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Peter Rosin authored and Greg Kroah-Hartman committed Jun 3, 2017
1 parent a36954f commit 7ba9df5
Show file tree
Hide file tree
Showing 6 changed files with 486 additions and 0 deletions.
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -6486,6 +6486,7 @@ M: Peter Rosin <peda@axentia.se>
L: linux-iio@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/iio/multiplexer/iio-mux.txt
F: drivers/iio/multiplexer/iio-mux.c

IIO SUBSYSTEM AND DRIVERS
M: Jonathan Cameron <jic23@kernel.org>
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ source "drivers/iio/humidity/Kconfig"
source "drivers/iio/imu/Kconfig"
source "drivers/iio/light/Kconfig"
source "drivers/iio/magnetometer/Kconfig"
source "drivers/iio/multiplexer/Kconfig"
source "drivers/iio/orientation/Kconfig"
if IIO_TRIGGER
source "drivers/iio/trigger/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ obj-y += humidity/
obj-y += imu/
obj-y += light/
obj-y += magnetometer/
obj-y += multiplexer/
obj-y += orientation/
obj-y += potentiometer/
obj-y += potentiostat/
Expand Down
18 changes: 18 additions & 0 deletions drivers/iio/multiplexer/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Multiplexer drivers
#
# When adding new entries keep the list in alphabetical order

menu "Multiplexers"

config IIO_MUX
tristate "IIO multiplexer driver"
select MULTIPLEXER
depends on OF || COMPILE_TEST
help
Say yes here to build support for the IIO multiplexer.

To compile this driver as a module, choose M here: the
module will be called iio-mux.

endmenu
6 changes: 6 additions & 0 deletions drivers/iio/multiplexer/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#
# Makefile for industrial I/O multiplexer drivers
#

# When adding new entries keep the list in alphabetical order
obj-$(CONFIG_IIO_MUX) += iio-mux.o
Loading

0 comments on commit 7ba9df5

Please sign in to comment.