Wiki

This version is outdated by a newer approved version.DiffThis version (18 Jul 2018 12:39) is a draft.
Approvals: 0/1

This is an old revision of the document!


ADGS1408/ADGS1409 8:1/Dual 4:1 Muxes Linux Driver

Supported Devices

Evaluation Boards

Description

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 Code

Status

Source Mainlined?
git [No]

Files

Devicetree

Required devicetree properties:

  • compatible: Needs to be the name of the device. E.g. “adi,adgs1408”
  • reg: The chipselect number used for the device
  • spi-max-frequency: Maximum SPI clock frequency.
  • #mux-control-cells:is required to be <0>
&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.

Adding Linux driver support

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
                ...
            ...
        ...

More Information

resources/tools-software/linux-drivers/mux/adgs1408.1531910397.txt.gz · Last modified: 18 Jul 2018 12:39 by Mircea Caprioru