From 5f688e1814510de5a2ca6248a60f0997d3ad55a6 Mon Sep 17 00:00:00 2001 From: Hyunki Koo Date: Thu, 18 Dec 2014 23:03:13 +0900 Subject: [PATCH] [COMMON] iio: exynos_adc: change ADC_V2_CON2_C_TIME from 0 to 6 This patch change CTIME value from 1 to 64 to reduce measurement deviation. CTIME means the sampling number of measurement. Change-Id: Ide0de728ab21f0bd71a705fffb30956929f4e84d Signed-off-by: Hyunki Koo Signed-off-by: Changki Kim Signed-off-by: Kyungwoo Kang --- drivers/iio/adc/exynos_adc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c index cafb117270f5..2fac7be2b4d8 100644 --- a/drivers/iio/adc/exynos_adc.c +++ b/drivers/iio/adc/exynos_adc.c @@ -403,7 +403,7 @@ static void exynos_adc_v2_init_hw(struct exynos_adc *info) writel(con1, ADC_V2_CON1(info->regs)); con2 = ADC_V2_CON2_OSEL | ADC_V2_CON2_ESEL | - ADC_V2_CON2_HIGHF | ADC_V2_CON2_C_TIME(0); + ADC_V2_CON2_HIGHF | ADC_V2_CON2_C_TIME(6); writel(con2, ADC_V2_CON2(info->regs)); /* Enable interrupts */ @@ -412,11 +412,12 @@ static void exynos_adc_v2_init_hw(struct exynos_adc *info) static void exynos_adc_v2_exit_hw(struct exynos_adc *info) { - u32 con; + u32 con2; - con = readl(ADC_V2_CON1(info->regs)); - con &= ~ADC_CON_EN_START; - writel(con, ADC_V2_CON1(info->regs)); + con2 = readl(ADC_V2_CON2(info->regs)); + con2 &= ~(ADC_V2_CON2_OSEL | ADC_V2_CON2_ESEL | + ADC_V2_CON2_HIGHF | ADC_V2_CON2_C_TIME(7)); + writel(con2, ADC_V2_CON2(info->regs)); /* Disable interrupts */ writel(0, ADC_V2_INT_EN(info->regs)); -- 2.20.1