iio: saradc: add support for g12a
authorXingyu Chen <xingyu.chen@amlogic.com>
Thu, 18 Jan 2018 08:25:35 +0000 (16:25 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Fri, 2 Mar 2018 07:07:52 +0000 (15:07 +0800)
commit2b0ffa74a508ad9c8187c599d43f249120ce97ef
treeedfff4fee9fd8f656bc3a2ea4f9a506e5651cdc5
parent948c49455e9d7d97d6c8d70cc96d3095d30f3537
iio: saradc: add support for g12a

PD#156734: iio: saradc: add support for g12a

Add period sampling mode for g12a and next, here are a brief overview:

1. Enable period sampling mode

echo 1  > /sys/bus/iio/devices/iio:device0/buffer/enable

2. Set the sampling interval
The sampling interval can be set in dts by the two params:
<1> amlogic,delay-per-tick
<2> amlogic,ticks-per-period

If there are no define the params above, and the channel list is
sampled every 1ms by default.

3. Read sampling data from buffer
this currently provides no buffer events so it is up to userspace to
work out how often to read from the buffer. therefore, if you want to
read continuous sampling data from buffer, please use application.

Eg:
[kernel]/tools/iio/iio_generic_buffer.c

Change-Id: I27f904e2736768eacc9d73ff24078bd659e37049
Signed-off-by: Xingyu Chen <xingyu.chen@amlogic.com>
Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.txt
arch/arm/configs/meson32_defconfig
arch/arm64/boot/dts/amlogic/mesong12a.dtsi
arch/arm64/configs/meson64_defconfig
arch/arm64/configs/meson64_smarthome_defconfig
drivers/amlogic/iio/adc/Kconfig
drivers/amlogic/iio/adc/meson_saradc.c