Other Parts Discussed in Thread: TPS65217
I updated my project based on AM3352. I changed Buildroot 2016.02 to 2023.05.1 and updated the kernel from 4.4.197 to 6.1. I have adapted DTS to the new kernel. There is a problem with the ADC when measuring the battery on channel 7. On the old kernel, the measurement worked, with the new kernel, the driver seems to be working, but the measurement is strange, it measures something and does not change when I connect the batteries. I tested the same HW on the old and the new one. So it's not a problem with HW.
Old kernel and DTS fragment:
/* TPS65217 charger */
&tps {
tps65217-charger {
compatible = "ti,tps65217-charger";
};
};
/* ADC channel 7 for TPS65217 MUX_OUT */
&tscadc {
status = "okay";
adc {
ti,adc-channels = <7>;
};
};
Battery disconnected:
# cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw
160
# cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw
161
# cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw
161
# cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw
159
# cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw
New kernel and DTS fragment:
/* TPS65217 charger */
&tps {
interrupt-parent = <&intc>;
interrupts = <7>; /* NNMI */
charger {
status = "okay";
};
};
/* ADC channel 7 for TPS65217 MUX_OUT */
&tscadc {
status = "okay";
adc {
ti,adc-channels = <7>;
};
};
Here the measurement is the same when the battery is connected or disconnected
# cat /sys/bus/iio/devices/iio\:device0/in_voltage7_raw
646
# cat /sys/bus/iio/devices/iio\:device0/in_voltage7_raw
643
# cat /sys/bus/iio/devices/iio\:device0/in_voltage7_raw
641
# cat /sys/bus/iio/devices/iio\:device0/in_voltage7_raw
639
I have configured other channels and the situation is similar:
# cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw 462 565 559 623 # cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw 462 564 556 618 # cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw 462 565 557 619 # cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw 461 564 557 610 # cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw 462 565 556 612 # cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw 460 564 557 618 # cat /sys/bus/iio/devices/iio\:device0/in_voltage*_raw 463 565 557 613