I’m working with a Colibri VF50 module and I have customized the device tree configuration to adapt it for my custom board.
Here are the modification:
touchscreen disabled
dcu0 disabled
backlight disabled
spidev driver used for dspi1
some gpio added to additionalgpios pinctrl
Now I’ve just discovered that the internal temperature sensors are not working as expected.
With the original Toradex DTB: cat /sys/bus/iio/devices/iio\:device1/in_temp_input return 45108
So the current temperature in m°C
With my modified DTB: cat /sys/bus/iio/devices/iio\:device1/in_temp_input return -96195
I can’t see any link between the modifications I have done and the ADC settings.
There are minor kernel modifications (added custom driver on gpio, small i2c patch), but I’m disturbing my system just by using this new dtb attached.link text
Find also attached working(dmesg_ok) and non working (dmesg_ko) logs.link text
Thanks, this information are helpful. I don’t see an obvious issue with your device tree. Your device disables the resistive touchscreen driver, which makes use of the ADC driver too. However, that should not influence temperature reading… I guess it is a bug in the driver, we need to investigate this further.
I have done some minor cleaning in the dts to remove useless parts (I believe …). However a test with the same dts I have shared gives the same bad results.
Maybe I can try to update to kernel 4.4.16. Which branch are you using?
I am using the device tree file with the 4.4-next branch. However we did not do any changes to the ADC or the VF50 touchscreen driver since 2.6 Beta 1 release, so I believe there should not be much of a difference. However perhaps you can still try with that. If you would like me to try your new dts file again, please do let me know. I can cross check again.
If I’m enabling the touchscreen, the internal temperature sensor is working again!
I’m pretty new to kernel and dtb so it is a bit hard to me to figure out where the issue is coming from. I think I could live with the touchscreen enabled as a workaround, but I would like to understand how to have internal temperature without touchscreen enabled.
Is there some test I can do to narrow the issue?
I have tried to:
add the touchscreen gpio pinctrl config to the pinctrl_additionalgpio config, withtout success
I have tried and here are the results:
Colibri board flashed with my original dtb with the touchscreen disabled
Plugged on my custom board → temperature KO with a fixed value for device 0 and 1: 496195.
Plugged on a reference Iris board → temperature OK with changing values for device 0 and 1: around 44021.
The only difference I can see in the dmesg are the error with rtc-ds1307 that is not connected on my custom board. link text
Hm, this is likely a hardware issue then. Note that since the temperature sensor is part of the ADC, analog ground (AGND) and anlog 3.3V need to be provided. Can you check your design with regards to this?
I’m not able to identify the AGND and 3V3 analog from the Colibri pinout.
I just know that the VSS_AUDIO (pin 9/11) and VDD_ANALOG (pin 10/12) are not connected on our custom board. All other GND (39/41/83/109/147/181/197/199) and 3V3 (42/84/108/182/148/198/200) are connected.
It is very important that the AVDD_AUDIO (pin 10 and 12) are connected to a 3.3V source and the VSS_AUDIO (pin 9 and 11) are connected to GND. Since the internal ADC is powered from this rail, the temperature sensor will not work if the voltage is missing.
The touch screen circuit is also using the ADC pins. If you do not add the AVDD_AUDIO and enable the touch screen, there might be a back feeding that will rise up the AVDD_AUDIO rail a bit. This might be enough to get the ADC somehow running. I doubt that the the temperature read out will be very accurate if the ADC is only feed through a back feeding path.