This is an old revision of the document!
This is a mux controller subsystem driver, with an interface for accessing mux controllers. This is done in such a way that several consumers can independently access the same mux controller if one controller controls several multiplexers, thus allowing sharing.
Source | Mainlined? |
---|---|
git | [No] |
Function | File |
---|---|
driver | https://github.com/analogdevicesinc/linux/blob/rpi-4.14.y/drivers/mux/adgs140x.c |
Required devicetree properties:
&spi0 { pinctrl-names = "default"; pinctrl-0 = <&spi0_pins &spi0_cs_pins>; cs-gpios = <&gpio 8 1>, <&gpio 7 1>; status = "okay"; mux: mux-controller@2 { compatible = "adi,adgs1408"; reg = <0>; spi-max-frequency = <1000000>; #mux-control-cells = <0>; }; } / { adc-mux@3 { compatible = "io-channel-mux"; io-channels = <&adc 1>; io-channel-names = "parent"; mux-controls = <&mux>; channels = "out_a0", "out_a1", "test0", "test1", "out_b0", "out_b1", "testb0", "testb1"; }; }
A consumer must also be provided to be able to control the mux. In this example we used a regular IIO ADC driver. Which is interfaced with the IIO mux controller consumer.
adc: ad7298@3 { compatible = "ad7298"; #io-channel-cells = <1>; spi-max-frequency = <1000000>; reg = <1>; };
The mux controller extends the ADC's IO channel that is selected. In this case the selected channels is represented by :
io-channels = <&adc 1>;
in this case voltage0 from ad7298 is the channels multiplexed in IIO.
Configure kernel with “make menuconfig” (alternatively use “make xconfig” or “make qconfig”)
The AD5360 Driver depends on CONFIG_SPI
Linux Kernel Configuration Device Drivers ---> ... <*> Industrial I/O support ---> --- Industrial I/O support ... Digital to analog converters ---> ... <*> Analog Devices Analog Devices AD5360/61/62/63/70/71/73 DAC driver ... ... ...