iio: adc: ti_am335x_tscadc: Improve accuracy of measurement
authorVignesh R <vigneshr@ti.com>
Mon, 3 Dec 2018 08:01:18 +0000 (13:31 +0530)
committerLee Jones <lee.jones@linaro.org>
Mon, 3 Dec 2018 11:33:20 +0000 (11:33 +0000)
commit4b3ab9372ffa569827c8f7b7ffc7b69ba544a3bd
tree25e4d43f90834fc71dd5aadf768b4b654c001a16
parentb40ee006fe6a8a25093434e5d394128c356a48f3
iio: adc: ti_am335x_tscadc: Improve accuracy of measurement

When performing single ended measurements with TSCADC, its recommended
to set negative input (SEL_INM_SWC_3_0) of ADC step to ADC's VREFN in the
corresponding STEP_CONFIGx register.

Also, the positive(SEL_RFP_SWC_2_0) and negative(SEL_RFM_SWC_1_0)
reference voltage for ADC step needs to be set to VREFP and VREFN
respectively in STEP_CONFIGx register.
Without these changes, there may be variation of as much as ~2% in the
ADC's digital output which is bad for precise measurement.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/iio/adc/ti_am335x_adc.c
include/linux/mfd/ti_am335x_tscadc.h