Need to find an ntc thermistor temperature from within an I2C driver

Hi

I assume you have your HW right. I.e. you have a thermistor with the “murata,ncp15wb473” behaviour.
You have 1.8V on your carrier board connected to the 47k pullup, the other side of the pullup goes to the NTC and to the ADC1_IN0 on pin 8, the other side of the NTC goes to GND.

With this you should be able to get a voltage measurement out of /sys/bus/iio/devices/iio:device0/in_voltage0_raw, calculate the resistance of the NTC and check if the reading makes sense, i.e. if your HW setup is correct.

You would need to add the driver by adding CONFIG_SENSORS_NTC_THERMISTOR=y (Note the additional SENSORS_) to the kernel config.
You would need to add a child node to the adc1 node, e.g.

diff --git a/arch/arm/boot/dts/imx7-colibri.dtsi b/arch/arm/boot/dts/imx7-colibri.dtsi
index c9e50f1149d4..13c0a7c242ee 100644
--- a/arch/arm/boot/dts/imx7-colibri.dtsi
+++ b/arch/arm/boot/dts/imx7-colibri.dtsi
@@ -93,6 +93,14 @@
 
 &adc1 {
        vref-supply = <&reg_DCDC3>;
+
+       thermistor1: ncp15wb473@0 {
+               compatible = "murata,ncp15wb473";
+               pullup-uv = <1800000>;
+               pullup-ohm = <47000>;
+               pulldown-ohm = <0>;
+               io-channels = <&adc1 0>;
+       };
 };
 
 &adc2 {

With that I expect some output of the driver in dmesg, i.e ‘dmesg | grep Therm’ and I expect a new IIO device under /sys which gives access to the temperature.

Now to read the temperature from within your own kernel driver.
Add a property with a reference to the ntc node to your regulator driver and read that reference from the device tree during probe.
You should be able to access that IIO device with said reference. Compere with how the NTC driver does read the IIO voltage.

Max