Skip to content

Commit

Permalink
mux: minimal mux subsystem
Browse files Browse the repository at this point in the history
Add a new minimalistic subsystem that handles multiplexer controllers.
When multiplexers are used in various places in the kernel, and the
same multiplexer controller can be used for several independent things,
there should be one place to implement support for said multiplexer
controller.

A single multiplexer controller can also be used to control several
parallel multiplexers, that are in turn used by different subsystems
in the kernel, leading to a need to coordinate multiplexer accesses.
The multiplexer subsystem handles this coordination.

Thanks go out to Lars-Peter Clausen, Jonathan Cameron, Rob Herring,
Wolfram Sang, Paul Gortmaker, Dan Carpenter, Colin Ian King, Greg
Kroah-Hartman and last but certainly not least to Philipp Zabel for
helpful comments, reviews, patches and general encouragement!

Reviewed-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Peter Rosin <peda@axentia.se>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
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 256ac03 commit a3b02a9
Show file tree
Hide file tree
Showing 10 changed files with 735 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Documentation/ABI/testing/sysfs-class-mux
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
What: /sys/class/mux/
Date: April 2017
KernelVersion: 4.13
Contact: Peter Rosin <peda@axentia.se>
Description:
The mux/ class sub-directory belongs to the Generic MUX
Framework and provides a sysfs interface for using MUX
controllers.

What: /sys/class/mux/muxchipN/
Date: April 2017
KernelVersion: 4.13
Contact: Peter Rosin <peda@axentia.se>
Description:
A /sys/class/mux/muxchipN directory is created for each
probed MUX chip where N is a simple enumeration.
5 changes: 5 additions & 0 deletions Documentation/driver-model/devres.txt
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,11 @@ MEM
MFD
devm_mfd_add_devices()

MUX
devm_mux_chip_alloc()
devm_mux_chip_register()
devm_mux_control_get()

PER-CPU MEM
devm_alloc_percpu()
devm_free_percpu()
Expand Down
3 changes: 3 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -8719,8 +8719,11 @@ F: include/linux/spi/mmc_spi.h
MULTIPLEXER SUBSYSTEM
M: Peter Rosin <peda@axentia.se>
S: Maintained
F: Documentation/ABI/testing/mux/sysfs-class-mux*
F: Documentation/devicetree/bindings/mux/
F: include/linux/dt-bindings/mux/
F: include/linux/mux/
F: drivers/mux/

MULTISOUND SOUND DRIVER
M: Andrew Veliath <andrewtv@usa.net>
Expand Down
2 changes: 2 additions & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,6 @@ source "drivers/fsi/Kconfig"

source "drivers/tee/Kconfig"

source "drivers/mux/Kconfig"

endmenu
1 change: 1 addition & 0 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,4 @@ obj-$(CONFIG_NVMEM) += nvmem/
obj-$(CONFIG_FPGA) += fpga/
obj-$(CONFIG_FSI) += fsi/
obj-$(CONFIG_TEE) += tee/
obj-$(CONFIG_MULTIPLEXER) += mux/
16 changes: 16 additions & 0 deletions drivers/mux/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Multiplexer devices
#

menuconfig MULTIPLEXER
tristate "Multiplexer subsystem"
help
Multiplexer controller subsystem. Multiplexers are used in a
variety of settings, and this subsystem abstracts their use
so that the rest of the kernel sees a common interface. When
multiple parallel multiplexers are controlled by one single
multiplexer controller, this subsystem also coordinates the
multiplexer accesses.

To compile the subsystem as a module, choose M here: the module will
be called mux-core.
5 changes: 5 additions & 0 deletions drivers/mux/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#
# Makefile for multiplexer devices.
#

obj-$(CONFIG_MULTIPLEXER) += mux-core.o
Loading

0 comments on commit a3b02a9

Please sign in to comment.