To use the ads1118 ADC IC via an SPI interface with the current efusA9X kernel (4.9.88) it is necessarry to add a driver to the kernel space.
After some research I found a kernel driver implementation under [1]. I collected all information (code+docs) and implemented them into the current kernel with the attached patch under [2]. After adding the node to the device tree (convertig spidev to adc node (see [3])), I testing the driver successfully for a half day.
@F+S: I request to implement this patch to your kernel sources.
Best regards.
[1]:
https://lore.kernel.org/patchwork/patch/698694/
[2]:
0001-add-support-for-adc-ads1118.patch.zip
[3]:
Diff
- diff --git a/efusa9x.dts b/efusa9x.dts
- index 2e1f157..048a211 100644
- --- a/efusa9x.dts
- +++ b/efusa9x.dts
- @@ -1417,12 +1417,24 @@ lvds_wvga { \
- reg = <0>;
- };
- - spidev@1 {
- - #address-cells = <1>;
- - #size-cells = <1>;
- - compatible = "linux,spidev";
- + ads1118@1 {
- + compatible = "ti,ads1118";
- spi-max-frequency = <20000000>;
- + spi-cpha;
- reg = <1>;
- + #address-cells = <1>;
- + #size-cells = <0>;
- + ti,tempsensor;
- + voltage0@0 {
- + reg = <0>;
- + ti,fullscale = <6144000>;
- + ti,datarate = <128>;
- + };
- + voltage1@1 {
- + reg = <1>;
- + ti,fullscale = <6144000>;
- + ti,datarate = <128>;
- + };
- };
- spidev@2 {