IIO driver for STMPE811 ADC on torizon

Coming from Toradex BSPs i evaluate torizon now and want to make use of the on-module adc via iio.

Although i am not a kernel specialist i digged deeper and saw there are also a change of device tree properties in the main line colibri module dts. The toradex version of it just dont enable it by default.
But further from my point of view the actual torizon platform with the toradex mainline kernels 4.19.y, 4.20.y and 5.0.y the mfd driver doesen’t include adc capability.

I quickly tried to port the driver from mainline but failed for now because i dont now hot to debug it except dmesg which wont show anything.

Can you specify a roadmap for this colibri-platform on-module functionality?

Also I would be thankful for any input or how to find the mainline kernel commit to port it correctly.

Hi @m.tellian

We just recently mainlined this driver and it is there since kernel version 5.1. Unfortunately there where some bugs in the driver. The patches to solve them are at the moment in the process to go into mainline and also stable. Let me list those patches for you so we get a better overview:

In mainline repo the following patches add functionality of the stmpe-adc driver:

Patch 1:	270a60bcc8	dt-bindings: stmpe: Reformatting parameter list and use tabs only
Patch 2:	063755ab1d	mfd: stmpe: Move ADC related defines to MFD header
Patch 3:	6377cfa3b8	mfd: stmpe: Preparations for STMPE ADC driver
Patch 4:	88f29d0f2c	Input: stmpe-ts: preparations for STMPE ADC driver
Patch 5:	9f3d084965	iio: adc: add STMPE ADC driver using IIO framework
Patch 6:	81cdab7981	iio: adc: add STMPE ADC devicetree bindings
Patch 7:	a822029a0c	ARM: dts: Add stmpe-adc DT node to Toradex iMX6 modules

The fixes that will appear in mainline kernel version 5.3 are in the iio-repository

Bugfix1:	b1f4c9a3c7	iio: stmpe-adc: Remove unnecessary assignment
Bugfix2:	2abd293703	iio: stmpe-adc: Add compatible name
Bugfix3:	263d21cd5e	iio: stmpe-adc: Reinit completion struct on begin conversion
Bugfix4:	4bd44bb2b4	iio: stmpe-adc: Enable all stmpe-adc interrupts just once
Bugfix5:	e813dde6f8	iio: stmpe-adc: Use wait_for_completion_timeout
Bugfix6:	ed1f310ee2	iio: stmpe-adc: Reset possible interrupts

The toradex version of it just dont enable it by default.

Bugfix2 is solving that problem. It will be loaded by default if it is used in devicetree.

I quickly tried to port the driver from mainline but failed for now because i dont now hot to debug it except dmesg which wont show anything.

The Patch series 1-7 I listed above should apply cleanly to mainline since at least version 4.19.

You also asked for a roadmap: I checked back and our marketing is working on a high-level roadmap that should be published in the next few days.

Besides that, you can also always check the release details for Torizon:
https://developer1.toradex.com/software/torizon/release-details