Hi All,
Recently we migrate from SDK6 (kernel 3.2.0) to SDK8 (kernel 3.14.26), and I have a problem with config ADC (no TouchScreen, only ADC) into DT.
I need to config AIN5 and AIN6 in One-shot Mode.
With old kernel it work fine with config:
static struct adc_data am335x_adc_data = { .adc_channels = 8, }; static struct mfd_tscadc_board tscadc = { .adc_init = &am335x_adc_data, }; static void adc_init(void) { int err; pr_info("Enable ADC...\n"); err = am33xx_register_mfd_tscadc(&tscadc); if (err) pr_err("failed to register ADC/Touchscreen device\n"); }
My device tree for kernel 3.14:
#include "am33xx.dtsi" &tscadc { status = "okay"; adc { ti,adc-channels = <5 6 7>; }; };
I tried to use as in old kernel:
echo "oneshot" > /sys/bus/iio/devices/iio\:device0/mode cat /sys/bus/iio/devices/iio\:device0/in_voltage5_raw
On first read in_voltage5_raw cat print follow error: "Resource temporarily unavailable", on second read it hangs.
I try to debug adc driver (drivers/iio/adc/ti_am335x_adc.c), and the drivet hang on call function am335x_tsc_se_set_once(adc_dev->mfd_tscadc, step_en);
Also I found the following related to this topic: https://e2e.ti.com/support/arm/sitara_arm/f/791/p/413600/1468952, but can't find solution for my problem.
into menuconfig I have enabled:
CONFIG_MFD_TI_AM335X_TSCADC=y CONFIG_TI_AM335X_ADC=y
Can someone help me with ADC configuration (or help me to solve hang problem)?