Commit 18ce4a630452348b8308b922491130e8ce1e9134
Committed by
Vaibhav Hiremath
1 parent
a819c4feaf
Exists in
v3.2_SMARCT335xPSP_04.06.00.11
and in
3 other branches
IIO: ti_adc: Fix capture operation during resume.
The ADC needs to go through a proper initialization sequence after resuming from suspend. Signed-off-by: Russ Dill <Russ.Dill@ti.com>
Showing 1 changed file with 5 additions and 1 deletions Side-by-side Diff
drivers/staging/iio/adc/ti_adc.c
... | ... | @@ -510,12 +510,16 @@ |
510 | 510 | struct adc_device *adc_dev = tscadc_dev->adc; |
511 | 511 | unsigned int restore; |
512 | 512 | |
513 | + restore = adc_readl(adc_dev, TSCADC_REG_CTRL); | |
514 | + restore &= ~(TSCADC_CNTRLREG_TSCSSENB); | |
515 | + adc_writel(adc_dev, TSCADC_REG_CTRL, restore); | |
516 | + | |
513 | 517 | adc_writel(adc_dev, TSCADC_REG_FIFO1THR, FIFO1_THRESHOLD); |
514 | 518 | adc_step_config(adc_dev, adc_dev->is_continuous_mode); |
515 | 519 | |
516 | 520 | /* Make sure ADC is powered up */ |
517 | - restore = adc_readl(adc_dev, TSCADC_REG_CTRL); | |
518 | 521 | restore &= ~(TSCADC_CNTRLREG_POWERDOWN); |
522 | + restore |= TSCADC_CNTRLREG_TSCSSENB; | |
519 | 523 | adc_writel(adc_dev, TSCADC_REG_CTRL, restore); |
520 | 524 | return 0; |
521 | 525 | } |