saradc: refactor the driver based on the iio sub-system
authorXingyu Chen <xingyu.chen@amlogic.com>
Tue, 14 Mar 2017 03:06:43 +0000 (11:06 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Tue, 27 Jun 2017 09:31:03 +0000 (02:31 -0700)
commit30e7250dfd9593fd6e95103f3471b4c4642c44a1
treef36d5b39db861a16c4da38351edcfe0aff3ea5b5
parent99a3f481278b602a26377ca5f3cec4cc25aa9bde
saradc: refactor the driver based on the iio sub-system

PD#146222: saradc: refactor the driver based on the iio sub-system

the sar adc driver has been moved from directory input/saradc
into directory iio/adc, and is refactored base on the standard
iio sub-system.

the iio sub-system provide two ways to access sar adc resources:
1. standard api for consumer driver
it can be found at the file "include/linux/iio/consumer.h".

2. sysfs interface for user space(X: 0-7)
  - obtain 10-bit sample value:
  cat sys/bus/iio/devices/iio:device0/in_voltage[X]_input

  - obtain raw sample value(10-bit or 12-bit):
  cat sys/bus/iio/devices/iio:device0/in_voltage[X]_raw

  - obtain mean raw sample value:
  cat sys/bus/iio/devices/iio:device0/in_voltage[X]_mean_raw

test pass on the gxl skt, axg skt, m200.

Change-Id: I6c8877c782c51a01993557cabc0d43f212a8e524
Signed-off-by: xingyu.chen <xingyu.chen@amlogic.com>
30 files changed:
Documentation/devicetree/bindings/amlogic/input/amlogic-saradc.txt [deleted file]
Documentation/devicetree/bindings/iio/adc/amlogic,meson-saradc.txt [new file with mode: 0644]
MAINTAINERS
arch/arm/boot/dts/amlogic/meson8b.dtsi
arch/arm/boot/dts/amlogic/meson8b_m200.dts
arch/arm/boot/dts/amlogic/meson8b_m400.dts
arch/arm/boot/dts/amlogic/meson8b_skt.dts
arch/arm/configs/meson32_defconfig
arch/arm64/boot/dts/amlogic/mesonaxg.dtsi
arch/arm64/boot/dts/amlogic/mesongxl.dtsi
arch/arm64/boot/dts/amlogic/mesongxm.dtsi
arch/arm64/configs/meson64_defconfig
drivers/amlogic/Kconfig
drivers/amlogic/Makefile
drivers/amlogic/iio/Kconfig [new file with mode: 0644]
drivers/amlogic/iio/Makefile [new file with mode: 0644]
drivers/amlogic/iio/adc/Kconfig [new file with mode: 0644]
drivers/amlogic/iio/adc/Makefile [new file with mode: 0644]
drivers/amlogic/iio/adc/meson_saradc.c [new file with mode: 0644]
drivers/amlogic/input/Kconfig
drivers/amlogic/input/Makefile
drivers/amlogic/input/saradc/Kconfig [deleted file]
drivers/amlogic/input/saradc/Makefile [deleted file]
drivers/amlogic/input/saradc/saradc.c [deleted file]
drivers/amlogic/input/saradc/saradc_reg.h [deleted file]
drivers/amlogic/spicc/spicc.c
drivers/amlogic/spicc/spicc.h
drivers/amlogic/thermal/aml_thermal_hw_m8b.c
include/dt-bindings/iio/adc/amlogic-saradc.h [new file with mode: 0644]
include/linux/amlogic/saradc.h [deleted file]